analytica-frontend-lib 1.2.16 → 1.2.18
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/AlertManager/index.d.mts +6 -2
- package/dist/AlertManager/index.d.ts +6 -2
- package/dist/AlertManager/index.js +125 -119
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +118 -112
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/AlertManagerView/index.d.mts +8 -3
- package/dist/AlertManagerView/index.d.ts +8 -3
- package/dist/AlertManagerView/index.js +17 -27
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +17 -29
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/Table/index.d.mts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +13 -3
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +13 -3
- package/dist/Table/index.mjs.map +1 -1
- package/dist/index.d.mts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.js +358 -359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +128 -130
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DMycdI4U.d.mts → types-BXzeefgf.d.mts} +1 -1
- package/dist/{types-DMycdI4U.d.ts → types-BXzeefgf.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/notification-TD7ZFRLL.png +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1917,6 +1917,7 @@ var MessageStep = ({
|
|
|
1917
1917
|
const handleRemoveFile = () => {
|
|
1918
1918
|
setImage(null);
|
|
1919
1919
|
};
|
|
1920
|
+
const isImageFile = image instanceof File;
|
|
1920
1921
|
return /* @__PURE__ */ jsxs11("section", { className: "flex flex-col gap-4", children: [
|
|
1921
1922
|
/* @__PURE__ */ jsx15(
|
|
1922
1923
|
Input_default,
|
|
@@ -1942,7 +1943,7 @@ var MessageStep = ({
|
|
|
1942
1943
|
allowImageAttachment && /* @__PURE__ */ jsx15(
|
|
1943
1944
|
ImageUpload,
|
|
1944
1945
|
{
|
|
1945
|
-
selectedFile: image,
|
|
1946
|
+
selectedFile: isImageFile ? image : null,
|
|
1946
1947
|
onFileSelect: handleFileSelect,
|
|
1947
1948
|
onRemoveFile: handleRemoveFile
|
|
1948
1949
|
}
|
|
@@ -2145,13 +2146,8 @@ var DateStep = ({
|
|
|
2145
2146
|
|
|
2146
2147
|
// src/components/AlertManager/AlertSteps/PreviewStep.tsx
|
|
2147
2148
|
import { useMemo as useMemo4, useEffect as useEffect4 } from "react";
|
|
2148
|
-
|
|
2149
|
-
// src/assets/img/notification.png
|
|
2150
|
-
var notification_default = "./notification-TD7ZFRLL.png";
|
|
2151
|
-
|
|
2152
|
-
// src/components/AlertManager/AlertSteps/PreviewStep.tsx
|
|
2153
2149
|
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2154
|
-
var PreviewStep = () => {
|
|
2150
|
+
var PreviewStep = ({ imageLink, defaultImage }) => {
|
|
2155
2151
|
const title = useAlertFormStore((state) => state.title);
|
|
2156
2152
|
const message = useAlertFormStore((state) => state.message);
|
|
2157
2153
|
const image = useAlertFormStore((state) => state.image);
|
|
@@ -2162,17 +2158,21 @@ var PreviewStep = () => {
|
|
|
2162
2158
|
if (image instanceof File) {
|
|
2163
2159
|
return globalThis.window.URL.createObjectURL(image);
|
|
2164
2160
|
}
|
|
2161
|
+
if (typeof image === "string") {
|
|
2162
|
+
return image;
|
|
2163
|
+
}
|
|
2165
2164
|
return void 0;
|
|
2166
2165
|
}, [image]);
|
|
2167
2166
|
useEffect4(() => {
|
|
2168
2167
|
return () => {
|
|
2169
|
-
if (
|
|
2168
|
+
if (globalThis.window !== void 0 && imageUrl && image instanceof File) {
|
|
2170
2169
|
URL.revokeObjectURL(imageUrl);
|
|
2171
2170
|
}
|
|
2172
2171
|
};
|
|
2173
|
-
}, [imageUrl]);
|
|
2172
|
+
}, [imageUrl, image]);
|
|
2173
|
+
const finalImageUrl = imageLink || imageUrl || defaultImage || void 0;
|
|
2174
2174
|
return /* @__PURE__ */ jsx18("section", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsxs14("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl", children: [
|
|
2175
|
-
/* @__PURE__ */ jsx18("img", { src:
|
|
2175
|
+
finalImageUrl && /* @__PURE__ */ jsx18("img", { src: finalImageUrl, alt: title || "Imagem do alerta" }),
|
|
2176
2176
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center text-center gap-3", children: [
|
|
2177
2177
|
/* @__PURE__ */ jsx18(Text_default, { size: "lg", weight: "semibold", children: title || "Nenhum T\xEDtulo de Alerta" }),
|
|
2178
2178
|
/* @__PURE__ */ jsx18(Text_default, { size: "sm", weight: "normal", className: "text-text-500", children: message || "Aqui aparecer\xE1 a mensagem do alerta definido pelo usu\xE1rio" })
|
|
@@ -2266,7 +2266,9 @@ var StepWrapper = ({ children }) => /* @__PURE__ */ jsx19("div", { children });
|
|
|
2266
2266
|
var AlertsManager = ({
|
|
2267
2267
|
config,
|
|
2268
2268
|
isOpen = false,
|
|
2269
|
-
onClose
|
|
2269
|
+
onClose,
|
|
2270
|
+
imageLink,
|
|
2271
|
+
defaultImage
|
|
2270
2272
|
}) => {
|
|
2271
2273
|
const [isModalOpen, setIsModalOpen] = useState7(isOpen);
|
|
2272
2274
|
const [currentStep, setCurrentStep] = useState7(0);
|
|
@@ -2425,7 +2427,7 @@ var AlertsManager = ({
|
|
|
2425
2427
|
}
|
|
2426
2428
|
) });
|
|
2427
2429
|
case 3:
|
|
2428
|
-
return /* @__PURE__ */ jsx19(StepWrapper, { children: /* @__PURE__ */ jsx19(PreviewStep, {}) });
|
|
2430
|
+
return /* @__PURE__ */ jsx19(StepWrapper, { children: /* @__PURE__ */ jsx19(PreviewStep, { imageLink, defaultImage }) });
|
|
2429
2431
|
default:
|
|
2430
2432
|
return null;
|
|
2431
2433
|
}
|
|
@@ -2436,7 +2438,9 @@ var AlertsManager = ({
|
|
|
2436
2438
|
labels,
|
|
2437
2439
|
behavior,
|
|
2438
2440
|
handleNext2,
|
|
2439
|
-
handlePrevious
|
|
2441
|
+
handlePrevious,
|
|
2442
|
+
imageLink,
|
|
2443
|
+
defaultImage
|
|
2440
2444
|
]);
|
|
2441
2445
|
const isFirstStep = currentStep === 0;
|
|
2442
2446
|
const isLastStep = currentStep === steps.length - 1;
|
|
@@ -2499,9 +2503,6 @@ var AlertsManager = ({
|
|
|
2499
2503
|
);
|
|
2500
2504
|
};
|
|
2501
2505
|
|
|
2502
|
-
// src/components/AlertManagerView/AlertsManagerView.tsx
|
|
2503
|
-
import { useMemo as useMemo7, useEffect as useEffect8 } from "react";
|
|
2504
|
-
|
|
2505
2506
|
// src/components/Modal/Modal.tsx
|
|
2506
2507
|
import { useEffect as useEffect6, useId as useId5 } from "react";
|
|
2507
2508
|
import { X as X2 } from "phosphor-react";
|
|
@@ -3120,7 +3121,9 @@ var Table = forwardRef8(
|
|
|
3120
3121
|
{
|
|
3121
3122
|
ref,
|
|
3122
3123
|
className: cn(
|
|
3123
|
-
|
|
3124
|
+
variant === "default" && "analytica-table",
|
|
3125
|
+
variant === "default" && "border-separate border-spacing-0",
|
|
3126
|
+
"w-full caption-bottom text-sm",
|
|
3124
3127
|
className
|
|
3125
3128
|
),
|
|
3126
3129
|
...props,
|
|
@@ -3147,11 +3150,15 @@ var TableHeader = forwardRef8(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
3147
3150
|
));
|
|
3148
3151
|
TableHeader.displayName = "TableHeader";
|
|
3149
3152
|
var TableBody = forwardRef8(
|
|
3150
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
3153
|
+
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
3151
3154
|
"tbody",
|
|
3152
3155
|
{
|
|
3153
3156
|
ref,
|
|
3154
|
-
className: cn(
|
|
3157
|
+
className: cn(
|
|
3158
|
+
"[&_tr:last-child]:border-border-200",
|
|
3159
|
+
variant === "default" && "border-t border-border-200",
|
|
3160
|
+
className
|
|
3161
|
+
),
|
|
3155
3162
|
...props
|
|
3156
3163
|
}
|
|
3157
3164
|
)
|
|
@@ -3175,18 +3182,22 @@ TableFooter.displayName = "TableFooter";
|
|
|
3175
3182
|
var VARIANT_STATES_ROW = {
|
|
3176
3183
|
default: {
|
|
3177
3184
|
default: "border border-border-200",
|
|
3185
|
+
defaultBorderless: "border-b border-border-200",
|
|
3178
3186
|
borderless: ""
|
|
3179
3187
|
},
|
|
3180
3188
|
selected: {
|
|
3181
3189
|
default: "border-b-2 border-indicator-primary",
|
|
3190
|
+
defaultBorderless: "border-b border-indicator-primary",
|
|
3182
3191
|
borderless: "bg-indicator-primary/10"
|
|
3183
3192
|
},
|
|
3184
3193
|
invalid: {
|
|
3185
3194
|
default: "border-b-2 border-indicator-error",
|
|
3195
|
+
defaultBorderless: "border-b border-indicator-error",
|
|
3186
3196
|
borderless: "bg-indicator-error/10"
|
|
3187
3197
|
},
|
|
3188
3198
|
disabled: {
|
|
3189
3199
|
default: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed",
|
|
3200
|
+
defaultBorderless: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed",
|
|
3190
3201
|
borderless: "bg-background-50 opacity-50 cursor-not-allowed"
|
|
3191
3202
|
}
|
|
3192
3203
|
};
|
|
@@ -3286,27 +3297,13 @@ var AlertsManagerView = ({
|
|
|
3286
3297
|
alertData,
|
|
3287
3298
|
isOpen = false,
|
|
3288
3299
|
onClose,
|
|
3300
|
+
imageLink,
|
|
3301
|
+
defaultImage,
|
|
3289
3302
|
currentPage = 1,
|
|
3290
3303
|
totalPages: externalTotalPages,
|
|
3291
3304
|
onPageChange,
|
|
3292
3305
|
itemsPerPage = 10
|
|
3293
3306
|
}) => {
|
|
3294
|
-
const imageUrl = useMemo7(() => {
|
|
3295
|
-
if (globalThis.window == void 0) {
|
|
3296
|
-
return void 0;
|
|
3297
|
-
}
|
|
3298
|
-
if (alertData.image instanceof File) {
|
|
3299
|
-
return globalThis.window.URL.createObjectURL(alertData.image);
|
|
3300
|
-
}
|
|
3301
|
-
return void 0;
|
|
3302
|
-
}, [alertData.image]);
|
|
3303
|
-
useEffect8(() => {
|
|
3304
|
-
return () => {
|
|
3305
|
-
if (imageUrl && globalThis.window !== void 0) {
|
|
3306
|
-
URL.revokeObjectURL(imageUrl);
|
|
3307
|
-
}
|
|
3308
|
-
};
|
|
3309
|
-
}, [imageUrl]);
|
|
3310
3307
|
const totalPages = externalTotalPages ?? Math.ceil(alertData.recipients.length / itemsPerPage);
|
|
3311
3308
|
const effectiveCurrentPage = Math.min(totalPages, Math.max(1, currentPage));
|
|
3312
3309
|
const startIndex = (effectiveCurrentPage - 1) * itemsPerPage;
|
|
@@ -3334,10 +3331,10 @@ var AlertsManagerView = ({
|
|
|
3334
3331
|
contentClassName: "p-0",
|
|
3335
3332
|
children: /* @__PURE__ */ jsx25("div", { className: "flex flex-col h-[calc(100vh-8rem)] max-h-[700px]", children: /* @__PURE__ */ jsxs20("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: [
|
|
3336
3333
|
/* @__PURE__ */ jsxs20("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl mb-4", children: [
|
|
3337
|
-
/* @__PURE__ */ jsx25(
|
|
3334
|
+
(imageLink || alertData.image || defaultImage) && /* @__PURE__ */ jsx25(
|
|
3338
3335
|
"img",
|
|
3339
3336
|
{
|
|
3340
|
-
src:
|
|
3337
|
+
src: imageLink || alertData.image || defaultImage || void 0,
|
|
3341
3338
|
alt: alertData.title || "Imagem do alerta"
|
|
3342
3339
|
}
|
|
3343
3340
|
),
|
|
@@ -3430,7 +3427,7 @@ import {
|
|
|
3430
3427
|
forwardRef as forwardRef9,
|
|
3431
3428
|
useState as useState9,
|
|
3432
3429
|
useId as useId6,
|
|
3433
|
-
useEffect as
|
|
3430
|
+
useEffect as useEffect8,
|
|
3434
3431
|
useRef as useRef4,
|
|
3435
3432
|
Children as Children3,
|
|
3436
3433
|
cloneElement as cloneElement3,
|
|
@@ -3740,18 +3737,18 @@ var RadioGroup = forwardRef9(
|
|
|
3740
3737
|
);
|
|
3741
3738
|
const store = storeRef.current;
|
|
3742
3739
|
const { setValue } = useStore2(store, (s) => s);
|
|
3743
|
-
|
|
3740
|
+
useEffect8(() => {
|
|
3744
3741
|
const currentValue = store.getState().value;
|
|
3745
3742
|
if (currentValue && onValueChange) {
|
|
3746
3743
|
onValueChange(currentValue);
|
|
3747
3744
|
}
|
|
3748
3745
|
}, []);
|
|
3749
|
-
|
|
3746
|
+
useEffect8(() => {
|
|
3750
3747
|
if (propValue !== void 0) {
|
|
3751
3748
|
setValue(propValue);
|
|
3752
3749
|
}
|
|
3753
3750
|
}, [propValue, setValue]);
|
|
3754
|
-
|
|
3751
|
+
useEffect8(() => {
|
|
3755
3752
|
store.setState({ disabled });
|
|
3756
3753
|
}, [disabled, store]);
|
|
3757
3754
|
return /* @__PURE__ */ jsx26(
|
|
@@ -3938,8 +3935,8 @@ import {
|
|
|
3938
3935
|
forwardRef as forwardRef11,
|
|
3939
3936
|
useState as useState12,
|
|
3940
3937
|
useId as useId7,
|
|
3941
|
-
useMemo as
|
|
3942
|
-
useEffect as
|
|
3938
|
+
useMemo as useMemo7,
|
|
3939
|
+
useEffect as useEffect12,
|
|
3943
3940
|
useRef as useRef6
|
|
3944
3941
|
} from "react";
|
|
3945
3942
|
|
|
@@ -3947,7 +3944,7 @@ import {
|
|
|
3947
3944
|
import { CaretRight as CaretRight4, SignOut, User as User2 } from "phosphor-react";
|
|
3948
3945
|
import {
|
|
3949
3946
|
forwardRef as forwardRef10,
|
|
3950
|
-
useEffect as
|
|
3947
|
+
useEffect as useEffect11,
|
|
3951
3948
|
useRef as useRef5,
|
|
3952
3949
|
isValidElement as isValidElement4,
|
|
3953
3950
|
Children as Children4,
|
|
@@ -3958,10 +3955,10 @@ import { create as create6, useStore as useStore3 } from "zustand";
|
|
|
3958
3955
|
|
|
3959
3956
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
3960
3957
|
import { Moon, Sun } from "phosphor-react";
|
|
3961
|
-
import { useState as useState10, useEffect as
|
|
3958
|
+
import { useState as useState10, useEffect as useEffect10 } from "react";
|
|
3962
3959
|
|
|
3963
3960
|
// src/hooks/useTheme.ts
|
|
3964
|
-
import { useEffect as
|
|
3961
|
+
import { useEffect as useEffect9 } from "react";
|
|
3965
3962
|
|
|
3966
3963
|
// src/store/themeStore.ts
|
|
3967
3964
|
import { create as create5 } from "zustand";
|
|
@@ -4065,7 +4062,7 @@ var useTheme = () => {
|
|
|
4065
4062
|
initializeTheme,
|
|
4066
4063
|
handleSystemThemeChange
|
|
4067
4064
|
} = useThemeStore();
|
|
4068
|
-
|
|
4065
|
+
useEffect9(() => {
|
|
4069
4066
|
initializeTheme();
|
|
4070
4067
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
4071
4068
|
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
@@ -4089,7 +4086,7 @@ var ThemeToggle = ({
|
|
|
4089
4086
|
}) => {
|
|
4090
4087
|
const { themeMode, setTheme } = useTheme();
|
|
4091
4088
|
const [tempTheme, setTempTheme] = useState10(themeMode);
|
|
4092
|
-
|
|
4089
|
+
useEffect10(() => {
|
|
4093
4090
|
setTempTheme(themeMode);
|
|
4094
4091
|
}, [themeMode]);
|
|
4095
4092
|
const problemTypes = [
|
|
@@ -4240,7 +4237,7 @@ var DropdownMenu = ({
|
|
|
4240
4237
|
setOpen(false);
|
|
4241
4238
|
}
|
|
4242
4239
|
};
|
|
4243
|
-
|
|
4240
|
+
useEffect11(() => {
|
|
4244
4241
|
if (open) {
|
|
4245
4242
|
document.addEventListener("pointerdown", handleClickOutside);
|
|
4246
4243
|
document.addEventListener("keydown", handleDownkey);
|
|
@@ -4250,10 +4247,10 @@ var DropdownMenu = ({
|
|
|
4250
4247
|
document.removeEventListener("keydown", handleDownkey);
|
|
4251
4248
|
};
|
|
4252
4249
|
}, [open]);
|
|
4253
|
-
|
|
4250
|
+
useEffect11(() => {
|
|
4254
4251
|
onOpenChange?.(open);
|
|
4255
4252
|
}, [open, onOpenChange]);
|
|
4256
|
-
|
|
4253
|
+
useEffect11(() => {
|
|
4257
4254
|
if (propOpen !== void 0) {
|
|
4258
4255
|
setOpen(propOpen);
|
|
4259
4256
|
}
|
|
@@ -4339,7 +4336,7 @@ var DropdownMenuContent = forwardRef10(
|
|
|
4339
4336
|
const store = useDropdownStore(externalStore);
|
|
4340
4337
|
const open = useStore3(store, (s) => s.open);
|
|
4341
4338
|
const [isVisible, setIsVisible] = useState11(open);
|
|
4342
|
-
|
|
4339
|
+
useEffect11(() => {
|
|
4343
4340
|
if (open) {
|
|
4344
4341
|
setIsVisible(true);
|
|
4345
4342
|
} else {
|
|
@@ -4686,7 +4683,7 @@ var Search = forwardRef11(
|
|
|
4686
4683
|
const dropdownStore = useRef6(createDropdownStore()).current;
|
|
4687
4684
|
const dropdownRef = useRef6(null);
|
|
4688
4685
|
const inputElRef = useRef6(null);
|
|
4689
|
-
const filteredOptions =
|
|
4686
|
+
const filteredOptions = useMemo7(() => {
|
|
4690
4687
|
if (!options.length) {
|
|
4691
4688
|
return [];
|
|
4692
4689
|
}
|
|
@@ -4699,7 +4696,7 @@ var Search = forwardRef11(
|
|
|
4699
4696
|
dropdownStore.setState({ open });
|
|
4700
4697
|
onDropdownChange?.(open);
|
|
4701
4698
|
};
|
|
4702
|
-
|
|
4699
|
+
useEffect12(() => {
|
|
4703
4700
|
if (justSelectedRef.current) {
|
|
4704
4701
|
justSelectedRef.current = false;
|
|
4705
4702
|
return;
|
|
@@ -4718,7 +4715,7 @@ var Search = forwardRef11(
|
|
|
4718
4715
|
setOpenAndNotify(false);
|
|
4719
4716
|
updateInputValue(option, ref, onChange);
|
|
4720
4717
|
};
|
|
4721
|
-
|
|
4718
|
+
useEffect12(() => {
|
|
4722
4719
|
const handleClickOutside = (event) => {
|
|
4723
4720
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
4724
4721
|
setOpenAndNotify(false);
|
|
@@ -5861,8 +5858,8 @@ var Stepper_default = Stepper;
|
|
|
5861
5858
|
// src/components/Calendar/Calendar.tsx
|
|
5862
5859
|
import {
|
|
5863
5860
|
useState as useState13,
|
|
5864
|
-
useMemo as
|
|
5865
|
-
useEffect as
|
|
5861
|
+
useMemo as useMemo8,
|
|
5862
|
+
useEffect as useEffect13,
|
|
5866
5863
|
useRef as useRef7
|
|
5867
5864
|
} from "react";
|
|
5868
5865
|
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -5968,7 +5965,7 @@ var Calendar = ({
|
|
|
5968
5965
|
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState13(false);
|
|
5969
5966
|
const monthPickerRef = useRef7(null);
|
|
5970
5967
|
const monthPickerContainerRef = useRef7(null);
|
|
5971
|
-
|
|
5968
|
+
useEffect13(() => {
|
|
5972
5969
|
const handleClickOutside = (event) => {
|
|
5973
5970
|
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
5974
5971
|
setIsMonthPickerOpen(false);
|
|
@@ -5982,7 +5979,7 @@ var Calendar = ({
|
|
|
5982
5979
|
};
|
|
5983
5980
|
}, [isMonthPickerOpen]);
|
|
5984
5981
|
const today = /* @__PURE__ */ new Date();
|
|
5985
|
-
const availableYears =
|
|
5982
|
+
const availableYears = useMemo8(() => {
|
|
5986
5983
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
5987
5984
|
const years = [];
|
|
5988
5985
|
for (let year = currentYear - 10; year <= currentYear + 10; year++) {
|
|
@@ -5990,7 +5987,7 @@ var Calendar = ({
|
|
|
5990
5987
|
}
|
|
5991
5988
|
return years;
|
|
5992
5989
|
}, []);
|
|
5993
|
-
const calendarData =
|
|
5990
|
+
const calendarData = useMemo8(() => {
|
|
5994
5991
|
const year = currentDate.getFullYear();
|
|
5995
5992
|
const month = currentDate.getMonth();
|
|
5996
5993
|
const firstDay = new Date(year, month, 1);
|
|
@@ -6363,7 +6360,7 @@ var Calendar_default = Calendar;
|
|
|
6363
6360
|
// src/components/AlertDialog/AlertDialog.tsx
|
|
6364
6361
|
import {
|
|
6365
6362
|
forwardRef as forwardRef12,
|
|
6366
|
-
useEffect as
|
|
6363
|
+
useEffect as useEffect14
|
|
6367
6364
|
} from "react";
|
|
6368
6365
|
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6369
6366
|
var SIZE_CLASSES11 = {
|
|
@@ -6391,7 +6388,7 @@ var AlertDialog = forwardRef12(
|
|
|
6391
6388
|
size = "medium",
|
|
6392
6389
|
...props
|
|
6393
6390
|
}, ref) => {
|
|
6394
|
-
|
|
6391
|
+
useEffect14(() => {
|
|
6395
6392
|
if (!isOpen || !closeOnEscape) return;
|
|
6396
6393
|
const handleEscape = (event) => {
|
|
6397
6394
|
if (event.key === "Escape") {
|
|
@@ -6401,7 +6398,7 @@ var AlertDialog = forwardRef12(
|
|
|
6401
6398
|
document.addEventListener("keydown", handleEscape);
|
|
6402
6399
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
6403
6400
|
}, [isOpen, closeOnEscape]);
|
|
6404
|
-
|
|
6401
|
+
useEffect14(() => {
|
|
6405
6402
|
if (isOpen) {
|
|
6406
6403
|
document.body.style.overflow = "hidden";
|
|
6407
6404
|
} else {
|
|
@@ -6543,7 +6540,7 @@ var loadingModal_default = LoadingModal;
|
|
|
6543
6540
|
|
|
6544
6541
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
6545
6542
|
import { DotsThreeVertical, Bell as Bell2 } from "phosphor-react";
|
|
6546
|
-
import { useState as useState15, useEffect as
|
|
6543
|
+
import { useState as useState15, useEffect as useEffect16 } from "react";
|
|
6547
6544
|
|
|
6548
6545
|
// src/components/Skeleton/Skeleton.tsx
|
|
6549
6546
|
import { forwardRef as forwardRef14 } from "react";
|
|
@@ -6698,7 +6695,7 @@ var SkeletonTable = forwardRef14(
|
|
|
6698
6695
|
);
|
|
6699
6696
|
|
|
6700
6697
|
// src/hooks/useMobile.ts
|
|
6701
|
-
import { useState as useState14, useEffect as
|
|
6698
|
+
import { useState as useState14, useEffect as useEffect15 } from "react";
|
|
6702
6699
|
var MOBILE_WIDTH = 500;
|
|
6703
6700
|
var TABLET_WIDTH = 931;
|
|
6704
6701
|
var SMALL_MOBILE_WIDTH = 425;
|
|
@@ -6723,7 +6720,7 @@ var useMobile = () => {
|
|
|
6723
6720
|
const [isExtraSmallMobile, setIsExtraSmallMobile] = useState14(false);
|
|
6724
6721
|
const [isUltraSmallMobile, setIsUltraSmallMobile] = useState14(false);
|
|
6725
6722
|
const [isTinyMobile, setIsTinyMobile] = useState14(false);
|
|
6726
|
-
|
|
6723
|
+
useEffect15(() => {
|
|
6727
6724
|
const checkScreenSize = () => {
|
|
6728
6725
|
const width = getWindowWidth();
|
|
6729
6726
|
setIsMobile(width < MOBILE_WIDTH);
|
|
@@ -7286,7 +7283,7 @@ var NotificationCenter = ({
|
|
|
7286
7283
|
onToggleActive?.();
|
|
7287
7284
|
}
|
|
7288
7285
|
};
|
|
7289
|
-
|
|
7286
|
+
useEffect16(() => {
|
|
7290
7287
|
if (isActive) {
|
|
7291
7288
|
onFetchNotifications?.();
|
|
7292
7289
|
}
|
|
@@ -8084,7 +8081,7 @@ var FilterModal = ({
|
|
|
8084
8081
|
};
|
|
8085
8082
|
|
|
8086
8083
|
// src/components/Filter/useTableFilter.ts
|
|
8087
|
-
import { useEffect as
|
|
8084
|
+
import { useEffect as useEffect17, useState as useState16, useCallback as useCallback3, useMemo as useMemo9 } from "react";
|
|
8088
8085
|
var useTableFilter = (initialConfigs, options = {}) => {
|
|
8089
8086
|
const { syncWithUrl = false } = options;
|
|
8090
8087
|
const getInitialState = useCallback3(() => {
|
|
@@ -8106,7 +8103,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8106
8103
|
return configsWithUrlState;
|
|
8107
8104
|
}, [initialConfigs, syncWithUrl]);
|
|
8108
8105
|
const [filterConfigs, setFilterConfigs] = useState16(getInitialState);
|
|
8109
|
-
const activeFilters =
|
|
8106
|
+
const activeFilters = useMemo9(() => {
|
|
8110
8107
|
const filters = {};
|
|
8111
8108
|
for (const config of filterConfigs) {
|
|
8112
8109
|
for (const category of config.categories) {
|
|
@@ -8159,7 +8156,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8159
8156
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
8160
8157
|
}
|
|
8161
8158
|
}, [filterConfigs, syncWithUrl]);
|
|
8162
|
-
|
|
8159
|
+
useEffect17(() => {
|
|
8163
8160
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
8164
8161
|
return;
|
|
8165
8162
|
}
|
|
@@ -8182,7 +8179,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8182
8179
|
// src/components/Select/Select.tsx
|
|
8183
8180
|
import { create as create8, useStore as useStore4 } from "zustand";
|
|
8184
8181
|
import {
|
|
8185
|
-
useEffect as
|
|
8182
|
+
useEffect as useEffect18,
|
|
8186
8183
|
useRef as useRef8,
|
|
8187
8184
|
forwardRef as forwardRef15,
|
|
8188
8185
|
isValidElement as isValidElement5,
|
|
@@ -8313,13 +8310,13 @@ var Select = ({
|
|
|
8313
8310
|
search(children2);
|
|
8314
8311
|
return found;
|
|
8315
8312
|
};
|
|
8316
|
-
|
|
8313
|
+
useEffect18(() => {
|
|
8317
8314
|
if (!selectedLabel && defaultValue) {
|
|
8318
8315
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8319
8316
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8320
8317
|
}
|
|
8321
8318
|
}, [children, defaultValue, selectedLabel]);
|
|
8322
|
-
|
|
8319
|
+
useEffect18(() => {
|
|
8323
8320
|
const handleClickOutside = (event) => {
|
|
8324
8321
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8325
8322
|
setOpen(false);
|
|
@@ -8354,7 +8351,7 @@ var Select = ({
|
|
|
8354
8351
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8355
8352
|
};
|
|
8356
8353
|
}, [open]);
|
|
8357
|
-
|
|
8354
|
+
useEffect18(() => {
|
|
8358
8355
|
if (propValue) {
|
|
8359
8356
|
setValue(propValue);
|
|
8360
8357
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8535,7 +8532,7 @@ var Select_default = Select;
|
|
|
8535
8532
|
// src/components/Menu/Menu.tsx
|
|
8536
8533
|
import { create as create9, useStore as useStore5 } from "zustand";
|
|
8537
8534
|
import {
|
|
8538
|
-
useEffect as
|
|
8535
|
+
useEffect as useEffect19,
|
|
8539
8536
|
useRef as useRef9,
|
|
8540
8537
|
forwardRef as forwardRef16,
|
|
8541
8538
|
isValidElement as isValidElement6,
|
|
@@ -8577,7 +8574,7 @@ var Menu = forwardRef16(
|
|
|
8577
8574
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8578
8575
|
const store = storeRef.current;
|
|
8579
8576
|
const { setValue } = useStore5(store, (s) => s);
|
|
8580
|
-
|
|
8577
|
+
useEffect19(() => {
|
|
8581
8578
|
setValue(propValue ?? defaultValue);
|
|
8582
8579
|
}, [defaultValue, propValue, setValue]);
|
|
8583
8580
|
const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
|
|
@@ -8781,7 +8778,7 @@ var MenuOverflow = ({
|
|
|
8781
8778
|
const containerRef = useRef9(null);
|
|
8782
8779
|
const [showLeftArrow, setShowLeftArrow] = useState17(false);
|
|
8783
8780
|
const [showRightArrow, setShowRightArrow] = useState17(false);
|
|
8784
|
-
|
|
8781
|
+
useEffect19(() => {
|
|
8785
8782
|
const checkScroll = () => internalCheckScroll(
|
|
8786
8783
|
containerRef.current,
|
|
8787
8784
|
setShowLeftArrow,
|
|
@@ -8858,7 +8855,7 @@ import {
|
|
|
8858
8855
|
Fragment as Fragment8,
|
|
8859
8856
|
useState as useState18,
|
|
8860
8857
|
useRef as useRef10,
|
|
8861
|
-
useEffect as
|
|
8858
|
+
useEffect as useEffect20
|
|
8862
8859
|
} from "react";
|
|
8863
8860
|
import {
|
|
8864
8861
|
CaretRight as CaretRight6,
|
|
@@ -9710,7 +9707,7 @@ var CardAudio = forwardRef17(
|
|
|
9710
9707
|
}
|
|
9711
9708
|
return /* @__PURE__ */ jsx52(SpeakerHigh, { size: 24 });
|
|
9712
9709
|
};
|
|
9713
|
-
|
|
9710
|
+
useEffect20(() => {
|
|
9714
9711
|
const handleClickOutside = (event) => {
|
|
9715
9712
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9716
9713
|
setShowVolumeControl(false);
|
|
@@ -10437,7 +10434,7 @@ var NotFound_default = NotFound;
|
|
|
10437
10434
|
import {
|
|
10438
10435
|
useRef as useRef11,
|
|
10439
10436
|
useState as useState20,
|
|
10440
|
-
useEffect as
|
|
10437
|
+
useEffect as useEffect21,
|
|
10441
10438
|
useCallback as useCallback5
|
|
10442
10439
|
} from "react";
|
|
10443
10440
|
import { createPortal } from "react-dom";
|
|
@@ -10725,7 +10722,7 @@ var SpeedMenu = ({
|
|
|
10725
10722
|
};
|
|
10726
10723
|
};
|
|
10727
10724
|
const position = getMenuPosition();
|
|
10728
|
-
|
|
10725
|
+
useEffect21(() => {
|
|
10729
10726
|
const handleClickOutside = (event) => {
|
|
10730
10727
|
const target = event.target;
|
|
10731
10728
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10816,7 +10813,7 @@ var VideoPlayer = ({
|
|
|
10816
10813
|
const [hasCompleted, setHasCompleted] = useState20(false);
|
|
10817
10814
|
const [showCaptions, setShowCaptions] = useState20(false);
|
|
10818
10815
|
const [subtitlesValidation, setSubtitlesValidation] = useState20("idle");
|
|
10819
|
-
|
|
10816
|
+
useEffect21(() => {
|
|
10820
10817
|
setHasCompleted(false);
|
|
10821
10818
|
}, [src]);
|
|
10822
10819
|
const [playbackRate, setPlaybackRate] = useState20(1);
|
|
@@ -10888,13 +10885,13 @@ var VideoPlayer = ({
|
|
|
10888
10885
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10889
10886
|
}
|
|
10890
10887
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10891
|
-
|
|
10888
|
+
useEffect21(() => {
|
|
10892
10889
|
if (videoRef.current) {
|
|
10893
10890
|
videoRef.current.volume = volume;
|
|
10894
10891
|
videoRef.current.muted = isMuted;
|
|
10895
10892
|
}
|
|
10896
10893
|
}, [volume, isMuted]);
|
|
10897
|
-
|
|
10894
|
+
useEffect21(() => {
|
|
10898
10895
|
const video = videoRef.current;
|
|
10899
10896
|
if (!video) return;
|
|
10900
10897
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10909,13 +10906,13 @@ var VideoPlayer = ({
|
|
|
10909
10906
|
video.removeEventListener("ended", onEnded);
|
|
10910
10907
|
};
|
|
10911
10908
|
}, []);
|
|
10912
|
-
|
|
10909
|
+
useEffect21(() => {
|
|
10913
10910
|
const video = videoRef.current;
|
|
10914
10911
|
if (!video) return;
|
|
10915
10912
|
video.setAttribute("playsinline", "");
|
|
10916
10913
|
video.setAttribute("webkit-playsinline", "");
|
|
10917
10914
|
}, []);
|
|
10918
|
-
|
|
10915
|
+
useEffect21(() => {
|
|
10919
10916
|
if (isPlaying) {
|
|
10920
10917
|
showControlsWithTimer();
|
|
10921
10918
|
} else {
|
|
@@ -10927,7 +10924,7 @@ var VideoPlayer = ({
|
|
|
10927
10924
|
}
|
|
10928
10925
|
}
|
|
10929
10926
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
10930
|
-
|
|
10927
|
+
useEffect21(() => {
|
|
10931
10928
|
const video = videoRef.current;
|
|
10932
10929
|
if (!video) return;
|
|
10933
10930
|
const handleFullscreenChange = () => {
|
|
@@ -10962,7 +10959,7 @@ var VideoPlayer = ({
|
|
|
10962
10959
|
);
|
|
10963
10960
|
};
|
|
10964
10961
|
}, [showControlsWithTimer]);
|
|
10965
|
-
|
|
10962
|
+
useEffect21(() => {
|
|
10966
10963
|
const init = () => {
|
|
10967
10964
|
if (!isFullscreen) {
|
|
10968
10965
|
showControlsWithTimer();
|
|
@@ -10997,7 +10994,7 @@ var VideoPlayer = ({
|
|
|
10997
10994
|
if (hasValidSaved) return saved;
|
|
10998
10995
|
return void 0;
|
|
10999
10996
|
}, [autoSave, storageKey, src, initialTime]);
|
|
11000
|
-
|
|
10997
|
+
useEffect21(() => {
|
|
11001
10998
|
const start = getInitialTime();
|
|
11002
10999
|
if (start !== void 0 && videoRef.current) {
|
|
11003
11000
|
videoRef.current.currentTime = start;
|
|
@@ -11134,7 +11131,7 @@ var VideoPlayer = ({
|
|
|
11134
11131
|
setDuration(videoRef.current.duration);
|
|
11135
11132
|
}
|
|
11136
11133
|
}, []);
|
|
11137
|
-
|
|
11134
|
+
useEffect21(() => {
|
|
11138
11135
|
const controller = new AbortController();
|
|
11139
11136
|
const validateSubtitles = async () => {
|
|
11140
11137
|
if (!subtitles) {
|
|
@@ -11181,12 +11178,12 @@ var VideoPlayer = ({
|
|
|
11181
11178
|
controller.abort();
|
|
11182
11179
|
};
|
|
11183
11180
|
}, [subtitles]);
|
|
11184
|
-
|
|
11181
|
+
useEffect21(() => {
|
|
11185
11182
|
if (trackRef.current?.track) {
|
|
11186
11183
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11187
11184
|
}
|
|
11188
11185
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11189
|
-
|
|
11186
|
+
useEffect21(() => {
|
|
11190
11187
|
const handleVisibilityChange = () => {
|
|
11191
11188
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11192
11189
|
videoRef.current.pause();
|
|
@@ -11619,10 +11616,10 @@ var Whiteboard_default = Whiteboard;
|
|
|
11619
11616
|
import {
|
|
11620
11617
|
createContext,
|
|
11621
11618
|
useContext,
|
|
11622
|
-
useEffect as
|
|
11619
|
+
useEffect as useEffect22,
|
|
11623
11620
|
useState as useState22,
|
|
11624
11621
|
useCallback as useCallback7,
|
|
11625
|
-
useMemo as
|
|
11622
|
+
useMemo as useMemo10
|
|
11626
11623
|
} from "react";
|
|
11627
11624
|
import { useLocation, Navigate } from "react-router-dom";
|
|
11628
11625
|
import { Fragment as Fragment11, jsx as jsx58 } from "react/jsx-runtime";
|
|
@@ -11684,10 +11681,10 @@ var AuthProvider = ({
|
|
|
11684
11681
|
tokens: void 0
|
|
11685
11682
|
}));
|
|
11686
11683
|
}, [signOutFn]);
|
|
11687
|
-
|
|
11684
|
+
useEffect22(() => {
|
|
11688
11685
|
checkAuth();
|
|
11689
11686
|
}, [checkAuth]);
|
|
11690
|
-
const contextValue =
|
|
11687
|
+
const contextValue = useMemo10(
|
|
11691
11688
|
() => ({
|
|
11692
11689
|
...authState,
|
|
11693
11690
|
checkAuth,
|
|
@@ -11800,7 +11797,7 @@ import {
|
|
|
11800
11797
|
forwardRef as forwardRef18,
|
|
11801
11798
|
useId as useId9,
|
|
11802
11799
|
useState as useState23,
|
|
11803
|
-
useEffect as
|
|
11800
|
+
useEffect as useEffect23
|
|
11804
11801
|
} from "react";
|
|
11805
11802
|
import { CaretRight as CaretRight7 } from "phosphor-react";
|
|
11806
11803
|
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -11822,7 +11819,7 @@ var CardAccordation = forwardRef18(
|
|
|
11822
11819
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11823
11820
|
const isControlled = controlledExpanded !== void 0;
|
|
11824
11821
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11825
|
-
|
|
11822
|
+
useEffect23(() => {
|
|
11826
11823
|
if (isControlled) {
|
|
11827
11824
|
setInternalExpanded(controlledExpanded);
|
|
11828
11825
|
}
|
|
@@ -11913,7 +11910,7 @@ import {
|
|
|
11913
11910
|
cloneElement as cloneElement8,
|
|
11914
11911
|
forwardRef as forwardRef19,
|
|
11915
11912
|
isValidElement as isValidElement7,
|
|
11916
|
-
useEffect as
|
|
11913
|
+
useEffect as useEffect24,
|
|
11917
11914
|
useRef as useRef12,
|
|
11918
11915
|
useState as useState24
|
|
11919
11916
|
} from "react";
|
|
@@ -12009,10 +12006,10 @@ var AccordionGroup = forwardRef19(
|
|
|
12009
12006
|
);
|
|
12010
12007
|
}
|
|
12011
12008
|
const store = storeRef.current;
|
|
12012
|
-
|
|
12009
|
+
useEffect24(() => {
|
|
12013
12010
|
store.setState({ value: currentValue });
|
|
12014
12011
|
}, [currentValue, store]);
|
|
12015
|
-
|
|
12012
|
+
useEffect24(() => {
|
|
12016
12013
|
if (!isControlled) {
|
|
12017
12014
|
setInternalValue((prev) => {
|
|
12018
12015
|
if (type === "single") {
|
|
@@ -12366,7 +12363,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12366
12363
|
}
|
|
12367
12364
|
|
|
12368
12365
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12369
|
-
import { useEffect as
|
|
12366
|
+
import { useEffect as useEffect25, useRef as useRef13 } from "react";
|
|
12370
12367
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
12371
12368
|
var getAuthParams = (location, extractParams) => {
|
|
12372
12369
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12415,7 +12412,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12415
12412
|
function useUrlAuthentication(options) {
|
|
12416
12413
|
const location = useLocation2();
|
|
12417
12414
|
const processedRef = useRef13(false);
|
|
12418
|
-
|
|
12415
|
+
useEffect25(() => {
|
|
12419
12416
|
const handleAuthentication = async () => {
|
|
12420
12417
|
if (processedRef.current) {
|
|
12421
12418
|
return;
|
|
@@ -12486,9 +12483,9 @@ function useUrlAuthentication(options) {
|
|
|
12486
12483
|
}
|
|
12487
12484
|
|
|
12488
12485
|
// src/components/Auth/useApiConfig.ts
|
|
12489
|
-
import { useMemo as
|
|
12486
|
+
import { useMemo as useMemo11 } from "react";
|
|
12490
12487
|
function useApiConfig(api) {
|
|
12491
|
-
return
|
|
12488
|
+
return useMemo11(
|
|
12492
12489
|
() => ({
|
|
12493
12490
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12494
12491
|
}),
|
|
@@ -12506,7 +12503,7 @@ import {
|
|
|
12506
12503
|
} from "phosphor-react";
|
|
12507
12504
|
import {
|
|
12508
12505
|
forwardRef as forwardRef22,
|
|
12509
|
-
useEffect as
|
|
12506
|
+
useEffect as useEffect28,
|
|
12510
12507
|
useState as useState28
|
|
12511
12508
|
} from "react";
|
|
12512
12509
|
|
|
@@ -13121,15 +13118,15 @@ var useQuizStore = create11()(
|
|
|
13121
13118
|
import {
|
|
13122
13119
|
forwardRef as forwardRef21,
|
|
13123
13120
|
useCallback as useCallback8,
|
|
13124
|
-
useEffect as
|
|
13121
|
+
useEffect as useEffect27,
|
|
13125
13122
|
useId as useId11,
|
|
13126
|
-
useMemo as
|
|
13123
|
+
useMemo as useMemo12,
|
|
13127
13124
|
useRef as useRef14,
|
|
13128
13125
|
useState as useState27
|
|
13129
13126
|
} from "react";
|
|
13130
13127
|
|
|
13131
13128
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13132
|
-
import { useEffect as
|
|
13129
|
+
import { useEffect as useEffect26, useState as useState26 } from "react";
|
|
13133
13130
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
13134
13131
|
import { jsx as jsx62, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13135
13132
|
var MultipleChoiceList = ({
|
|
@@ -13142,7 +13139,7 @@ var MultipleChoiceList = ({
|
|
|
13142
13139
|
mode = "interactive"
|
|
13143
13140
|
}) => {
|
|
13144
13141
|
const [actualValue, setActualValue] = useState26(selectedValues);
|
|
13145
|
-
|
|
13142
|
+
useEffect26(() => {
|
|
13146
13143
|
setActualValue(selectedValues);
|
|
13147
13144
|
}, [selectedValues]);
|
|
13148
13145
|
const getStatusBadge2 = (status) => {
|
|
@@ -13383,13 +13380,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13383
13380
|
);
|
|
13384
13381
|
const prevSelectedValuesRef = useRef14([]);
|
|
13385
13382
|
const prevQuestionIdRef = useRef14("");
|
|
13386
|
-
const allCurrentAnswerIds =
|
|
13383
|
+
const allCurrentAnswerIds = useMemo12(() => {
|
|
13387
13384
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13388
13385
|
}, [allCurrentAnswers]);
|
|
13389
|
-
const selectedValues =
|
|
13386
|
+
const selectedValues = useMemo12(() => {
|
|
13390
13387
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13391
13388
|
}, [allCurrentAnswerIds]);
|
|
13392
|
-
const stableSelectedValues =
|
|
13389
|
+
const stableSelectedValues = useMemo12(() => {
|
|
13393
13390
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13394
13391
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13395
13392
|
if (hasQuestionChanged) {
|
|
@@ -13421,7 +13418,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13421
13418
|
},
|
|
13422
13419
|
[currentQuestion, selectMultipleAnswer]
|
|
13423
13420
|
);
|
|
13424
|
-
const questionKey =
|
|
13421
|
+
const questionKey = useMemo12(
|
|
13425
13422
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13426
13423
|
[currentQuestion?.id]
|
|
13427
13424
|
);
|
|
@@ -13499,7 +13496,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13499
13496
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13500
13497
|
}
|
|
13501
13498
|
}, []);
|
|
13502
|
-
|
|
13499
|
+
useEffect27(() => {
|
|
13503
13500
|
adjustTextareaHeight();
|
|
13504
13501
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13505
13502
|
if (!currentQuestion) {
|
|
@@ -14067,7 +14064,7 @@ var getFinishConfirmationText = (type) => {
|
|
|
14067
14064
|
};
|
|
14068
14065
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
14069
14066
|
const { setVariant } = useQuizStore();
|
|
14070
|
-
|
|
14067
|
+
useEffect28(() => {
|
|
14071
14068
|
setVariant(variant);
|
|
14072
14069
|
}, [variant, setVariant]);
|
|
14073
14070
|
return /* @__PURE__ */ jsx64("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
@@ -14628,7 +14625,7 @@ var QuizFooter = forwardRef22(
|
|
|
14628
14625
|
);
|
|
14629
14626
|
|
|
14630
14627
|
// src/components/Quiz/QuizResult.tsx
|
|
14631
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
14628
|
+
import { forwardRef as forwardRef23, useEffect as useEffect29, useState as useState29 } from "react";
|
|
14632
14629
|
import { Clock as Clock3 } from "phosphor-react";
|
|
14633
14630
|
import { jsx as jsx65, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
14634
14631
|
var QuizBadge = ({
|
|
@@ -14658,7 +14655,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14658
14655
|
questionsResult
|
|
14659
14656
|
} = useQuizStore();
|
|
14660
14657
|
const [status, setStatus] = useState29(void 0);
|
|
14661
|
-
|
|
14658
|
+
useEffect29(() => {
|
|
14662
14659
|
const cq = getCurrentQuestion();
|
|
14663
14660
|
if (!cq) {
|
|
14664
14661
|
setStatus(void 0);
|
|
@@ -15031,7 +15028,7 @@ var BreadcrumbMenu = ({
|
|
|
15031
15028
|
};
|
|
15032
15029
|
|
|
15033
15030
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15034
|
-
import { useEffect as
|
|
15031
|
+
import { useEffect as useEffect30 } from "react";
|
|
15035
15032
|
|
|
15036
15033
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15037
15034
|
import { create as create12 } from "zustand";
|
|
@@ -15160,7 +15157,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15160
15157
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15161
15158
|
);
|
|
15162
15159
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15163
|
-
|
|
15160
|
+
useEffect30(() => {
|
|
15164
15161
|
const newBreadcrumbs = [root];
|
|
15165
15162
|
const previousIds = [];
|
|
15166
15163
|
for (const level of levels) {
|
|
@@ -15192,11 +15189,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15192
15189
|
};
|
|
15193
15190
|
|
|
15194
15191
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15195
|
-
import { useMemo as
|
|
15192
|
+
import { useMemo as useMemo13 } from "react";
|
|
15196
15193
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
15197
15194
|
var useUrlParams = (config) => {
|
|
15198
15195
|
const location = useLocation3();
|
|
15199
|
-
return
|
|
15196
|
+
return useMemo13(() => {
|
|
15200
15197
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15201
15198
|
const params = {};
|
|
15202
15199
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15207,15 +15204,15 @@ var useUrlParams = (config) => {
|
|
|
15207
15204
|
};
|
|
15208
15205
|
|
|
15209
15206
|
// src/hooks/useAppInitialization.ts
|
|
15210
|
-
import { useMemo as
|
|
15207
|
+
import { useMemo as useMemo14 } from "react";
|
|
15211
15208
|
|
|
15212
15209
|
// src/hooks/useInstitution.ts
|
|
15213
|
-
import { useEffect as
|
|
15210
|
+
import { useEffect as useEffect31, useState as useState30 } from "react";
|
|
15214
15211
|
function useInstitutionId() {
|
|
15215
15212
|
const [institutionId, setInstitutionId] = useState30(() => {
|
|
15216
15213
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15217
15214
|
});
|
|
15218
|
-
|
|
15215
|
+
useEffect31(() => {
|
|
15219
15216
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15220
15217
|
if (!metaTag) return;
|
|
15221
15218
|
const observer = new MutationObserver(() => {
|
|
@@ -15382,7 +15379,7 @@ var useAuthStore = create14()(
|
|
|
15382
15379
|
function useAppInitialization() {
|
|
15383
15380
|
const getInstitutionId = useInstitutionId();
|
|
15384
15381
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15385
|
-
const authFunctions =
|
|
15382
|
+
const authFunctions = useMemo14(
|
|
15386
15383
|
() => ({
|
|
15387
15384
|
checkAuth: async () => {
|
|
15388
15385
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15419,7 +15416,7 @@ function useAppInitialization() {
|
|
|
15419
15416
|
}
|
|
15420
15417
|
|
|
15421
15418
|
// src/hooks/useAppContent.ts
|
|
15422
|
-
import { useCallback as useCallback9, useEffect as
|
|
15419
|
+
import { useCallback as useCallback9, useEffect as useEffect32, useMemo as useMemo15 } from "react";
|
|
15423
15420
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
15424
15421
|
function useAppContent(config) {
|
|
15425
15422
|
const navigate = useNavigate2();
|
|
@@ -15469,7 +15466,7 @@ function useAppContent(config) {
|
|
|
15469
15466
|
},
|
|
15470
15467
|
[navigate, onError]
|
|
15471
15468
|
);
|
|
15472
|
-
const urlAuthConfig =
|
|
15469
|
+
const urlAuthConfig = useMemo15(
|
|
15473
15470
|
() => ({
|
|
15474
15471
|
setTokens,
|
|
15475
15472
|
setSessionInfo,
|
|
@@ -15495,10 +15492,10 @@ function useAppContent(config) {
|
|
|
15495
15492
|
);
|
|
15496
15493
|
useUrlAuthentication(urlAuthConfig);
|
|
15497
15494
|
const { sessionInfo } = useAuth();
|
|
15498
|
-
const institutionIdToUse =
|
|
15495
|
+
const institutionIdToUse = useMemo15(() => {
|
|
15499
15496
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15500
15497
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15501
|
-
|
|
15498
|
+
useEffect32(() => {
|
|
15502
15499
|
if (institutionIdToUse && !initialized) {
|
|
15503
15500
|
initialize(institutionIdToUse);
|
|
15504
15501
|
}
|
|
@@ -15651,6 +15648,7 @@ export {
|
|
|
15651
15648
|
getSubjectInfo,
|
|
15652
15649
|
getSubjectName,
|
|
15653
15650
|
syncDropdownState,
|
|
15651
|
+
useAlertFormStore,
|
|
15654
15652
|
useApiConfig,
|
|
15655
15653
|
useAppContent,
|
|
15656
15654
|
useAppInitialization,
|