@instructure/platform-widget-dashboard 0.1.0 → 0.2.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/dist/components/shared/CourseWorkItem.d.ts +9 -0
- package/dist/components/shared/CourseWorkItem.d.ts.map +1 -0
- package/dist/components/shared/WidgetContextMenu.d.ts +1 -0
- package/dist/components/shared/WidgetContextMenu.d.ts.map +1 -1
- package/dist/components/widgets/CourseGradesWidget/utils.d.ts +13 -0
- package/dist/components/widgets/CourseGradesWidget/utils.d.ts.map +1 -0
- package/dist/components/widgets/TemplateWidget/TemplateWidget.d.ts +6 -1
- package/dist/components/widgets/TemplateWidget/TemplateWidget.d.ts.map +1 -1
- package/dist/components/widgets/TemplateWidget/index.d.ts +2 -2
- package/dist/components/widgets/TemplateWidget/index.d.ts.map +1 -1
- package/dist/components/widgets/TodoListWidget/hooks/useCreatePlannerNote.d.ts +4 -0
- package/dist/components/widgets/TodoListWidget/hooks/useCreatePlannerNote.d.ts.map +1 -0
- package/dist/components/widgets/TodoListWidget/hooks/usePlannerOverride.d.ts +12 -0
- package/dist/components/widgets/TodoListWidget/hooks/usePlannerOverride.d.ts.map +1 -0
- package/dist/constants/index.d.ts +64 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants.d.ts +64 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/contexts/TranslationsContext.d.ts +188 -0
- package/dist/contexts/TranslationsContext.d.ts.map +1 -0
- package/dist/graphql/coursePeople.d.ts +46 -0
- package/dist/graphql/coursePeople.d.ts.map +1 -0
- package/dist/hooks/useAnnouncements.d.ts +35 -0
- package/dist/hooks/useAnnouncements.d.ts.map +1 -0
- package/dist/hooks/useCourseInstructors.d.ts +58 -0
- package/dist/hooks/useCourseInstructors.d.ts.map +1 -0
- package/dist/hooks/useCourseWork.d.ts +67 -0
- package/dist/hooks/useCourseWork.d.ts.map +1 -0
- package/dist/hooks/useCourseWorkStatistics.d.ts +11 -0
- package/dist/hooks/useCourseWorkStatistics.d.ts.map +1 -0
- package/dist/hooks/useInboxMessages.d.ts +10 -0
- package/dist/hooks/useInboxMessages.d.ts.map +1 -0
- package/dist/hooks/useRecentGrades.d.ts +31 -0
- package/dist/hooks/useRecentGrades.d.ts.map +1 -0
- package/dist/hooks/useTabState.d.ts +7 -0
- package/dist/hooks/useTabState.d.ts.map +1 -0
- package/dist/hooks/useToggleAnnouncementReadState.d.ts +17 -0
- package/dist/hooks/useToggleAnnouncementReadState.d.ts.map +1 -0
- package/dist/hooks/useWidgetDashboardContext.d.ts +48 -0
- package/dist/hooks/useWidgetDashboardContext.d.ts.map +1 -0
- package/dist/hooks/useWidgetDashboardEdit.d.ts +20 -0
- package/dist/hooks/useWidgetDashboardEdit.d.ts.map +1 -0
- package/dist/hooks/useWidgetLayout.d.ts +21 -0
- package/dist/hooks/useWidgetLayout.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3944 -3795
- package/dist/types/env.d.ts +4 -0
- package/dist/types/env.d.ts.map +1 -1
- package/dist/utils/assignmentUtils.d.ts +17 -0
- package/dist/utils/assignmentUtils.d.ts.map +1 -0
- package/dist/utils/courseCodeUtils.d.ts +11 -0
- package/dist/utils/courseCodeUtils.d.ts.map +1 -0
- package/dist/utils/dateUtils.d.ts +18 -0
- package/dist/utils/dateUtils.d.ts.map +1 -0
- package/dist/utils/persister.d.ts +3 -0
- package/dist/utils/persister.d.ts.map +1 -0
- package/locales/en.json +170 -0
- package/package.json +2 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface CourseWorkItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
course: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
dueAt: string | null;
|
|
9
|
+
points: number | null;
|
|
10
|
+
htmlUrl: string;
|
|
11
|
+
type: 'assignment' | 'quiz' | 'discussion';
|
|
12
|
+
late: boolean;
|
|
13
|
+
missing: boolean;
|
|
14
|
+
state: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CourseWorkPaginationInfo {
|
|
17
|
+
hasNextPage: boolean;
|
|
18
|
+
hasPreviousPage: boolean;
|
|
19
|
+
endCursor: string | null;
|
|
20
|
+
startCursor: string | null;
|
|
21
|
+
totalCount: number | null;
|
|
22
|
+
}
|
|
23
|
+
export interface CourseWorkResult {
|
|
24
|
+
items: CourseWorkItem[];
|
|
25
|
+
pageInfo: CourseWorkPaginationInfo;
|
|
26
|
+
}
|
|
27
|
+
export interface UseCourseWorkOptions {
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
courseFilter?: string;
|
|
30
|
+
startDate?: string;
|
|
31
|
+
endDate?: string;
|
|
32
|
+
includeOverdue?: boolean;
|
|
33
|
+
includeNoDueDate?: boolean;
|
|
34
|
+
onlySubmitted?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Calculate a GraphQL cursor for a specific page
|
|
38
|
+
* Cursor represents the starting offset for the page (0-indexed position)
|
|
39
|
+
*/
|
|
40
|
+
export declare function calculateCursorForPage(pageIndex: number, pageSize: number): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Fetch a specific page of course work directly by calculating its cursor
|
|
43
|
+
*/
|
|
44
|
+
export declare function fetchCourseWorkPage(pageIndex: number, options: UseCourseWorkOptions | undefined, observedUserId: string | null | undefined, executeQuery: (query: any, variables: any) => Promise<any>, currentUserId: string): Promise<CourseWorkResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Original infinite query hook for sequential pagination
|
|
47
|
+
* Used by widgets that load pages sequentially (e.g., CourseWorkSummaryWidget)
|
|
48
|
+
*/
|
|
49
|
+
export declare function useCourseWork(options?: UseCourseWorkOptions): import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/react-query').InfiniteData<CourseWorkResult, unknown>, Error>;
|
|
50
|
+
/**
|
|
51
|
+
* Enhanced hook for direct page jumping with caching
|
|
52
|
+
* Uses TanStack Query for automatic caching and persistence
|
|
53
|
+
* Used by widgets that need to jump directly to any page (e.g., CourseWorkWidget, CourseWorkCombinedWidget)
|
|
54
|
+
*/
|
|
55
|
+
export declare function useCourseWorkPaginated(options?: UseCourseWorkOptions): {
|
|
56
|
+
currentPage: CourseWorkResult | undefined;
|
|
57
|
+
currentPageIndex: number;
|
|
58
|
+
totalPages: number;
|
|
59
|
+
totalCount: number | null;
|
|
60
|
+
goToPage: (pageNumber: number) => void;
|
|
61
|
+
resetPagination: () => void;
|
|
62
|
+
refetch: () => Promise<import('@tanstack/react-query').QueryObserverResult<CourseWorkResult, Error>>;
|
|
63
|
+
isLoading: boolean;
|
|
64
|
+
error: Error | null;
|
|
65
|
+
pageSize: number;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=useCourseWork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCourseWork.d.ts","sourceRoot":"","sources":["../../src/hooks/useCourseWork.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,YAAY,CAAA;IAC1C,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAmJD,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,QAAQ,EAAE,wBAAwB,CAAA;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAYD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9F;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,YAAK,EAClC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,YAAY,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EAC1D,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAyE3B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,0IAyH/D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,oBAAyB;;;;;2BAsE7B,MAAM;;;;WA4B9B,KAAK,GAAG,IAAI;;EAG/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { CourseWorkSummary } from '../types';
|
|
3
|
+
|
|
4
|
+
interface CourseWorkStatisticsParams {
|
|
5
|
+
startDate: Date;
|
|
6
|
+
endDate: Date;
|
|
7
|
+
courseId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function useCourseWorkStatistics(params: CourseWorkStatisticsParams): UseQueryResult<CourseWorkSummary, Error>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=useCourseWorkStatistics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCourseWorkStatistics.d.ts","sourceRoot":"","sources":["../../src/hooks/useCourseWorkStatistics.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAA;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA0BjD,UAAU,0BAA0B;IAClC,SAAS,EAAE,IAAI,CAAA;IACf,OAAO,EAAE,IAAI,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AA0DD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,GACjC,cAAc,CAAC,iBAAiB,EAAE,KAAK,CAAC,CA4C1C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InboxMessage } from '../types';
|
|
2
|
+
|
|
3
|
+
export type InboxFilter = 'all' | 'unread';
|
|
4
|
+
interface UseInboxMessagesOptions {
|
|
5
|
+
limit?: number;
|
|
6
|
+
filter?: InboxFilter;
|
|
7
|
+
}
|
|
8
|
+
export declare function useInboxMessages(options?: UseInboxMessagesOptions): import('@tanstack/react-query').UseQueryResult<InboxMessage[], Error>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useInboxMessages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInboxMessages.d.ts","sourceRoot":"","sources":["../../src/hooks/useInboxMessages.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAG5C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE1C,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AA+JD,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,yEAsBrE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RecentGradeSubmission } from '../types';
|
|
2
|
+
|
|
3
|
+
export interface RecentGradesPaginationInfo {
|
|
4
|
+
hasNextPage: boolean;
|
|
5
|
+
hasPreviousPage: boolean;
|
|
6
|
+
endCursor: string | null;
|
|
7
|
+
startCursor: string | null;
|
|
8
|
+
totalCount: number | null;
|
|
9
|
+
}
|
|
10
|
+
export interface RecentGradesResult {
|
|
11
|
+
submissions: RecentGradeSubmission[];
|
|
12
|
+
pageInfo: RecentGradesPaginationInfo;
|
|
13
|
+
}
|
|
14
|
+
export interface UseRecentGradesOptions {
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
courseFilter?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function calculateCursorForPage(pageIndex: number, pageSize: number): string | undefined;
|
|
19
|
+
export declare function useRecentGrades(options?: UseRecentGradesOptions): {
|
|
20
|
+
currentPage: RecentGradesResult | undefined;
|
|
21
|
+
currentPageIndex: number;
|
|
22
|
+
totalPages: number;
|
|
23
|
+
totalCount: number | null;
|
|
24
|
+
goToPage: (pageNumber: number) => void;
|
|
25
|
+
resetPagination: () => void;
|
|
26
|
+
refetch: () => Promise<import('@tanstack/react-query').QueryObserverResult<RecentGradesResult, Error>>;
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
error: Error | null;
|
|
29
|
+
pageSize: number;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=useRecentGrades.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecentGrades.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecentGrades.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AA4GrD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,qBAAqB,EAAE,CAAA;IACpC,QAAQ,EAAE,0BAA0B,CAAA;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9F;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B;;;;;2BA6GxB,MAAM;;;;WA2B9B,KAAK,GAAG,IAAI;;EAG/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabState.d.ts","sourceRoot":"","sources":["../../src/hooks/useTabState.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AASrC,wBAAgB,WAAW,CAAC,UAAU,GAAE,KAAyB;;6BAiBrD,KAAK;EAchB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface UpdateDiscussionReadStateVariables {
|
|
2
|
+
discussionTopicId: string;
|
|
3
|
+
read: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface UpdateDiscussionReadStateResponse {
|
|
6
|
+
updateDiscussionReadState: {
|
|
7
|
+
discussionTopic: {
|
|
8
|
+
_id: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
errors?: Array<{
|
|
12
|
+
message: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare function useToggleAnnouncementReadState(): import('@tanstack/react-query').UseMutationResult<UpdateDiscussionReadStateResponse, Error, UpdateDiscussionReadStateVariables, unknown>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=useToggleAnnouncementReadState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToggleAnnouncementReadState.d.ts","sourceRoot":"","sources":["../../src/hooks/useToggleAnnouncementReadState.ts"],"names":[],"mappings":"AAuBA,UAAU,kCAAkC;IAC1C,iBAAiB,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE,OAAO,CAAA;CACd;AAED,UAAU,iCAAiC;IACzC,yBAAyB,EAAE;QACzB,eAAe,EAAE;YACf,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;KACF,CAAA;IACD,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACpC;AAeD,wBAAgB,8BAA8B,6IA4B7C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CurrentUser, DashboardFeatures, DashboardPreferences, ObservedUser, SharedCourseData } from '../types';
|
|
3
|
+
|
|
4
|
+
export type { SharedCourseData };
|
|
5
|
+
export declare const WidgetDashboardProvider: ({ children, preferences, observedUsersList, canAddObservee, currentUser, observedUserId, currentUserRoles, sharedCourseData, dashboardFeatures, }: {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
preferences?: DashboardPreferences;
|
|
8
|
+
observedUsersList?: ObservedUser[];
|
|
9
|
+
canAddObservee?: boolean;
|
|
10
|
+
currentUser?: CurrentUser | null;
|
|
11
|
+
observedUserId?: string | null;
|
|
12
|
+
currentUserRoles?: string[];
|
|
13
|
+
sharedCourseData?: SharedCourseData[];
|
|
14
|
+
dashboardFeatures?: DashboardFeatures;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function useWidgetDashboard(): {
|
|
17
|
+
preferences: DashboardPreferences;
|
|
18
|
+
observedUsersList: ObservedUser[];
|
|
19
|
+
canAddObservee: boolean;
|
|
20
|
+
currentUser: CurrentUser | null;
|
|
21
|
+
observedUserId: string | null;
|
|
22
|
+
currentUserRoles: string[];
|
|
23
|
+
sharedCourseData: SharedCourseData[];
|
|
24
|
+
dashboardFeatures: DashboardFeatures;
|
|
25
|
+
widgetConfig: Record<string, Record<string, unknown>>;
|
|
26
|
+
updateWidgetConfig: (widgetId: string, config: Record<string, unknown>) => void;
|
|
27
|
+
updateCourseColor: (courseId: string, color: string) => void;
|
|
28
|
+
updateCourseNickname: (courseId: string, nickname: string) => void;
|
|
29
|
+
};
|
|
30
|
+
export declare const widgetDashboardDefaultProps: {
|
|
31
|
+
preferences: {
|
|
32
|
+
dashboard_view: string;
|
|
33
|
+
hide_dashcard_color_overlays: boolean;
|
|
34
|
+
custom_colors: {};
|
|
35
|
+
learner_dashboard_tab_selection: "dashboard";
|
|
36
|
+
widget_dashboard_config: {
|
|
37
|
+
filters: {};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
observedUsersList: never[];
|
|
41
|
+
canAddObservee: boolean;
|
|
42
|
+
currentUser: null;
|
|
43
|
+
observedUserId: null;
|
|
44
|
+
currentUserRoles: never[];
|
|
45
|
+
sharedCourseData: never[];
|
|
46
|
+
dashboardFeatures: {};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useWidgetDashboardContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWidgetDashboardContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useWidgetDashboardContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAoE,MAAM,OAAO,CAAA;AACxF,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EACjB,MAAM,UAAU,CAAA;AAGjB,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAkChC,eAAO,MAAM,uBAAuB,GAAI,mJAUrC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,oBAAoB,CAAA;IAClC,iBAAiB,CAAC,EAAE,YAAY,EAAE,CAAA;IAClC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAChC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,4CA8EA,CAAA;AAED,wBAAgB,kBAAkB;iBAnInB,oBAAoB;uBACd,YAAY,EAAE;oBACjB,OAAO;iBACV,WAAW,GAAG,IAAI;oBACf,MAAM,GAAG,IAAI;sBACX,MAAM,EAAE;sBACR,gBAAgB,EAAE;uBACjB,iBAAiB;kBACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;wBACjC,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI;uBAC5D,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI;0BACtC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI;EA0HnE;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;CAiBvC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { WidgetConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
interface WidgetDashboardEditContextType {
|
|
5
|
+
isEditMode: boolean;
|
|
6
|
+
isDirty: boolean;
|
|
7
|
+
isSaving: boolean;
|
|
8
|
+
saveError: string | null;
|
|
9
|
+
enterEditMode: () => void;
|
|
10
|
+
exitEditMode: () => void;
|
|
11
|
+
saveChanges: (config: WidgetConfig) => Promise<void>;
|
|
12
|
+
markDirty: () => void;
|
|
13
|
+
clearError: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const WidgetDashboardEditProvider: React.FC<{
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function useWidgetDashboardEdit(): WidgetDashboardEditContextType;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=useWidgetDashboardEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWidgetDashboardEdit.d.ts","sourceRoot":"","sources":["../../src/hooks/useWidgetDashboardEdit.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAG/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAS5C,UAAU,8BAA8B;IACtC,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB;AAID,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CA6E/E,CAAA;AAED,wBAAgB,sBAAsB,mCAMrC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { WidgetDashboardTranslations } from '../contexts/TranslationsContext';
|
|
3
|
+
import { WidgetConfig } from '../types';
|
|
4
|
+
|
|
5
|
+
export type MoveAction = 'move-left' | 'move-right' | 'move-left-top' | 'move-right-top' | 'move-up' | 'move-down' | 'move-up-cross' | 'move-down-cross' | 'move-to-top' | 'move-to-bottom';
|
|
6
|
+
export declare const getMoveActionDescription: (action: MoveAction, translations: WidgetDashboardTranslations) => string;
|
|
7
|
+
interface WidgetLayoutContextType {
|
|
8
|
+
config: WidgetConfig;
|
|
9
|
+
moveWidget: (widgetId: string, action: MoveAction) => void;
|
|
10
|
+
moveWidgetToPosition: (widgetId: string, targetCol: number, targetRow: number) => void;
|
|
11
|
+
removeWidget: (widgetId: string, widgetName?: string) => void;
|
|
12
|
+
addWidget: (type: string, displayName: string, col: number, row: number) => void;
|
|
13
|
+
resetConfig: () => void;
|
|
14
|
+
saveLayout: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare const WidgetLayoutProvider: React.FC<{
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function useWidgetLayout(): WidgetLayoutContextType;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useWidgetLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWidgetLayout.d.ts","sourceRoot":"","sources":["../../src/hooks/useWidgetLayout.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAE1F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAA;AAElF,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,UAAU,CAAA;AAIpD,MAAM,MAAM,UAAU,GAClB,WAAW,GACX,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,SAAS,GACT,WAAW,GACX,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,gBAAgB,CAAA;AAEpB,eAAO,MAAM,wBAAwB,GACnC,QAAQ,UAAU,EAClB,cAAc,2BAA2B,KACxC,MAqBF,CAAA;AAED,UAAU,uBAAuB;IAC/B,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;IAC1D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IACtF,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7D,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChF,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAwOD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAwKxE,CAAA;AAED,wBAAgB,eAAe,4BAM9B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export { default as WidgetDashboard, default as WidgetDashboardContainer, } from './components/WidgetDashboardContainer';
|
|
2
|
+
export type { LoadingOverlayProps, PaginationProps, TemplateWidgetProps, } from './components/widgets/TemplateWidget';
|
|
3
|
+
export { TemplateWidget } from './components/widgets/TemplateWidget';
|
|
2
4
|
export { type TranslateFunction, TranslationsProvider, type TranslationsProviderProps, useTranslations, type WidgetDashboardContext, type WidgetDashboardTranslations, } from './contexts/TranslationsContext';
|
|
3
5
|
export { ResponsiveProvider, useResponsiveContext } from './hooks/useResponsiveContext';
|
|
4
6
|
export type { SharedCourseData } from './hooks/useWidgetDashboardContext';
|
|
5
7
|
export { useWidgetDashboard, WidgetDashboardProvider, widgetDashboardDefaultProps, } from './hooks/useWidgetDashboardContext';
|
|
6
8
|
export { useWidgetDashboardEdit, WidgetDashboardEditProvider, } from './hooks/useWidgetDashboardEdit';
|
|
7
9
|
export type { MoveAction } from './hooks/useWidgetLayout';
|
|
8
|
-
export { useWidgetLayout, WidgetLayoutProvider } from './hooks/useWidgetLayout';
|
|
10
|
+
export { getMoveActionDescription, useWidgetLayout, WidgetLayoutProvider, } from './hooks/useWidgetLayout';
|
|
9
11
|
export type { CurrentUser, DashboardFeatures, DashboardPreferences, ObservedUser, } from './types/env';
|
|
10
12
|
export type { Widget, WidgetConfig, WidgetPosition, WidgetSize, } from './types/widget';
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,OAAO,IAAI,wBAAwB,GACpC,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACL,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEzE,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAA;AACvC,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,OAAO,IAAI,wBAAwB,GACpC,MAAM,uCAAuC,CAAA;AAC9C,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,mBAAmB,GACpB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EACL,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEzE,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAA;AACvC,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,oBAAoB,GACrB,MAAM,yBAAyB,CAAA;AAChC,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,GACb,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,MAAM,EACN,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,gBAAgB,CAAA"}
|