analytica-frontend-lib 1.1.67 → 1.1.69
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/DropdownMenu/index.js +110 -75
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +114 -79
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/Menu/index.js.map +1 -1
- package/dist/Menu/index.mjs +1 -1
- package/dist/Menu/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +112 -77
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +123 -88
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Search/index.js +110 -75
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +119 -84
- package/dist/Search/index.mjs.map +1 -1
- package/dist/ThemeToggle/index.d.mts +3 -1
- package/dist/ThemeToggle/index.d.ts +3 -1
- package/dist/ThemeToggle/index.js +102 -67
- package/dist/ThemeToggle/index.js.map +1 -1
- package/dist/ThemeToggle/index.mjs +105 -70
- package/dist/ThemeToggle/index.mjs.map +1 -1
- package/dist/hooks/useTheme/index.d.mts +6 -2
- package/dist/hooks/useTheme/index.d.ts +6 -2
- package/dist/hooks/useTheme/index.js +102 -67
- package/dist/hooks/useTheme/index.js.map +1 -1
- package/dist/hooks/useTheme/index.mjs +103 -68
- package/dist/hooks/useTheme/index.mjs.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +133 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -216
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/styles.css.map +1 -1
- package/dist/themeStore-P2X64zC-.d.mts +79 -0
- package/dist/themeStore-P2X64zC-.d.ts +79 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1789,11 +1789,11 @@ var Input_default = Input;
|
|
|
1789
1789
|
import { CaretLeft, X as X3 } from "phosphor-react";
|
|
1790
1790
|
import {
|
|
1791
1791
|
forwardRef as forwardRef11,
|
|
1792
|
-
useState as
|
|
1792
|
+
useState as useState7,
|
|
1793
1793
|
useId as useId7,
|
|
1794
1794
|
useMemo as useMemo2,
|
|
1795
1795
|
useEffect as useEffect7,
|
|
1796
|
-
useRef as
|
|
1796
|
+
useRef as useRef4
|
|
1797
1797
|
} from "react";
|
|
1798
1798
|
|
|
1799
1799
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
@@ -1801,13 +1801,13 @@ import { CaretRight, SignOut, User } from "phosphor-react";
|
|
|
1801
1801
|
import {
|
|
1802
1802
|
forwardRef as forwardRef10,
|
|
1803
1803
|
useEffect as useEffect6,
|
|
1804
|
-
useRef as
|
|
1804
|
+
useRef as useRef3,
|
|
1805
1805
|
isValidElement as isValidElement3,
|
|
1806
1806
|
Children as Children3,
|
|
1807
1807
|
cloneElement as cloneElement3,
|
|
1808
|
-
useState as
|
|
1808
|
+
useState as useState6
|
|
1809
1809
|
} from "react";
|
|
1810
|
-
import { create as
|
|
1810
|
+
import { create as create5, useStore as useStore3 } from "zustand";
|
|
1811
1811
|
|
|
1812
1812
|
// src/components/Modal/Modal.tsx
|
|
1813
1813
|
import { useEffect as useEffect3, useId as useId6 } from "react";
|
|
@@ -2034,86 +2034,121 @@ var Modal_default = Modal;
|
|
|
2034
2034
|
|
|
2035
2035
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
2036
2036
|
import { Moon, Sun } from "phosphor-react";
|
|
2037
|
-
import { useState as
|
|
2037
|
+
import { useState as useState5, useEffect as useEffect5 } from "react";
|
|
2038
2038
|
|
|
2039
2039
|
// src/hooks/useTheme.ts
|
|
2040
|
-
import { useEffect as useEffect4
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2040
|
+
import { useEffect as useEffect4 } from "react";
|
|
2041
|
+
|
|
2042
|
+
// src/store/themeStore.ts
|
|
2043
|
+
import { create as create4 } from "zustand";
|
|
2044
|
+
import { devtools, persist } from "zustand/middleware";
|
|
2045
|
+
var applyThemeToDOM = (mode) => {
|
|
2046
|
+
const htmlElement = document.documentElement;
|
|
2047
|
+
const originalTheme = htmlElement.getAttribute("data-original-theme");
|
|
2048
|
+
if (mode === "dark") {
|
|
2049
|
+
htmlElement.setAttribute("data-theme", "dark");
|
|
2050
|
+
return true;
|
|
2051
|
+
} else if (mode === "light") {
|
|
2052
|
+
if (originalTheme) {
|
|
2053
|
+
htmlElement.setAttribute("data-theme", originalTheme);
|
|
2054
|
+
}
|
|
2055
|
+
return false;
|
|
2056
|
+
} else if (mode === "system") {
|
|
2057
|
+
const isSystemDark = window.matchMedia(
|
|
2058
|
+
"(prefers-color-scheme: dark)"
|
|
2059
|
+
).matches;
|
|
2060
|
+
if (isSystemDark) {
|
|
2049
2061
|
htmlElement.setAttribute("data-theme", "dark");
|
|
2050
|
-
|
|
2051
|
-
} else if (
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2062
|
+
return true;
|
|
2063
|
+
} else if (originalTheme) {
|
|
2064
|
+
htmlElement.setAttribute("data-theme", originalTheme);
|
|
2065
|
+
return false;
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return false;
|
|
2069
|
+
};
|
|
2070
|
+
var saveOriginalTheme = () => {
|
|
2071
|
+
const htmlElement = document.documentElement;
|
|
2072
|
+
const currentTheme = htmlElement.getAttribute("data-theme");
|
|
2073
|
+
if (currentTheme && !htmlElement.getAttribute("data-original-theme")) {
|
|
2074
|
+
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
2075
|
+
}
|
|
2076
|
+
};
|
|
2077
|
+
var useThemeStore = create4()(
|
|
2078
|
+
devtools(
|
|
2079
|
+
persist(
|
|
2080
|
+
(set, get) => ({
|
|
2081
|
+
// Initial state
|
|
2082
|
+
themeMode: "system",
|
|
2083
|
+
isDark: false,
|
|
2084
|
+
// Actions
|
|
2085
|
+
applyTheme: (mode) => {
|
|
2086
|
+
const isDark = applyThemeToDOM(mode);
|
|
2087
|
+
set({ isDark });
|
|
2088
|
+
},
|
|
2089
|
+
toggleTheme: () => {
|
|
2090
|
+
const { themeMode, applyTheme } = get();
|
|
2091
|
+
let newMode;
|
|
2092
|
+
if (themeMode === "light") {
|
|
2093
|
+
newMode = "dark";
|
|
2094
|
+
} else if (themeMode === "dark") {
|
|
2095
|
+
newMode = "light";
|
|
2096
|
+
} else {
|
|
2097
|
+
newMode = "dark";
|
|
2098
|
+
}
|
|
2099
|
+
set({ themeMode: newMode });
|
|
2100
|
+
applyTheme(newMode);
|
|
2101
|
+
},
|
|
2102
|
+
setTheme: (mode) => {
|
|
2103
|
+
const { applyTheme } = get();
|
|
2104
|
+
set({ themeMode: mode });
|
|
2105
|
+
applyTheme(mode);
|
|
2106
|
+
},
|
|
2107
|
+
initializeTheme: () => {
|
|
2108
|
+
const { themeMode, applyTheme } = get();
|
|
2109
|
+
saveOriginalTheme();
|
|
2110
|
+
applyTheme(themeMode);
|
|
2111
|
+
},
|
|
2112
|
+
handleSystemThemeChange: () => {
|
|
2113
|
+
const { themeMode, applyTheme } = get();
|
|
2114
|
+
if (themeMode === "system") {
|
|
2115
|
+
applyTheme("system");
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
}),
|
|
2119
|
+
{
|
|
2120
|
+
name: "theme-store",
|
|
2121
|
+
// Nome da chave no localStorage
|
|
2122
|
+
partialize: (state) => ({
|
|
2123
|
+
themeMode: state.themeMode
|
|
2124
|
+
})
|
|
2125
|
+
// Só persiste o themeMode, não o isDark
|
|
2066
2126
|
}
|
|
2127
|
+
),
|
|
2128
|
+
{
|
|
2129
|
+
name: "theme-store"
|
|
2067
2130
|
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
localStorage.setItem("theme-mode", newMode);
|
|
2082
|
-
}, [themeMode, applyTheme]);
|
|
2083
|
-
const setTheme = useCallback(
|
|
2084
|
-
(mode) => {
|
|
2085
|
-
setThemeMode(mode);
|
|
2086
|
-
themeModeRef.current = mode;
|
|
2087
|
-
applyTheme(mode);
|
|
2088
|
-
localStorage.setItem("theme-mode", mode);
|
|
2089
|
-
},
|
|
2090
|
-
[applyTheme]
|
|
2091
|
-
);
|
|
2131
|
+
)
|
|
2132
|
+
);
|
|
2133
|
+
|
|
2134
|
+
// src/hooks/useTheme.ts
|
|
2135
|
+
var useTheme = () => {
|
|
2136
|
+
const {
|
|
2137
|
+
themeMode,
|
|
2138
|
+
isDark,
|
|
2139
|
+
toggleTheme,
|
|
2140
|
+
setTheme,
|
|
2141
|
+
initializeTheme,
|
|
2142
|
+
handleSystemThemeChange
|
|
2143
|
+
} = useThemeStore();
|
|
2092
2144
|
useEffect4(() => {
|
|
2093
|
-
|
|
2094
|
-
const currentTheme = htmlElement.getAttribute("data-theme");
|
|
2095
|
-
if (currentTheme && !htmlElement.getAttribute("data-original-theme")) {
|
|
2096
|
-
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
2097
|
-
}
|
|
2098
|
-
const savedThemeMode = localStorage.getItem("theme-mode");
|
|
2099
|
-
const initialMode = savedThemeMode || "system";
|
|
2100
|
-
if (!savedThemeMode) {
|
|
2101
|
-
localStorage.setItem("theme-mode", "system");
|
|
2102
|
-
}
|
|
2103
|
-
setThemeMode(initialMode);
|
|
2104
|
-
themeModeRef.current = initialMode;
|
|
2105
|
-
applyTheme(initialMode);
|
|
2145
|
+
initializeTheme();
|
|
2106
2146
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2107
|
-
const handleSystemThemeChange = () => {
|
|
2108
|
-
if (themeModeRef.current === "system") {
|
|
2109
|
-
applyTheme("system");
|
|
2110
|
-
}
|
|
2111
|
-
};
|
|
2112
2147
|
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
2113
2148
|
return () => {
|
|
2114
2149
|
mediaQuery.removeEventListener("change", handleSystemThemeChange);
|
|
2115
2150
|
};
|
|
2116
|
-
}, [
|
|
2151
|
+
}, [initializeTheme, handleSystemThemeChange]);
|
|
2117
2152
|
return {
|
|
2118
2153
|
themeMode,
|
|
2119
2154
|
isDark,
|
|
@@ -2129,7 +2164,7 @@ var ThemeToggle = ({
|
|
|
2129
2164
|
onToggle
|
|
2130
2165
|
}) => {
|
|
2131
2166
|
const { themeMode, setTheme } = useTheme();
|
|
2132
|
-
const [tempTheme, setTempTheme] =
|
|
2167
|
+
const [tempTheme, setTempTheme] = useState5(themeMode);
|
|
2133
2168
|
useEffect5(() => {
|
|
2134
2169
|
setTempTheme(themeMode);
|
|
2135
2170
|
}, [themeMode]);
|
|
@@ -2193,7 +2228,7 @@ var ThemeToggle = ({
|
|
|
2193
2228
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2194
2229
|
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2195
2230
|
function createDropdownStore() {
|
|
2196
|
-
return
|
|
2231
|
+
return create5((set) => ({
|
|
2197
2232
|
open: false,
|
|
2198
2233
|
setOpen: (open) => set({ open })
|
|
2199
2234
|
}));
|
|
@@ -2226,14 +2261,14 @@ var DropdownMenu = ({
|
|
|
2226
2261
|
open: propOpen,
|
|
2227
2262
|
onOpenChange
|
|
2228
2263
|
}) => {
|
|
2229
|
-
const storeRef =
|
|
2264
|
+
const storeRef = useRef3(null);
|
|
2230
2265
|
storeRef.current ??= createDropdownStore();
|
|
2231
2266
|
const store = storeRef.current;
|
|
2232
2267
|
const { open, setOpen: storeSetOpen } = useStore3(store, (s) => s);
|
|
2233
2268
|
const setOpen = (newOpen) => {
|
|
2234
2269
|
storeSetOpen(newOpen);
|
|
2235
2270
|
};
|
|
2236
|
-
const menuRef =
|
|
2271
|
+
const menuRef = useRef3(null);
|
|
2237
2272
|
const handleArrowDownOrArrowUp = (event) => {
|
|
2238
2273
|
const menuContent = menuRef.current?.querySelector('[role="menu"]');
|
|
2239
2274
|
if (menuContent) {
|
|
@@ -2357,7 +2392,7 @@ var DropdownMenuContent = forwardRef10(
|
|
|
2357
2392
|
}, ref) => {
|
|
2358
2393
|
const store = useDropdownStore(externalStore);
|
|
2359
2394
|
const open = useStore3(store, (s) => s.open);
|
|
2360
|
-
const [isVisible, setIsVisible] =
|
|
2395
|
+
const [isVisible, setIsVisible] = useState6(open);
|
|
2361
2396
|
useEffect6(() => {
|
|
2362
2397
|
if (open) {
|
|
2363
2398
|
setIsVisible(true);
|
|
@@ -2516,8 +2551,8 @@ var ProfileMenuHeader = forwardRef10(({ className, name, email, store: _store, .
|
|
|
2516
2551
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
2517
2552
|
var ProfileToggleTheme = ({ ...props }) => {
|
|
2518
2553
|
const { themeMode, setTheme } = useTheme();
|
|
2519
|
-
const [modalThemeToggle, setModalThemeToggle] =
|
|
2520
|
-
const [selectedTheme, setSelectedTheme] =
|
|
2554
|
+
const [modalThemeToggle, setModalThemeToggle] = useState6(false);
|
|
2555
|
+
const [selectedTheme, setSelectedTheme] = useState6(themeMode);
|
|
2521
2556
|
const handleClick = (e) => {
|
|
2522
2557
|
e.preventDefault();
|
|
2523
2558
|
e.stopPropagation();
|
|
@@ -2674,9 +2709,9 @@ var Search = forwardRef11(
|
|
|
2674
2709
|
placeholder = "Buscar...",
|
|
2675
2710
|
...props
|
|
2676
2711
|
}, ref) => {
|
|
2677
|
-
const [dropdownOpen, setDropdownOpen] =
|
|
2678
|
-
const dropdownStore =
|
|
2679
|
-
const dropdownRef =
|
|
2712
|
+
const [dropdownOpen, setDropdownOpen] = useState7(false);
|
|
2713
|
+
const dropdownStore = useRef4(createDropdownStore()).current;
|
|
2714
|
+
const dropdownRef = useRef4(null);
|
|
2680
2715
|
const filteredOptions = useMemo2(() => {
|
|
2681
2716
|
if (!options.length) {
|
|
2682
2717
|
return [];
|
|
@@ -3813,10 +3848,10 @@ var Stepper_default = Stepper;
|
|
|
3813
3848
|
|
|
3814
3849
|
// src/components/Calendar/Calendar.tsx
|
|
3815
3850
|
import {
|
|
3816
|
-
useState as
|
|
3851
|
+
useState as useState8,
|
|
3817
3852
|
useMemo as useMemo3,
|
|
3818
3853
|
useEffect as useEffect8,
|
|
3819
|
-
useRef as
|
|
3854
|
+
useRef as useRef5
|
|
3820
3855
|
} from "react";
|
|
3821
3856
|
import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3822
3857
|
var WEEK_DAYS = ["SEG", "TER", "QUA", "QUI", "SEX", "S\xC1B", "DOM"];
|
|
@@ -3917,10 +3952,10 @@ var Calendar = ({
|
|
|
3917
3952
|
showActivities = true,
|
|
3918
3953
|
className = ""
|
|
3919
3954
|
}) => {
|
|
3920
|
-
const [currentDate, setCurrentDate] =
|
|
3921
|
-
const [isMonthPickerOpen, setIsMonthPickerOpen] =
|
|
3922
|
-
const monthPickerRef =
|
|
3923
|
-
const monthPickerContainerRef =
|
|
3955
|
+
const [currentDate, setCurrentDate] = useState8(selectedDate || /* @__PURE__ */ new Date());
|
|
3956
|
+
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState8(false);
|
|
3957
|
+
const monthPickerRef = useRef5(null);
|
|
3958
|
+
const monthPickerContainerRef = useRef5(null);
|
|
3924
3959
|
useEffect8(() => {
|
|
3925
3960
|
const handleClickOutside = (event) => {
|
|
3926
3961
|
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
@@ -4317,15 +4352,15 @@ var Calendar_default = Calendar;
|
|
|
4317
4352
|
import {
|
|
4318
4353
|
forwardRef as forwardRef13,
|
|
4319
4354
|
useId as useId8,
|
|
4320
|
-
useState as
|
|
4355
|
+
useState as useState10
|
|
4321
4356
|
} from "react";
|
|
4322
4357
|
|
|
4323
4358
|
// src/components/Card/Card.tsx
|
|
4324
4359
|
import {
|
|
4325
4360
|
forwardRef as forwardRef12,
|
|
4326
4361
|
Fragment as Fragment4,
|
|
4327
|
-
useState as
|
|
4328
|
-
useRef as
|
|
4362
|
+
useState as useState9,
|
|
4363
|
+
useRef as useRef6,
|
|
4329
4364
|
useEffect as useEffect9
|
|
4330
4365
|
} from "react";
|
|
4331
4366
|
import {
|
|
@@ -5211,16 +5246,16 @@ var CardAudio = forwardRef12(
|
|
|
5211
5246
|
className,
|
|
5212
5247
|
...props
|
|
5213
5248
|
}, ref) => {
|
|
5214
|
-
const [isPlaying, setIsPlaying] =
|
|
5215
|
-
const [currentTime, setCurrentTime] =
|
|
5216
|
-
const [duration, setDuration] =
|
|
5217
|
-
const [volume, setVolume] =
|
|
5218
|
-
const [showVolumeControl, setShowVolumeControl] =
|
|
5219
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
5220
|
-
const [playbackRate, setPlaybackRate] =
|
|
5221
|
-
const audioRef =
|
|
5222
|
-
const volumeControlRef =
|
|
5223
|
-
const speedMenuRef =
|
|
5249
|
+
const [isPlaying, setIsPlaying] = useState9(false);
|
|
5250
|
+
const [currentTime, setCurrentTime] = useState9(0);
|
|
5251
|
+
const [duration, setDuration] = useState9(0);
|
|
5252
|
+
const [volume, setVolume] = useState9(1);
|
|
5253
|
+
const [showVolumeControl, setShowVolumeControl] = useState9(false);
|
|
5254
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState9(false);
|
|
5255
|
+
const [playbackRate, setPlaybackRate] = useState9(1);
|
|
5256
|
+
const audioRef = useRef6(null);
|
|
5257
|
+
const volumeControlRef = useRef6(null);
|
|
5258
|
+
const speedMenuRef = useRef6(null);
|
|
5224
5259
|
const formatTime2 = (time) => {
|
|
5225
5260
|
const minutes = Math.floor(time / 60);
|
|
5226
5261
|
const seconds = Math.floor(time % 60);
|
|
@@ -5778,7 +5813,7 @@ var CardAccordation = forwardRef13(
|
|
|
5778
5813
|
onToggleExpanded,
|
|
5779
5814
|
...props
|
|
5780
5815
|
}, ref) => {
|
|
5781
|
-
const [isExpanded, setIsExpanded] =
|
|
5816
|
+
const [isExpanded, setIsExpanded] = useState10(defaultExpanded);
|
|
5782
5817
|
const contentId = useId8();
|
|
5783
5818
|
const handleToggle = () => {
|
|
5784
5819
|
const newExpanded = !isExpanded;
|
|
@@ -5845,7 +5880,7 @@ var CardAccordation = forwardRef13(
|
|
|
5845
5880
|
|
|
5846
5881
|
// src/components/Alternative/Alternative.tsx
|
|
5847
5882
|
import { CheckCircle as CheckCircle4, XCircle as XCircle3 } from "phosphor-react";
|
|
5848
|
-
import { forwardRef as forwardRef14, useId as useId9, useState as
|
|
5883
|
+
import { forwardRef as forwardRef14, useId as useId9, useState as useState11 } from "react";
|
|
5849
5884
|
import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5850
5885
|
var AlternativesList = ({
|
|
5851
5886
|
alternatives,
|
|
@@ -5861,7 +5896,7 @@ var AlternativesList = ({
|
|
|
5861
5896
|
}) => {
|
|
5862
5897
|
const uniqueId = useId9();
|
|
5863
5898
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
5864
|
-
const [actualValue, setActualValue] =
|
|
5899
|
+
const [actualValue, setActualValue] = useState11(value);
|
|
5865
5900
|
const isReadonly = mode === "readonly";
|
|
5866
5901
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
5867
5902
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -6230,7 +6265,7 @@ var AlertDialog = forwardRef15(
|
|
|
6230
6265
|
AlertDialog.displayName = "AlertDialog";
|
|
6231
6266
|
|
|
6232
6267
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
6233
|
-
import { useEffect as useEffect11, useState as
|
|
6268
|
+
import { useEffect as useEffect11, useState as useState12 } from "react";
|
|
6234
6269
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check4 } from "phosphor-react";
|
|
6235
6270
|
import { jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6236
6271
|
var MultipleChoiceList = ({
|
|
@@ -6242,7 +6277,7 @@ var MultipleChoiceList = ({
|
|
|
6242
6277
|
onHandleSelectedValues,
|
|
6243
6278
|
mode = "interactive"
|
|
6244
6279
|
}) => {
|
|
6245
|
-
const [actualValue, setActualValue] =
|
|
6280
|
+
const [actualValue, setActualValue] = useState12(selectedValues);
|
|
6246
6281
|
useEffect11(() => {
|
|
6247
6282
|
setActualValue(selectedValues);
|
|
6248
6283
|
}, [selectedValues]);
|
|
@@ -6567,7 +6602,7 @@ var getSubjectName = (subject) => {
|
|
|
6567
6602
|
};
|
|
6568
6603
|
|
|
6569
6604
|
// src/hooks/useMobile.ts
|
|
6570
|
-
import { useState as
|
|
6605
|
+
import { useState as useState13, useEffect as useEffect12 } from "react";
|
|
6571
6606
|
var MOBILE_WIDTH = 500;
|
|
6572
6607
|
var TABLET_WIDTH = 931;
|
|
6573
6608
|
var DEFAULT_WIDTH = 1200;
|
|
@@ -6582,8 +6617,8 @@ var getDeviceType = () => {
|
|
|
6582
6617
|
return width < TABLET_WIDTH ? "responsive" : "desktop";
|
|
6583
6618
|
};
|
|
6584
6619
|
var useMobile = () => {
|
|
6585
|
-
const [isMobile, setIsMobile] =
|
|
6586
|
-
const [isTablet, setIsTablet] =
|
|
6620
|
+
const [isMobile, setIsMobile] = useState13(false);
|
|
6621
|
+
const [isTablet, setIsTablet] = useState13(false);
|
|
6587
6622
|
useEffect12(() => {
|
|
6588
6623
|
const checkScreenSize = () => {
|
|
6589
6624
|
const width = getWindowWidth();
|
|
@@ -6624,10 +6659,10 @@ var useMobile = () => {
|
|
|
6624
6659
|
};
|
|
6625
6660
|
|
|
6626
6661
|
// src/components/Select/Select.tsx
|
|
6627
|
-
import { create as
|
|
6662
|
+
import { create as create6, useStore as useStore4 } from "zustand";
|
|
6628
6663
|
import {
|
|
6629
6664
|
useEffect as useEffect13,
|
|
6630
|
-
useRef as
|
|
6665
|
+
useRef as useRef7,
|
|
6631
6666
|
forwardRef as forwardRef16,
|
|
6632
6667
|
isValidElement as isValidElement4,
|
|
6633
6668
|
Children as Children4,
|
|
@@ -6671,7 +6706,7 @@ var ALIGN_CLASSES2 = {
|
|
|
6671
6706
|
end: "right-0"
|
|
6672
6707
|
};
|
|
6673
6708
|
function createSelectStore(onValueChange) {
|
|
6674
|
-
return
|
|
6709
|
+
return create6((set) => ({
|
|
6675
6710
|
open: false,
|
|
6676
6711
|
setOpen: (open) => set({ open }),
|
|
6677
6712
|
value: "",
|
|
@@ -6733,10 +6768,10 @@ var Select = ({
|
|
|
6733
6768
|
errorMessage,
|
|
6734
6769
|
id
|
|
6735
6770
|
}) => {
|
|
6736
|
-
const storeRef =
|
|
6771
|
+
const storeRef = useRef7(null);
|
|
6737
6772
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
6738
6773
|
const store = storeRef.current;
|
|
6739
|
-
const selectRef =
|
|
6774
|
+
const selectRef = useRef7(null);
|
|
6740
6775
|
const { open, setOpen, setValue, selectedLabel } = useStore4(store, (s) => s);
|
|
6741
6776
|
const generatedId = useId10();
|
|
6742
6777
|
const selectId = id ?? `select-${generatedId}`;
|
|
@@ -6977,19 +7012,19 @@ SelectItem.displayName = "SelectItem";
|
|
|
6977
7012
|
var Select_default = Select;
|
|
6978
7013
|
|
|
6979
7014
|
// src/components/Menu/Menu.tsx
|
|
6980
|
-
import { create as
|
|
7015
|
+
import { create as create7, useStore as useStore5 } from "zustand";
|
|
6981
7016
|
import {
|
|
6982
7017
|
useEffect as useEffect14,
|
|
6983
|
-
useRef as
|
|
7018
|
+
useRef as useRef8,
|
|
6984
7019
|
forwardRef as forwardRef17,
|
|
6985
7020
|
isValidElement as isValidElement5,
|
|
6986
7021
|
Children as Children5,
|
|
6987
7022
|
cloneElement as cloneElement6,
|
|
6988
|
-
useState as
|
|
7023
|
+
useState as useState14
|
|
6989
7024
|
} from "react";
|
|
6990
7025
|
import { CaretLeft as CaretLeft2, CaretRight as CaretRight4 } from "phosphor-react";
|
|
6991
7026
|
import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6992
|
-
var createMenuStore = (onValueChange) =>
|
|
7027
|
+
var createMenuStore = (onValueChange) => create7((set) => ({
|
|
6993
7028
|
value: "",
|
|
6994
7029
|
setValue: (value) => {
|
|
6995
7030
|
set({ value });
|
|
@@ -7017,7 +7052,7 @@ var Menu = forwardRef17(
|
|
|
7017
7052
|
onValueChange,
|
|
7018
7053
|
...props
|
|
7019
7054
|
}, ref) => {
|
|
7020
|
-
const storeRef =
|
|
7055
|
+
const storeRef = useRef8(null);
|
|
7021
7056
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
7022
7057
|
const store = storeRef.current;
|
|
7023
7058
|
const { setValue } = useStore5(store, (s) => s);
|
|
@@ -7180,7 +7215,7 @@ var MenuItem = forwardRef17(
|
|
|
7180
7215
|
{
|
|
7181
7216
|
className: cn(
|
|
7182
7217
|
"border-b border-text-600 hover:border-primary-600 text-inherit text-xs",
|
|
7183
|
-
selectedValue === value ? "border-b-0 font-bold" : "border-b-
|
|
7218
|
+
selectedValue === value ? "border-b-0 font-bold" : "border-b-text-600"
|
|
7184
7219
|
),
|
|
7185
7220
|
children
|
|
7186
7221
|
}
|
|
@@ -7222,9 +7257,9 @@ var MenuOverflow = ({
|
|
|
7222
7257
|
onValueChange,
|
|
7223
7258
|
...props
|
|
7224
7259
|
}) => {
|
|
7225
|
-
const containerRef =
|
|
7226
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
7227
|
-
const [showRightArrow, setShowRightArrow] =
|
|
7260
|
+
const containerRef = useRef8(null);
|
|
7261
|
+
const [showLeftArrow, setShowLeftArrow] = useState14(false);
|
|
7262
|
+
const [showRightArrow, setShowRightArrow] = useState14(false);
|
|
7228
7263
|
useEffect14(() => {
|
|
7229
7264
|
const checkScroll = () => internalCheckScroll(
|
|
7230
7265
|
containerRef.current,
|
|
@@ -7551,10 +7586,10 @@ var NotFound_default = NotFound;
|
|
|
7551
7586
|
|
|
7552
7587
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
7553
7588
|
import {
|
|
7554
|
-
useRef as
|
|
7555
|
-
useState as
|
|
7589
|
+
useRef as useRef9,
|
|
7590
|
+
useState as useState15,
|
|
7556
7591
|
useEffect as useEffect15,
|
|
7557
|
-
useCallback
|
|
7592
|
+
useCallback
|
|
7558
7593
|
} from "react";
|
|
7559
7594
|
import { createPortal } from "react-dom";
|
|
7560
7595
|
import {
|
|
@@ -7635,9 +7670,9 @@ var SpeedMenu = ({
|
|
|
7635
7670
|
onSpeedChange,
|
|
7636
7671
|
isFullscreen
|
|
7637
7672
|
}) => {
|
|
7638
|
-
const buttonRef =
|
|
7639
|
-
const speedMenuContainerRef =
|
|
7640
|
-
const speedMenuRef =
|
|
7673
|
+
const buttonRef = useRef9(null);
|
|
7674
|
+
const speedMenuContainerRef = useRef9(null);
|
|
7675
|
+
const speedMenuRef = useRef9(null);
|
|
7641
7676
|
const getMenuPosition = () => {
|
|
7642
7677
|
if (!buttonRef.current) return { top: 0, left: 0 };
|
|
7643
7678
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
@@ -7722,26 +7757,26 @@ var VideoPlayer = ({
|
|
|
7722
7757
|
autoSave = true,
|
|
7723
7758
|
storageKey = "video-progress"
|
|
7724
7759
|
}) => {
|
|
7725
|
-
const videoRef =
|
|
7726
|
-
const [isPlaying, setIsPlaying] =
|
|
7727
|
-
const [currentTime, setCurrentTime] =
|
|
7728
|
-
const [duration, setDuration] =
|
|
7729
|
-
const [isMuted, setIsMuted] =
|
|
7730
|
-
const [volume, setVolume] =
|
|
7731
|
-
const [isFullscreen, setIsFullscreen] =
|
|
7732
|
-
const [showControls, setShowControls] =
|
|
7733
|
-
const [hasCompleted, setHasCompleted] =
|
|
7734
|
-
const [showCaptions, setShowCaptions] =
|
|
7760
|
+
const videoRef = useRef9(null);
|
|
7761
|
+
const [isPlaying, setIsPlaying] = useState15(false);
|
|
7762
|
+
const [currentTime, setCurrentTime] = useState15(0);
|
|
7763
|
+
const [duration, setDuration] = useState15(0);
|
|
7764
|
+
const [isMuted, setIsMuted] = useState15(false);
|
|
7765
|
+
const [volume, setVolume] = useState15(1);
|
|
7766
|
+
const [isFullscreen, setIsFullscreen] = useState15(false);
|
|
7767
|
+
const [showControls, setShowControls] = useState15(true);
|
|
7768
|
+
const [hasCompleted, setHasCompleted] = useState15(false);
|
|
7769
|
+
const [showCaptions, setShowCaptions] = useState15(false);
|
|
7735
7770
|
useEffect15(() => {
|
|
7736
7771
|
setHasCompleted(false);
|
|
7737
7772
|
}, [src]);
|
|
7738
|
-
const [playbackRate, setPlaybackRate] =
|
|
7739
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
7740
|
-
const lastSaveTimeRef =
|
|
7741
|
-
const trackRef =
|
|
7742
|
-
const controlsTimeoutRef =
|
|
7743
|
-
const lastMousePositionRef =
|
|
7744
|
-
const isUserInteracting =
|
|
7773
|
+
const [playbackRate, setPlaybackRate] = useState15(1);
|
|
7774
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState15(false);
|
|
7775
|
+
const lastSaveTimeRef = useRef9(0);
|
|
7776
|
+
const trackRef = useRef9(null);
|
|
7777
|
+
const controlsTimeoutRef = useRef9(null);
|
|
7778
|
+
const lastMousePositionRef = useRef9({ x: 0, y: 0 });
|
|
7779
|
+
const isUserInteracting = useCallback(() => {
|
|
7745
7780
|
if (showSpeedMenu) {
|
|
7746
7781
|
return true;
|
|
7747
7782
|
}
|
|
@@ -7758,13 +7793,13 @@ var VideoPlayer = ({
|
|
|
7758
7793
|
}
|
|
7759
7794
|
return false;
|
|
7760
7795
|
}, [showSpeedMenu]);
|
|
7761
|
-
const clearControlsTimeout =
|
|
7796
|
+
const clearControlsTimeout = useCallback(() => {
|
|
7762
7797
|
if (controlsTimeoutRef.current) {
|
|
7763
7798
|
clearTimeout(controlsTimeoutRef.current);
|
|
7764
7799
|
controlsTimeoutRef.current = null;
|
|
7765
7800
|
}
|
|
7766
7801
|
}, []);
|
|
7767
|
-
const showControlsWithTimer =
|
|
7802
|
+
const showControlsWithTimer = useCallback(() => {
|
|
7768
7803
|
setShowControls(true);
|
|
7769
7804
|
clearControlsTimeout();
|
|
7770
7805
|
if (isFullscreen) {
|
|
@@ -7779,7 +7814,7 @@ var VideoPlayer = ({
|
|
|
7779
7814
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
7780
7815
|
}
|
|
7781
7816
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
7782
|
-
const handleMouseMove =
|
|
7817
|
+
const handleMouseMove = useCallback(
|
|
7783
7818
|
(event) => {
|
|
7784
7819
|
const currentX = event.clientX;
|
|
7785
7820
|
const currentY = event.clientY;
|
|
@@ -7792,10 +7827,10 @@ var VideoPlayer = ({
|
|
|
7792
7827
|
},
|
|
7793
7828
|
[showControlsWithTimer]
|
|
7794
7829
|
);
|
|
7795
|
-
const handleMouseEnter =
|
|
7830
|
+
const handleMouseEnter = useCallback(() => {
|
|
7796
7831
|
showControlsWithTimer();
|
|
7797
7832
|
}, [showControlsWithTimer]);
|
|
7798
|
-
const handleMouseLeave =
|
|
7833
|
+
const handleMouseLeave = useCallback(() => {
|
|
7799
7834
|
const userInteracting = isUserInteracting();
|
|
7800
7835
|
clearControlsTimeout();
|
|
7801
7836
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -7872,7 +7907,7 @@ var VideoPlayer = ({
|
|
|
7872
7907
|
};
|
|
7873
7908
|
}
|
|
7874
7909
|
}, []);
|
|
7875
|
-
const getInitialTime =
|
|
7910
|
+
const getInitialTime = useCallback(() => {
|
|
7876
7911
|
if (!autoSave || !storageKey) {
|
|
7877
7912
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
7878
7913
|
}
|
|
@@ -7890,7 +7925,7 @@ var VideoPlayer = ({
|
|
|
7890
7925
|
setCurrentTime(start);
|
|
7891
7926
|
}
|
|
7892
7927
|
}, [getInitialTime]);
|
|
7893
|
-
const saveProgress =
|
|
7928
|
+
const saveProgress = useCallback(
|
|
7894
7929
|
(time) => {
|
|
7895
7930
|
if (!autoSave || !storageKey) return;
|
|
7896
7931
|
const now = Date.now();
|
|
@@ -7901,7 +7936,7 @@ var VideoPlayer = ({
|
|
|
7901
7936
|
},
|
|
7902
7937
|
[autoSave, storageKey, src]
|
|
7903
7938
|
);
|
|
7904
|
-
const togglePlayPause =
|
|
7939
|
+
const togglePlayPause = useCallback(async () => {
|
|
7905
7940
|
const video = videoRef.current;
|
|
7906
7941
|
if (!video) return;
|
|
7907
7942
|
if (!video.paused) {
|
|
@@ -7913,7 +7948,7 @@ var VideoPlayer = ({
|
|
|
7913
7948
|
} catch {
|
|
7914
7949
|
}
|
|
7915
7950
|
}, []);
|
|
7916
|
-
const handleVolumeChange =
|
|
7951
|
+
const handleVolumeChange = useCallback(
|
|
7917
7952
|
(newVolume) => {
|
|
7918
7953
|
const video = videoRef.current;
|
|
7919
7954
|
if (!video) return;
|
|
@@ -7932,7 +7967,7 @@ var VideoPlayer = ({
|
|
|
7932
7967
|
},
|
|
7933
7968
|
[isMuted]
|
|
7934
7969
|
);
|
|
7935
|
-
const toggleMute =
|
|
7970
|
+
const toggleMute = useCallback(() => {
|
|
7936
7971
|
const video = videoRef.current;
|
|
7937
7972
|
if (!video) return;
|
|
7938
7973
|
if (isMuted) {
|
|
@@ -7946,13 +7981,13 @@ var VideoPlayer = ({
|
|
|
7946
7981
|
setIsMuted(true);
|
|
7947
7982
|
}
|
|
7948
7983
|
}, [isMuted, volume]);
|
|
7949
|
-
const handleSeek =
|
|
7984
|
+
const handleSeek = useCallback((newTime) => {
|
|
7950
7985
|
const video = videoRef.current;
|
|
7951
7986
|
if (video) {
|
|
7952
7987
|
video.currentTime = newTime;
|
|
7953
7988
|
}
|
|
7954
7989
|
}, []);
|
|
7955
|
-
const toggleFullscreen =
|
|
7990
|
+
const toggleFullscreen = useCallback(() => {
|
|
7956
7991
|
const container = videoRef.current?.parentElement;
|
|
7957
7992
|
if (!container) return;
|
|
7958
7993
|
if (!isFullscreen && container.requestFullscreen) {
|
|
@@ -7961,23 +7996,23 @@ var VideoPlayer = ({
|
|
|
7961
7996
|
document.exitFullscreen();
|
|
7962
7997
|
}
|
|
7963
7998
|
}, [isFullscreen]);
|
|
7964
|
-
const handleSpeedChange =
|
|
7999
|
+
const handleSpeedChange = useCallback((speed) => {
|
|
7965
8000
|
if (videoRef.current) {
|
|
7966
8001
|
videoRef.current.playbackRate = speed;
|
|
7967
8002
|
setPlaybackRate(speed);
|
|
7968
8003
|
setShowSpeedMenu(false);
|
|
7969
8004
|
}
|
|
7970
8005
|
}, []);
|
|
7971
|
-
const toggleSpeedMenu =
|
|
8006
|
+
const toggleSpeedMenu = useCallback(() => {
|
|
7972
8007
|
setShowSpeedMenu(!showSpeedMenu);
|
|
7973
8008
|
}, [showSpeedMenu]);
|
|
7974
|
-
const toggleCaptions =
|
|
8009
|
+
const toggleCaptions = useCallback(() => {
|
|
7975
8010
|
if (!trackRef.current?.track || !subtitles) return;
|
|
7976
8011
|
const newShowCaptions = !showCaptions;
|
|
7977
8012
|
setShowCaptions(newShowCaptions);
|
|
7978
8013
|
trackRef.current.track.mode = newShowCaptions && subtitles ? "showing" : "hidden";
|
|
7979
8014
|
}, [showCaptions, subtitles]);
|
|
7980
|
-
const checkVideoCompletion =
|
|
8015
|
+
const checkVideoCompletion = useCallback(
|
|
7981
8016
|
(progressPercent) => {
|
|
7982
8017
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
7983
8018
|
setHasCompleted(true);
|
|
@@ -7986,7 +8021,7 @@ var VideoPlayer = ({
|
|
|
7986
8021
|
},
|
|
7987
8022
|
[hasCompleted, onVideoComplete]
|
|
7988
8023
|
);
|
|
7989
|
-
const handleTimeUpdate =
|
|
8024
|
+
const handleTimeUpdate = useCallback(() => {
|
|
7990
8025
|
const video = videoRef.current;
|
|
7991
8026
|
if (!video) return;
|
|
7992
8027
|
const current = video.currentTime;
|
|
@@ -7999,7 +8034,7 @@ var VideoPlayer = ({
|
|
|
7999
8034
|
checkVideoCompletion(progressPercent);
|
|
8000
8035
|
}
|
|
8001
8036
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
8002
|
-
const handleLoadedMetadata =
|
|
8037
|
+
const handleLoadedMetadata = useCallback(() => {
|
|
8003
8038
|
if (videoRef.current) {
|
|
8004
8039
|
setDuration(videoRef.current.duration);
|
|
8005
8040
|
}
|
|
@@ -8031,13 +8066,13 @@ var VideoPlayer = ({
|
|
|
8031
8066
|
};
|
|
8032
8067
|
}, [isPlaying, clearControlsTimeout]);
|
|
8033
8068
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
8034
|
-
const getTopControlsOpacity =
|
|
8069
|
+
const getTopControlsOpacity = useCallback(() => {
|
|
8035
8070
|
return showControls ? "opacity-100" : "opacity-0";
|
|
8036
8071
|
}, [showControls]);
|
|
8037
|
-
const getBottomControlsOpacity =
|
|
8072
|
+
const getBottomControlsOpacity = useCallback(() => {
|
|
8038
8073
|
return showControls ? "opacity-100" : "opacity-0";
|
|
8039
8074
|
}, [showControls]);
|
|
8040
|
-
const handleVideoKeyDown =
|
|
8075
|
+
const handleVideoKeyDown = useCallback(
|
|
8041
8076
|
(e) => {
|
|
8042
8077
|
if (e.key) {
|
|
8043
8078
|
e.stopPropagation();
|
|
@@ -8263,7 +8298,7 @@ var VideoPlayer = ({
|
|
|
8263
8298
|
var VideoPlayer_default = VideoPlayer;
|
|
8264
8299
|
|
|
8265
8300
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
8266
|
-
import { useCallback as
|
|
8301
|
+
import { useCallback as useCallback2, useState as useState16 } from "react";
|
|
8267
8302
|
import { ArrowsOut } from "phosphor-react";
|
|
8268
8303
|
import { Fragment as Fragment8, jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8269
8304
|
var IMAGE_WIDTH = 225;
|
|
@@ -8276,8 +8311,8 @@ var Whiteboard = ({
|
|
|
8276
8311
|
imagesPerRow = 2,
|
|
8277
8312
|
...rest
|
|
8278
8313
|
}) => {
|
|
8279
|
-
const [imageErrors, setImageErrors] =
|
|
8280
|
-
const handleDownload =
|
|
8314
|
+
const [imageErrors, setImageErrors] = useState16(/* @__PURE__ */ new Set());
|
|
8315
|
+
const handleDownload = useCallback2(
|
|
8281
8316
|
(image) => {
|
|
8282
8317
|
if (onDownload) {
|
|
8283
8318
|
onDownload(image);
|
|
@@ -8294,7 +8329,7 @@ var Whiteboard = ({
|
|
|
8294
8329
|
},
|
|
8295
8330
|
[onDownload]
|
|
8296
8331
|
);
|
|
8297
|
-
const handleImageError =
|
|
8332
|
+
const handleImageError = useCallback2((imageId) => {
|
|
8298
8333
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
8299
8334
|
}, []);
|
|
8300
8335
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -8385,8 +8420,8 @@ import {
|
|
|
8385
8420
|
createContext,
|
|
8386
8421
|
useContext,
|
|
8387
8422
|
useEffect as useEffect16,
|
|
8388
|
-
useState as
|
|
8389
|
-
useCallback as
|
|
8423
|
+
useState as useState17,
|
|
8424
|
+
useCallback as useCallback3,
|
|
8390
8425
|
useMemo as useMemo4
|
|
8391
8426
|
} from "react";
|
|
8392
8427
|
import { useLocation, Navigate } from "react-router-dom";
|
|
@@ -8401,12 +8436,12 @@ var AuthProvider = ({
|
|
|
8401
8436
|
getSessionFn,
|
|
8402
8437
|
getTokensFn
|
|
8403
8438
|
}) => {
|
|
8404
|
-
const [authState, setAuthState] =
|
|
8439
|
+
const [authState, setAuthState] = useState17({
|
|
8405
8440
|
isAuthenticated: false,
|
|
8406
8441
|
isLoading: true,
|
|
8407
8442
|
...initialAuthState
|
|
8408
8443
|
});
|
|
8409
|
-
const checkAuth =
|
|
8444
|
+
const checkAuth = useCallback3(async () => {
|
|
8410
8445
|
try {
|
|
8411
8446
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
8412
8447
|
if (!checkAuthFn) {
|
|
@@ -8437,7 +8472,7 @@ var AuthProvider = ({
|
|
|
8437
8472
|
return false;
|
|
8438
8473
|
}
|
|
8439
8474
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
8440
|
-
const signOut =
|
|
8475
|
+
const signOut = useCallback3(() => {
|
|
8441
8476
|
if (signOutFn) {
|
|
8442
8477
|
signOutFn();
|
|
8443
8478
|
}
|
|
@@ -8603,7 +8638,7 @@ function createZustandAuthAdapter(useAuthStore) {
|
|
|
8603
8638
|
}
|
|
8604
8639
|
|
|
8605
8640
|
// src/components/Auth/useUrlAuthentication.ts
|
|
8606
|
-
import { useEffect as useEffect17, useRef as
|
|
8641
|
+
import { useEffect as useEffect17, useRef as useRef10 } from "react";
|
|
8607
8642
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
8608
8643
|
var getAuthParams = (location, extractParams) => {
|
|
8609
8644
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -8651,7 +8686,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
8651
8686
|
};
|
|
8652
8687
|
function useUrlAuthentication(options) {
|
|
8653
8688
|
const location = useLocation2();
|
|
8654
|
-
const processedRef =
|
|
8689
|
+
const processedRef = useRef10(false);
|
|
8655
8690
|
useEffect17(() => {
|
|
8656
8691
|
const handleAuthentication = async () => {
|
|
8657
8692
|
if (processedRef.current) {
|
|
@@ -8744,12 +8779,12 @@ import {
|
|
|
8744
8779
|
import {
|
|
8745
8780
|
forwardRef as forwardRef20,
|
|
8746
8781
|
useEffect as useEffect19,
|
|
8747
|
-
useState as
|
|
8782
|
+
useState as useState19
|
|
8748
8783
|
} from "react";
|
|
8749
8784
|
|
|
8750
8785
|
// src/components/Quiz/useQuizStore.ts
|
|
8751
|
-
import { create as
|
|
8752
|
-
import { devtools } from "zustand/middleware";
|
|
8786
|
+
import { create as create8 } from "zustand";
|
|
8787
|
+
import { devtools as devtools2 } from "zustand/middleware";
|
|
8753
8788
|
var QUESTION_DIFFICULTY = /* @__PURE__ */ ((QUESTION_DIFFICULTY2) => {
|
|
8754
8789
|
QUESTION_DIFFICULTY2["FACIL"] = "FACIL";
|
|
8755
8790
|
QUESTION_DIFFICULTY2["MEDIO"] = "MEDIO";
|
|
@@ -8796,8 +8831,8 @@ var SUBTYPE_ENUM = /* @__PURE__ */ ((SUBTYPE_ENUM2) => {
|
|
|
8796
8831
|
return SUBTYPE_ENUM2;
|
|
8797
8832
|
})(SUBTYPE_ENUM || {});
|
|
8798
8833
|
var MINUTE_INTERVAL_MS = 6e4;
|
|
8799
|
-
var useQuizStore =
|
|
8800
|
-
|
|
8834
|
+
var useQuizStore = create8()(
|
|
8835
|
+
devtools2(
|
|
8801
8836
|
(set, get) => {
|
|
8802
8837
|
let timerInterval = null;
|
|
8803
8838
|
let minuteCallbackInterval = null;
|
|
@@ -9353,12 +9388,12 @@ var useQuizStore = create7()(
|
|
|
9353
9388
|
// src/components/Quiz/QuizContent.tsx
|
|
9354
9389
|
import {
|
|
9355
9390
|
forwardRef as forwardRef19,
|
|
9356
|
-
useCallback as
|
|
9391
|
+
useCallback as useCallback4,
|
|
9357
9392
|
useEffect as useEffect18,
|
|
9358
9393
|
useId as useId11,
|
|
9359
9394
|
useMemo as useMemo6,
|
|
9360
|
-
useRef as
|
|
9361
|
-
useState as
|
|
9395
|
+
useRef as useRef11,
|
|
9396
|
+
useState as useState18
|
|
9362
9397
|
} from "react";
|
|
9363
9398
|
import { CheckCircle as CheckCircle6, XCircle as XCircle5 } from "phosphor-react";
|
|
9364
9399
|
|
|
@@ -9474,8 +9509,8 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
9474
9509
|
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
9475
9510
|
currentQuestion?.id || ""
|
|
9476
9511
|
);
|
|
9477
|
-
const prevSelectedValuesRef =
|
|
9478
|
-
const prevQuestionIdRef =
|
|
9512
|
+
const prevSelectedValuesRef = useRef11([]);
|
|
9513
|
+
const prevQuestionIdRef = useRef11("");
|
|
9479
9514
|
const allCurrentAnswerIds = useMemo6(() => {
|
|
9480
9515
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
9481
9516
|
}, [allCurrentAnswers]);
|
|
@@ -9506,7 +9541,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
9506
9541
|
variant,
|
|
9507
9542
|
currentQuestionResult?.selectedOptions
|
|
9508
9543
|
]);
|
|
9509
|
-
const handleSelectedValues =
|
|
9544
|
+
const handleSelectedValues = useCallback4(
|
|
9510
9545
|
(values) => {
|
|
9511
9546
|
if (currentQuestion) {
|
|
9512
9547
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -9569,13 +9604,13 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
9569
9604
|
currentQuestion?.id || ""
|
|
9570
9605
|
);
|
|
9571
9606
|
const currentAnswer = getCurrentAnswer();
|
|
9572
|
-
const textareaRef =
|
|
9607
|
+
const textareaRef = useRef11(null);
|
|
9573
9608
|
const handleAnswerChange = (value) => {
|
|
9574
9609
|
if (currentQuestion) {
|
|
9575
9610
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
9576
9611
|
}
|
|
9577
9612
|
};
|
|
9578
|
-
const adjustTextareaHeight =
|
|
9613
|
+
const adjustTextareaHeight = useCallback4(() => {
|
|
9579
9614
|
if (textareaRef.current) {
|
|
9580
9615
|
textareaRef.current.style.height = "auto";
|
|
9581
9616
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -9724,7 +9759,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
9724
9759
|
isCorrect: false
|
|
9725
9760
|
}
|
|
9726
9761
|
];
|
|
9727
|
-
const [userAnswers, setUserAnswers] =
|
|
9762
|
+
const [userAnswers, setUserAnswers] = useState18(() => {
|
|
9728
9763
|
if (variant === "result") {
|
|
9729
9764
|
return mockUserAnswers;
|
|
9730
9765
|
}
|
|
@@ -9843,7 +9878,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9843
9878
|
isCorrect: true
|
|
9844
9879
|
}
|
|
9845
9880
|
];
|
|
9846
|
-
const [answers, setAnswers] =
|
|
9881
|
+
const [answers, setAnswers] = useState18({});
|
|
9847
9882
|
const baseId = useId11();
|
|
9848
9883
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
9849
9884
|
const usedOptions = Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value);
|
|
@@ -9981,7 +10016,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
9981
10016
|
};
|
|
9982
10017
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
9983
10018
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
9984
|
-
const [clickPositionRelative, setClickPositionRelative] =
|
|
10019
|
+
const [clickPositionRelative, setClickPositionRelative] = useState18(variant == "result" ? mockUserAnswerRelative : null);
|
|
9985
10020
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
9986
10021
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
9987
10022
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -10165,7 +10200,7 @@ var QuizTitle = forwardRef20(
|
|
|
10165
10200
|
formatTime: formatTime2,
|
|
10166
10201
|
isStarted
|
|
10167
10202
|
} = useQuizStore();
|
|
10168
|
-
const [showExitConfirmation, setShowExitConfirmation] =
|
|
10203
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState19(false);
|
|
10169
10204
|
const totalQuestions = getTotalQuestions();
|
|
10170
10205
|
const quizTitle = getQuizTitle();
|
|
10171
10206
|
const handleBackClick = () => {
|
|
@@ -10361,8 +10396,8 @@ var QuizFooter = forwardRef20(
|
|
|
10361
10396
|
const currentAnswer = getCurrentAnswer();
|
|
10362
10397
|
const currentQuestion = getCurrentQuestion();
|
|
10363
10398
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
10364
|
-
const [activeModal, setActiveModal] =
|
|
10365
|
-
const [filterType, setFilterType] =
|
|
10399
|
+
const [activeModal, setActiveModal] = useState19(null);
|
|
10400
|
+
const [filterType, setFilterType] = useState19("all");
|
|
10366
10401
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
10367
10402
|
const closeModal = () => setActiveModal(null);
|
|
10368
10403
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -10708,7 +10743,7 @@ var QuizFooter = forwardRef20(
|
|
|
10708
10743
|
);
|
|
10709
10744
|
|
|
10710
10745
|
// src/components/Quiz/QuizResult.tsx
|
|
10711
|
-
import { forwardRef as forwardRef21, useEffect as useEffect20, useState as
|
|
10746
|
+
import { forwardRef as forwardRef21, useEffect as useEffect20, useState as useState20 } from "react";
|
|
10712
10747
|
import { Clock as Clock3 } from "phosphor-react";
|
|
10713
10748
|
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10714
10749
|
var QuizBadge = ({
|
|
@@ -10733,7 +10768,7 @@ var QuizBadge = ({
|
|
|
10733
10768
|
var QuizHeaderResult = forwardRef21(
|
|
10734
10769
|
({ className, ...props }, ref) => {
|
|
10735
10770
|
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
10736
|
-
const [status, setStatus] =
|
|
10771
|
+
const [status, setStatus] = useState20(void 0);
|
|
10737
10772
|
useEffect20(() => {
|
|
10738
10773
|
const cq = getCurrentQuestion();
|
|
10739
10774
|
if (!cq) {
|
|
@@ -11083,11 +11118,11 @@ var loadingModal_default = LoadingModal;
|
|
|
11083
11118
|
|
|
11084
11119
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
11085
11120
|
import { DotsThreeVertical as DotsThreeVertical3, Bell as Bell2 } from "phosphor-react";
|
|
11086
|
-
import { useState as
|
|
11121
|
+
import { useState as useState21, useEffect as useEffect21 } from "react";
|
|
11087
11122
|
|
|
11088
11123
|
// src/store/notificationStore.ts
|
|
11089
|
-
import { create as
|
|
11090
|
-
import { devtools as
|
|
11124
|
+
import { create as create9 } from "zustand";
|
|
11125
|
+
import { devtools as devtools3 } from "zustand/middleware";
|
|
11091
11126
|
|
|
11092
11127
|
// src/types/notifications.ts
|
|
11093
11128
|
var NotificationEntityType = /* @__PURE__ */ ((NotificationEntityType2) => {
|
|
@@ -11195,8 +11230,8 @@ var formatTimeAgo = (date) => {
|
|
|
11195
11230
|
return new Date(date).toLocaleDateString("pt-BR");
|
|
11196
11231
|
};
|
|
11197
11232
|
var createNotificationStore = (apiClient) => {
|
|
11198
|
-
return
|
|
11199
|
-
|
|
11233
|
+
return create9()(
|
|
11234
|
+
devtools3(
|
|
11200
11235
|
(set, get) => ({
|
|
11201
11236
|
// Initial state
|
|
11202
11237
|
notifications: [],
|
|
@@ -11469,7 +11504,7 @@ var NotificationList = ({
|
|
|
11469
11504
|
className,
|
|
11470
11505
|
emptyStateImage
|
|
11471
11506
|
}) => {
|
|
11472
|
-
const [globalNotificationModal, setGlobalNotificationModal] =
|
|
11507
|
+
const [globalNotificationModal, setGlobalNotificationModal] = useState21({ isOpen: false, notification: null });
|
|
11473
11508
|
const handleGlobalNotificationClick = (notification) => {
|
|
11474
11509
|
if (onGlobalNotificationClick) {
|
|
11475
11510
|
onGlobalNotificationClick(notification);
|
|
@@ -11583,8 +11618,8 @@ var NotificationCenter = ({
|
|
|
11583
11618
|
className
|
|
11584
11619
|
}) => {
|
|
11585
11620
|
const { isMobile } = useMobile();
|
|
11586
|
-
const [isModalOpen, setIsModalOpen] =
|
|
11587
|
-
const [globalNotificationModal, setGlobalNotificationModal] =
|
|
11621
|
+
const [isModalOpen, setIsModalOpen] = useState21(false);
|
|
11622
|
+
const [globalNotificationModal, setGlobalNotificationModal] = useState21({ isOpen: false, notification: null });
|
|
11588
11623
|
const handleMobileClick = () => {
|
|
11589
11624
|
setIsModalOpen(true);
|
|
11590
11625
|
onFetchNotifications?.();
|
|
@@ -11832,7 +11867,7 @@ var createUseNotificationStore = (apiClient) => {
|
|
|
11832
11867
|
};
|
|
11833
11868
|
|
|
11834
11869
|
// src/hooks/useNotifications.ts
|
|
11835
|
-
import { useCallback as
|
|
11870
|
+
import { useCallback as useCallback5 } from "react";
|
|
11836
11871
|
var createUseNotifications = (apiClient) => {
|
|
11837
11872
|
const useNotificationStore = createUseNotificationStore(apiClient);
|
|
11838
11873
|
return () => {
|
|
@@ -11851,7 +11886,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
11851
11886
|
resetError,
|
|
11852
11887
|
getGroupedNotifications
|
|
11853
11888
|
} = useNotificationStore();
|
|
11854
|
-
const handleNavigate =
|
|
11889
|
+
const handleNavigate = useCallback5(
|
|
11855
11890
|
(entityType, entityId, onAfterNavigate) => {
|
|
11856
11891
|
if (entityType && entityId) {
|
|
11857
11892
|
switch (entityType.toUpperCase()) {
|
|
@@ -11869,7 +11904,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
11869
11904
|
},
|
|
11870
11905
|
[]
|
|
11871
11906
|
);
|
|
11872
|
-
const getActionLabel =
|
|
11907
|
+
const getActionLabel = useCallback5(
|
|
11873
11908
|
(entityType) => {
|
|
11874
11909
|
if (!entityType) return "Ver mais";
|
|
11875
11910
|
switch (entityType.toUpperCase()) {
|
|
@@ -11883,7 +11918,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
11883
11918
|
},
|
|
11884
11919
|
[]
|
|
11885
11920
|
);
|
|
11886
|
-
const markAsReadAndNavigate =
|
|
11921
|
+
const markAsReadAndNavigate = useCallback5(
|
|
11887
11922
|
async (id, entityType, entityId, onAfterNavigate) => {
|
|
11888
11923
|
await markAsRead(id);
|
|
11889
11924
|
if (entityType && entityId) {
|
|
@@ -11892,11 +11927,11 @@ var createUseNotifications = (apiClient) => {
|
|
|
11892
11927
|
},
|
|
11893
11928
|
[markAsRead, handleNavigate]
|
|
11894
11929
|
);
|
|
11895
|
-
const refreshNotifications =
|
|
11930
|
+
const refreshNotifications = useCallback5(async () => {
|
|
11896
11931
|
resetError();
|
|
11897
11932
|
await fetchNotifications();
|
|
11898
11933
|
}, [resetError, fetchNotifications]);
|
|
11899
|
-
const formatNotification =
|
|
11934
|
+
const formatNotification = useCallback5(
|
|
11900
11935
|
(notification) => ({
|
|
11901
11936
|
...notification,
|
|
11902
11937
|
time: formatTimeAgo(notification.createdAt),
|
|
@@ -11905,7 +11940,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
11905
11940
|
}),
|
|
11906
11941
|
[]
|
|
11907
11942
|
);
|
|
11908
|
-
const getFormattedGroupedNotifications =
|
|
11943
|
+
const getFormattedGroupedNotifications = useCallback5(() => {
|
|
11909
11944
|
const groups = getGroupedNotifications();
|
|
11910
11945
|
return groups.map((group) => ({
|
|
11911
11946
|
...group,
|
|
@@ -12071,6 +12106,7 @@ export {
|
|
|
12071
12106
|
useQuizStore,
|
|
12072
12107
|
useRouteAuth,
|
|
12073
12108
|
useTheme,
|
|
12109
|
+
useThemeStore,
|
|
12074
12110
|
ToastStore_default as useToastStore,
|
|
12075
12111
|
useUrlAuthentication,
|
|
12076
12112
|
withAuth
|