academe-kit 0.9.3 → 0.9.5
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/index.cjs +1119 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9147 -5349
- package/dist/index.esm.js +1118 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/CosmicDecor/CosmicDecor.d.ts +10 -0
- package/dist/types/components/CosmicDecor/index.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/astronaut.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/black-hole.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/earth.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/giant.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/index.d.ts +10 -0
- package/dist/types/components/CosmicDecor/planets/moon.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/neptune.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/satellite.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/saturn.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/sun.d.ts +2 -0
- package/dist/types/components/CosmicDecor/planets/types.d.ts +4 -0
- package/dist/types/components/CosmicStarsCanvas/CosmicStarsCanvas.d.ts +5 -0
- package/dist/types/components/CosmicStarsCanvas/index.d.ts +2 -0
- package/dist/types/components/JourneyStep/JourneyStep.d.ts +20 -0
- package/dist/types/components/JourneyStep/frames/circle-laurel.d.ts +2 -0
- package/dist/types/components/JourneyStep/frames/hexagon-ribbon.d.ts +2 -0
- package/dist/types/components/JourneyStep/frames/hexagon-wings.d.ts +2 -0
- package/dist/types/components/JourneyStep/frames/index.d.ts +4 -0
- package/dist/types/components/JourneyStep/frames/pentagon-crown.d.ts +2 -0
- package/dist/types/components/JourneyStep/frames/pentagon.d.ts +2 -0
- package/dist/types/components/JourneyStep/frames/shield-wings.d.ts +2 -0
- package/dist/types/components/JourneyStep/frames/types.d.ts +34 -0
- package/dist/types/components/JourneyStep/frames/utils.d.ts +23 -0
- package/dist/types/components/JourneyStep/index.d.ts +3 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/services/CertificateService.d.ts +14 -166
- package/dist/types/services/ChallengeService.d.ts +748 -0
- package/dist/types/services/StepService.d.ts +215 -0
- package/dist/types/services/index.d.ts +6 -0
- package/dist/types/services/userService.d.ts +3 -56
- package/dist/types/types/academe-api.d.ts +4186 -1179
- package/package.json +6 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './cosmic-decor.css';
|
|
2
|
+
import type { CosmicPlanet } from './planets';
|
|
3
|
+
export type { CosmicPlanet };
|
|
4
|
+
export type CosmicDecorVariant = 'page' | 'session';
|
|
5
|
+
export interface CosmicDecorProps {
|
|
6
|
+
planets?: CosmicPlanet[];
|
|
7
|
+
showSparkles?: boolean;
|
|
8
|
+
decorVariant?: CosmicDecorVariant;
|
|
9
|
+
}
|
|
10
|
+
export declare function CosmicDecor({ planets, showSparkles, decorVariant, }: CosmicDecorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { PlanetSaturn } from './saturn';
|
|
2
|
+
export { PlanetGiant } from './giant';
|
|
3
|
+
export { PlanetEarth } from './earth';
|
|
4
|
+
export { PlanetNeptune } from './neptune';
|
|
5
|
+
export { PlanetBlackHole } from './black-hole';
|
|
6
|
+
export { PlanetSun } from './sun';
|
|
7
|
+
export { PlanetMoon } from './moon';
|
|
8
|
+
export { PlanetSatellite } from './satellite';
|
|
9
|
+
export { PlanetAstronaut } from './astronaut';
|
|
10
|
+
export type { CosmicPlanet, PlanetProps } from './types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import './journey-step.css';
|
|
3
|
+
import type { FrameKind } from './frames/types';
|
|
4
|
+
export type JourneyStepSize = 'sm' | 'md';
|
|
5
|
+
export type JourneyStepType = 'challenge' | 'course' | 'tutorial' | 'publication' | 'evaluation' | 'certificate';
|
|
6
|
+
export interface JourneyStepProps {
|
|
7
|
+
color?: string;
|
|
8
|
+
stepType?: JourneyStepType;
|
|
9
|
+
frame?: FrameKind;
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
isLocked?: boolean;
|
|
13
|
+
/** 0–100; quando definido, desenha trilha de progresso ao redor do frame */
|
|
14
|
+
progress?: number;
|
|
15
|
+
size?: JourneyStepSize;
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function JourneyStep({ color, stepType, frame, icon, isActive, isLocked, progress, size, ariaLabel, className, onClick, }: JourneyStepProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type FrameKind = 'pentagon' | 'hexagonWings' | 'circleLaurel' | 'hexagonRibbon' | 'shieldWings' | 'pentagonCrown';
|
|
3
|
+
export interface PentagonTheme {
|
|
4
|
+
shadow: string;
|
|
5
|
+
outer: string;
|
|
6
|
+
outerStroke: string;
|
|
7
|
+
mid: string;
|
|
8
|
+
inner: string;
|
|
9
|
+
innerStroke: string;
|
|
10
|
+
card: string;
|
|
11
|
+
cardShine: string;
|
|
12
|
+
bookmark: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FrameLayout {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
bodyCenterX: number;
|
|
18
|
+
bodyCenterY: number;
|
|
19
|
+
iconCenterX: number;
|
|
20
|
+
iconCenterY: number;
|
|
21
|
+
iconWidth: number;
|
|
22
|
+
iconHeight: number;
|
|
23
|
+
}
|
|
24
|
+
export interface FrameRenderArgs {
|
|
25
|
+
theme: PentagonTheme;
|
|
26
|
+
scale: number;
|
|
27
|
+
layout: FrameLayout;
|
|
28
|
+
progress?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface FrameRenderer {
|
|
31
|
+
kind: FrameKind;
|
|
32
|
+
layout: (scale: number) => FrameLayout;
|
|
33
|
+
render: (args: FrameRenderArgs) => ReactNode;
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JourneyStepType } from '../JourneyStep';
|
|
2
|
+
import type { FrameKind, PentagonTheme } from './types';
|
|
3
|
+
export declare const THEMES: Record<string, PentagonTheme>;
|
|
4
|
+
export declare const STEP_TYPE_TO_THEME: Record<JourneyStepType, keyof typeof THEMES>;
|
|
5
|
+
export declare const STEP_TYPE_TO_FRAME: Record<JourneyStepType, FrameKind>;
|
|
6
|
+
export declare const INACTIVE_THEME: PentagonTheme;
|
|
7
|
+
export declare function hexToRgb(hex: string): {
|
|
8
|
+
r: number;
|
|
9
|
+
g: number;
|
|
10
|
+
b: number;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare function rgbToHsl(r: number, g: number, b: number): {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
l: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function hsl(h: number, s: number, l: number): string;
|
|
18
|
+
export declare function buildThemeFromColor(color: string): PentagonTheme;
|
|
19
|
+
export declare function polygonPoints(cx: number, cy: number, radius: number, sides: number, rotationDeg?: number): [number, number][];
|
|
20
|
+
export declare function norm([x, y]: [number, number]): [number, number];
|
|
21
|
+
export declare function scalePts(pts: [number, number][], cx: number, cy: number, factor: number): [number, number][];
|
|
22
|
+
export declare function roundedPolygonPath(pts: [number, number][], radius: number): string;
|
|
23
|
+
export declare function crownPath(cx: number, baseY: number, width: number, height: number): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ export type { RequiredClientRoles } from "./components/ProtectedApp";
|
|
|
5
5
|
export { ProtectedComponent } from "./components/ProtectedComponent";
|
|
6
6
|
export { ProtectedRouter } from "./components/ProtectedRouter";
|
|
7
7
|
export { Spinner } from "./components/ui/spinner";
|
|
8
|
+
export { CosmicDecor } from "./components/CosmicDecor";
|
|
9
|
+
export type { CosmicDecorProps, CosmicDecorVariant, CosmicPlanet, } from "./components/CosmicDecor";
|
|
10
|
+
export { CosmicStarsCanvas } from "./components/CosmicStarsCanvas";
|
|
11
|
+
export type { CosmicStarsCanvasProps } from "./components/CosmicStarsCanvas";
|
|
12
|
+
export { JourneyStep } from "./components/JourneyStep";
|
|
13
|
+
export type { JourneyStepProps, JourneyStepSize, JourneyStepType, FrameKind, } from "./components/JourneyStep";
|
|
8
14
|
export { AcademeAuthProvider, useAcademeAuth, } from "./context/SecurityProvider";
|
|
9
15
|
export { useProtectedAppColors } from "./components/ProtectedApp";
|
|
10
16
|
export type { AcademeKeycloakContextProps, SecurityProviderProps, KeycloakUser, SecurityContextType, AcademeUser, } from "./context/SecurityProvider/types";
|
|
@@ -2,7 +2,7 @@ import type { AcademeApiClient } from "./index";
|
|
|
2
2
|
import type { components } from "../types/academe-api";
|
|
3
3
|
type CreateCertificateDto = components["schemas"]["CreateCertificateDto"];
|
|
4
4
|
type UpdateCertificateDto = components["schemas"]["UpdateCertificateDto"];
|
|
5
|
-
type GenerateCertificateDto =
|
|
5
|
+
type GenerateCertificateDto = Record<string, unknown>;
|
|
6
6
|
export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
7
7
|
/**
|
|
8
8
|
* Get current user's certificates
|
|
@@ -62,52 +62,7 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
62
62
|
page?: number;
|
|
63
63
|
limit?: number;
|
|
64
64
|
includeCourse?: boolean;
|
|
65
|
-
}):
|
|
66
|
-
parameters: {
|
|
67
|
-
query?: {
|
|
68
|
-
userId?: string;
|
|
69
|
-
search?: components["parameters"]["search"];
|
|
70
|
-
page?: components["parameters"]["page"];
|
|
71
|
-
limit?: components["parameters"]["limit"];
|
|
72
|
-
includeCourse?: boolean;
|
|
73
|
-
};
|
|
74
|
-
header?: never;
|
|
75
|
-
path?: never;
|
|
76
|
-
cookie?: never;
|
|
77
|
-
};
|
|
78
|
-
requestBody?: never;
|
|
79
|
-
responses: {
|
|
80
|
-
200: {
|
|
81
|
-
headers: {
|
|
82
|
-
[name: string]: unknown;
|
|
83
|
-
};
|
|
84
|
-
content: {
|
|
85
|
-
"application/json": {
|
|
86
|
-
status?: string;
|
|
87
|
-
data?: components["schemas"]["Certificate"][];
|
|
88
|
-
meta?: {
|
|
89
|
-
total?: number;
|
|
90
|
-
page?: number;
|
|
91
|
-
limit?: number;
|
|
92
|
-
totalPages?: number;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
401: components["responses"]["Unauthorized"];
|
|
98
|
-
500: components["responses"]["ServerError"];
|
|
99
|
-
};
|
|
100
|
-
}, {
|
|
101
|
-
params: {
|
|
102
|
-
query: {
|
|
103
|
-
userId?: string;
|
|
104
|
-
search?: string;
|
|
105
|
-
page?: number;
|
|
106
|
-
limit?: number;
|
|
107
|
-
includeCourse?: boolean;
|
|
108
|
-
} | undefined;
|
|
109
|
-
};
|
|
110
|
-
}, `${string}/${string}`>>;
|
|
65
|
+
}): any;
|
|
111
66
|
/**
|
|
112
67
|
* Get certificate by ID
|
|
113
68
|
*/
|
|
@@ -148,83 +103,11 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
148
103
|
/**
|
|
149
104
|
* Download all certificates of a given user as a single merged PDF
|
|
150
105
|
*/
|
|
151
|
-
downloadAll(userId: string):
|
|
152
|
-
parameters: {
|
|
153
|
-
query?: never;
|
|
154
|
-
header?: never;
|
|
155
|
-
path: {
|
|
156
|
-
userId: string;
|
|
157
|
-
};
|
|
158
|
-
cookie?: never;
|
|
159
|
-
};
|
|
160
|
-
requestBody?: never;
|
|
161
|
-
responses: {
|
|
162
|
-
200: {
|
|
163
|
-
headers: {
|
|
164
|
-
"Content-Disposition"?: string;
|
|
165
|
-
[name: string]: unknown;
|
|
166
|
-
};
|
|
167
|
-
content: {
|
|
168
|
-
"application/pdf": string;
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
401: components["responses"]["Unauthorized"];
|
|
172
|
-
404: {
|
|
173
|
-
headers: {
|
|
174
|
-
[name: string]: unknown;
|
|
175
|
-
};
|
|
176
|
-
content: {
|
|
177
|
-
"application/json": {
|
|
178
|
-
status?: string;
|
|
179
|
-
message?: string;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
500: components["responses"]["ServerError"];
|
|
184
|
-
};
|
|
185
|
-
}, {
|
|
186
|
-
params: {
|
|
187
|
-
path: {
|
|
188
|
-
userId: string;
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
parseAs: "blob";
|
|
192
|
-
}, `${string}/${string}`>>;
|
|
106
|
+
downloadAll(userId: string): any;
|
|
193
107
|
/**
|
|
194
108
|
* Download certificate PDF
|
|
195
109
|
*/
|
|
196
|
-
download(id: string):
|
|
197
|
-
parameters: {
|
|
198
|
-
query?: never;
|
|
199
|
-
header?: never;
|
|
200
|
-
path: {
|
|
201
|
-
id: components["parameters"]["id"];
|
|
202
|
-
};
|
|
203
|
-
cookie?: never;
|
|
204
|
-
};
|
|
205
|
-
requestBody?: never;
|
|
206
|
-
responses: {
|
|
207
|
-
200: {
|
|
208
|
-
headers: {
|
|
209
|
-
[name: string]: unknown;
|
|
210
|
-
};
|
|
211
|
-
content: {
|
|
212
|
-
"application/pdf": string;
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
401: components["responses"]["Unauthorized"];
|
|
216
|
-
403: components["responses"]["Forbidden"];
|
|
217
|
-
404: components["responses"]["NotFound"];
|
|
218
|
-
500: components["responses"]["ServerError"];
|
|
219
|
-
};
|
|
220
|
-
}, {
|
|
221
|
-
params: {
|
|
222
|
-
path: {
|
|
223
|
-
id: string;
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
parseAs: "blob";
|
|
227
|
-
}, `${string}/${string}`>>;
|
|
110
|
+
download(id: string): any;
|
|
228
111
|
/**
|
|
229
112
|
* Create a new certificate
|
|
230
113
|
*/
|
|
@@ -249,6 +132,7 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
249
132
|
"application/json": {
|
|
250
133
|
status?: string;
|
|
251
134
|
data?: components["schemas"]["Certificate"];
|
|
135
|
+
message?: string;
|
|
252
136
|
};
|
|
253
137
|
};
|
|
254
138
|
};
|
|
@@ -268,49 +152,7 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
268
152
|
/**
|
|
269
153
|
* Generate a certificate PDF server-side
|
|
270
154
|
*/
|
|
271
|
-
generate(data: GenerateCertificateDto):
|
|
272
|
-
parameters: {
|
|
273
|
-
query?: never;
|
|
274
|
-
header?: never;
|
|
275
|
-
path?: never;
|
|
276
|
-
cookie?: never;
|
|
277
|
-
};
|
|
278
|
-
requestBody: {
|
|
279
|
-
content: {
|
|
280
|
-
"application/json": components["schemas"]["GenerateCertificateDto"];
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
responses: {
|
|
284
|
-
201: {
|
|
285
|
-
headers: {
|
|
286
|
-
[name: string]: unknown;
|
|
287
|
-
};
|
|
288
|
-
content: {
|
|
289
|
-
"application/json": {
|
|
290
|
-
status?: string;
|
|
291
|
-
data?: {
|
|
292
|
-
certificate?: components["schemas"]["Certificate"];
|
|
293
|
-
pdfUrl?: string;
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
};
|
|
298
|
-
400: components["responses"]["BadRequest"];
|
|
299
|
-
401: components["responses"]["Unauthorized"];
|
|
300
|
-
500: components["responses"]["ServerError"];
|
|
301
|
-
};
|
|
302
|
-
}, {
|
|
303
|
-
body: {
|
|
304
|
-
userId: string;
|
|
305
|
-
quizAttemptId?: string;
|
|
306
|
-
certificateTemplateId: string;
|
|
307
|
-
studentName: string;
|
|
308
|
-
quizTitle: string;
|
|
309
|
-
score?: number;
|
|
310
|
-
certificateNumber?: string;
|
|
311
|
-
issuedAt?: string;
|
|
312
|
-
};
|
|
313
|
-
}, `${string}/${string}`>>;
|
|
155
|
+
generate(data: GenerateCertificateDto): any;
|
|
314
156
|
/**
|
|
315
157
|
* Update certificate
|
|
316
158
|
*/
|
|
@@ -337,6 +179,7 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
337
179
|
"application/json": {
|
|
338
180
|
status?: string;
|
|
339
181
|
data?: components["schemas"]["Certificate"];
|
|
182
|
+
message?: string;
|
|
340
183
|
};
|
|
341
184
|
};
|
|
342
185
|
};
|
|
@@ -372,11 +215,16 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
372
215
|
};
|
|
373
216
|
requestBody?: never;
|
|
374
217
|
responses: {
|
|
375
|
-
|
|
218
|
+
200: {
|
|
376
219
|
headers: {
|
|
377
220
|
[name: string]: unknown;
|
|
378
221
|
};
|
|
379
|
-
content
|
|
222
|
+
content: {
|
|
223
|
+
"application/json": {
|
|
224
|
+
status?: string;
|
|
225
|
+
message?: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
380
228
|
};
|
|
381
229
|
400: components["responses"]["BadRequest"];
|
|
382
230
|
401: components["responses"]["Unauthorized"];
|