analytica-frontend-lib 1.2.84 → 1.2.86
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/RecommendedLessonsHistory/index.js +337 -165
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +286 -114
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/hooks/useGoalDrafts/index.d.ts +57 -0
- package/dist/hooks/useGoalDrafts/index.d.ts.map +1 -0
- package/dist/hooks/useGoalDrafts/index.js +189 -0
- package/dist/hooks/useGoalDrafts/index.js.map +1 -0
- package/dist/hooks/useGoalDrafts/index.mjs +151 -0
- package/dist/hooks/useGoalDrafts/index.mjs.map +1 -0
- package/dist/hooks/useGoalDrafts.d.ts +57 -0
- package/dist/hooks/useGoalDrafts.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.js +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.mjs +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +690 -430
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -316
- package/dist/index.mjs.map +1 -1
- package/dist/types/lessonAvailability.d.ts +33 -0
- package/dist/types/lessonAvailability.d.ts.map +1 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts +45 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lesson Availability Types
|
|
3
|
+
* Types and constants for recommended lesson availability based on dates
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Lesson availability status enum
|
|
7
|
+
* Used to determine if a recommended lesson is available based on start/end dates
|
|
8
|
+
*/
|
|
9
|
+
export declare const LESSON_AVAILABILITY: {
|
|
10
|
+
/** Lesson is available for access */
|
|
11
|
+
readonly DISPONIVEL: "DISPONIVEL";
|
|
12
|
+
/** Lesson has not started yet (current date < startDate) */
|
|
13
|
+
readonly NAO_INICIADA: "NAO_INICIADA";
|
|
14
|
+
/** Lesson has expired (current date > finalDate) */
|
|
15
|
+
readonly EXPIRADA: "EXPIRADA";
|
|
16
|
+
};
|
|
17
|
+
export type LessonAvailability = (typeof LESSON_AVAILABILITY)[keyof typeof LESSON_AVAILABILITY];
|
|
18
|
+
/**
|
|
19
|
+
* Result interface for lesson availability check
|
|
20
|
+
*/
|
|
21
|
+
export interface LessonAvailabilityResult {
|
|
22
|
+
/** Current availability status */
|
|
23
|
+
status: LessonAvailability;
|
|
24
|
+
/** Parsed start date object */
|
|
25
|
+
startDate: Date | null;
|
|
26
|
+
/** Parsed end date object */
|
|
27
|
+
endDate: Date | null;
|
|
28
|
+
/** Formatted start date string for display (DD/MM/YYYY) */
|
|
29
|
+
formattedStartDate: string | null;
|
|
30
|
+
/** Formatted end date string for display (DD/MM/YYYY) */
|
|
31
|
+
formattedEndDate: string | null;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=lessonAvailability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessonAvailability.d.ts","sourceRoot":"","sources":["../../src/types/lessonAvailability.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,qCAAqC;;IAErC,4DAA4D;;IAE5D,oDAAoD;;CAE5C,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,kCAAkC;IAClC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,+BAA+B;IAC/B,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,6BAA6B;IAC7B,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lesson Availability Utilities
|
|
3
|
+
* Helper functions for checking recommended lesson availability based on dates
|
|
4
|
+
*/
|
|
5
|
+
import { type LessonAvailabilityResult } from '../types/lessonAvailability';
|
|
6
|
+
/**
|
|
7
|
+
* Check lesson availability based on start and end dates
|
|
8
|
+
* @param startDate - ISO string for lesson start date (when it becomes available)
|
|
9
|
+
* @param finalDate - ISO string for lesson end date (when it expires)
|
|
10
|
+
* @returns LessonAvailabilityResult with status and formatted dates
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const result = checkLessonAvailability('2024-01-01', '2024-12-31');
|
|
15
|
+
* // { status: 'DISPONIVEL', startDate: Date, endDate: Date, ... }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const checkLessonAvailability: (startDate: string | null, finalDate: string | null) => LessonAvailabilityResult;
|
|
19
|
+
/**
|
|
20
|
+
* Check if a lesson is not yet available (before start date)
|
|
21
|
+
* @param startDate - ISO string for lesson start date
|
|
22
|
+
* @returns true if the lesson has not started yet
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* if (isLessonNotYetAvailable('2025-01-01')) {
|
|
27
|
+
* showNotAvailableModal();
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const isLessonNotYetAvailable: (startDate: string | null) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Check if a lesson has expired (after end date)
|
|
34
|
+
* @param finalDate - ISO string for lesson end date
|
|
35
|
+
* @returns true if the lesson has expired
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* if (isLessonExpired('2023-12-31')) {
|
|
40
|
+
* showExpiredView();
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const isLessonExpired: (finalDate: string | null) => boolean;
|
|
45
|
+
//# sourceMappingURL=lessonAvailabilityUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessonAvailabilityUtils.d.ts","sourceRoot":"","sources":["../../src/utils/lessonAvailabilityUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,6BAA6B,CAAC;AAyBrC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,GAClC,WAAW,MAAM,GAAG,IAAI,EACxB,WAAW,MAAM,GAAG,IAAI,KACvB,wBAmBF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,GAAI,WAAW,MAAM,GAAG,IAAI,KAAG,OAGlE,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,GAAG,IAAI,KAAG,OAG1D,CAAC"}
|
package/package.json
CHANGED