analytica-frontend-lib 1.1.49 → 1.1.51
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/ThemeToggle/index.d.mts +51 -0
- package/dist/ThemeToggle/index.d.ts +51 -0
- package/dist/ThemeToggle/index.js +236 -0
- package/dist/ThemeToggle/index.js.map +1 -0
- package/dist/ThemeToggle/index.mjs +211 -0
- package/dist/ThemeToggle/index.mjs.map +1 -0
- package/dist/VideoPlayer/index.js +57 -22
- package/dist/VideoPlayer/index.js.map +1 -1
- package/dist/VideoPlayer/index.mjs +57 -22
- package/dist/VideoPlayer/index.mjs.map +1 -1
- package/dist/hooks/useTheme/index.d.mts +9 -4
- package/dist/hooks/useTheme/index.d.ts +9 -4
- package/dist/hooks/useTheme/index.js +73 -11
- package/dist/hooks/useTheme/index.js.map +1 -1
- package/dist/hooks/useTheme/index.mjs +74 -12
- package/dist/hooks/useTheme/index.mjs.map +1 -1
- package/dist/index.css +42 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +751 -539
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +720 -509
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +42 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -128,6 +128,7 @@ __export(src_exports, {
|
|
|
128
128
|
Table: () => Table_default,
|
|
129
129
|
Text: () => Text_default,
|
|
130
130
|
TextArea: () => TextArea_default,
|
|
131
|
+
ThemeToggle: () => ThemeToggle,
|
|
131
132
|
Toast: () => Toast_default,
|
|
132
133
|
Toaster: () => Toaster_default,
|
|
133
134
|
VideoPlayer: () => VideoPlayer_default,
|
|
@@ -6072,32 +6073,207 @@ var useMobile = () => {
|
|
|
6072
6073
|
// src/hooks/useTheme.ts
|
|
6073
6074
|
var import_react20 = require("react");
|
|
6074
6075
|
var useTheme = () => {
|
|
6075
|
-
(0, import_react20.
|
|
6076
|
+
const [themeMode, setThemeMode] = (0, import_react20.useState)("system");
|
|
6077
|
+
const [isDark, setIsDark] = (0, import_react20.useState)(false);
|
|
6078
|
+
const themeModeRef = (0, import_react20.useRef)("system");
|
|
6079
|
+
const applyTheme = (0, import_react20.useCallback)((mode) => {
|
|
6076
6080
|
const htmlElement = document.documentElement;
|
|
6077
|
-
const
|
|
6078
|
-
if (
|
|
6079
|
-
htmlElement.setAttribute("data-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6081
|
+
const originalTheme = htmlElement.getAttribute("data-original-theme");
|
|
6082
|
+
if (mode === "dark") {
|
|
6083
|
+
htmlElement.setAttribute("data-theme", "dark");
|
|
6084
|
+
setIsDark(true);
|
|
6085
|
+
} else if (mode === "light") {
|
|
6086
|
+
if (originalTheme) {
|
|
6087
|
+
htmlElement.setAttribute("data-theme", originalTheme);
|
|
6088
|
+
}
|
|
6089
|
+
setIsDark(false);
|
|
6090
|
+
} else if (mode === "system") {
|
|
6091
|
+
const isSystemDark = window.matchMedia(
|
|
6083
6092
|
"(prefers-color-scheme: dark)"
|
|
6084
6093
|
).matches;
|
|
6085
|
-
|
|
6086
|
-
if (isDarkMode) {
|
|
6094
|
+
if (isSystemDark) {
|
|
6087
6095
|
htmlElement.setAttribute("data-theme", "dark");
|
|
6096
|
+
setIsDark(true);
|
|
6088
6097
|
} else if (originalTheme) {
|
|
6089
6098
|
htmlElement.setAttribute("data-theme", originalTheme);
|
|
6099
|
+
setIsDark(false);
|
|
6090
6100
|
}
|
|
6091
|
-
}
|
|
6092
|
-
applyTheme();
|
|
6101
|
+
}
|
|
6093
6102
|
}, []);
|
|
6103
|
+
const toggleTheme = (0, import_react20.useCallback)(() => {
|
|
6104
|
+
let newMode;
|
|
6105
|
+
if (themeMode === "light") {
|
|
6106
|
+
newMode = "dark";
|
|
6107
|
+
} else if (themeMode === "dark") {
|
|
6108
|
+
newMode = "light";
|
|
6109
|
+
} else {
|
|
6110
|
+
newMode = "dark";
|
|
6111
|
+
}
|
|
6112
|
+
setThemeMode(newMode);
|
|
6113
|
+
themeModeRef.current = newMode;
|
|
6114
|
+
applyTheme(newMode);
|
|
6115
|
+
localStorage.setItem("theme-mode", newMode);
|
|
6116
|
+
}, [themeMode, applyTheme]);
|
|
6117
|
+
const setTheme = (0, import_react20.useCallback)(
|
|
6118
|
+
(mode) => {
|
|
6119
|
+
setThemeMode(mode);
|
|
6120
|
+
themeModeRef.current = mode;
|
|
6121
|
+
applyTheme(mode);
|
|
6122
|
+
localStorage.setItem("theme-mode", mode);
|
|
6123
|
+
},
|
|
6124
|
+
[applyTheme]
|
|
6125
|
+
);
|
|
6126
|
+
(0, import_react20.useEffect)(() => {
|
|
6127
|
+
const htmlElement = document.documentElement;
|
|
6128
|
+
const currentTheme = htmlElement.getAttribute("data-theme");
|
|
6129
|
+
if (currentTheme && !htmlElement.getAttribute("data-original-theme")) {
|
|
6130
|
+
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
6131
|
+
}
|
|
6132
|
+
const savedThemeMode = localStorage.getItem("theme-mode");
|
|
6133
|
+
const initialMode = savedThemeMode || "system";
|
|
6134
|
+
if (!savedThemeMode) {
|
|
6135
|
+
localStorage.setItem("theme-mode", "system");
|
|
6136
|
+
}
|
|
6137
|
+
setThemeMode(initialMode);
|
|
6138
|
+
themeModeRef.current = initialMode;
|
|
6139
|
+
applyTheme(initialMode);
|
|
6140
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
6141
|
+
const handleSystemThemeChange = () => {
|
|
6142
|
+
if (themeModeRef.current === "system") {
|
|
6143
|
+
applyTheme("system");
|
|
6144
|
+
}
|
|
6145
|
+
};
|
|
6146
|
+
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
6147
|
+
return () => {
|
|
6148
|
+
mediaQuery.removeEventListener("change", handleSystemThemeChange);
|
|
6149
|
+
};
|
|
6150
|
+
}, [applyTheme]);
|
|
6151
|
+
return {
|
|
6152
|
+
themeMode,
|
|
6153
|
+
isDark,
|
|
6154
|
+
toggleTheme,
|
|
6155
|
+
setTheme
|
|
6156
|
+
};
|
|
6094
6157
|
};
|
|
6095
6158
|
|
|
6159
|
+
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
6160
|
+
var import_react21 = require("react");
|
|
6161
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6162
|
+
var ThemeToggle = (0, import_react21.forwardRef)(
|
|
6163
|
+
({
|
|
6164
|
+
variant = "simple",
|
|
6165
|
+
size = "md",
|
|
6166
|
+
showIcons = true,
|
|
6167
|
+
showLabels = true,
|
|
6168
|
+
className,
|
|
6169
|
+
children,
|
|
6170
|
+
...props
|
|
6171
|
+
}, ref) => {
|
|
6172
|
+
const { themeMode, isDark, toggleTheme, setTheme } = useTheme();
|
|
6173
|
+
const sizeClasses = {
|
|
6174
|
+
sm: "text-sm px-3 py-1.5",
|
|
6175
|
+
md: "text-md px-4 py-2",
|
|
6176
|
+
lg: "text-lg px-5 py-2.5"
|
|
6177
|
+
};
|
|
6178
|
+
const activeClasses = "bg-primary-500 text-white";
|
|
6179
|
+
const inactiveClasses = "bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-600";
|
|
6180
|
+
const baseButtonClasses = "inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 dark:border-gray-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500";
|
|
6181
|
+
const smallButtonClasses = "px-3 py-1.5 rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500";
|
|
6182
|
+
const renderThemeButton = (theme, icon, label, isActive, buttonSize) => {
|
|
6183
|
+
const buttonClasses = buttonSize ? cn(baseButtonClasses, sizeClasses[buttonSize]) : smallButtonClasses;
|
|
6184
|
+
const stateClasses = isActive ? activeClasses : inactiveClasses;
|
|
6185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6186
|
+
"button",
|
|
6187
|
+
{
|
|
6188
|
+
type: "button",
|
|
6189
|
+
onClick: () => setTheme(theme),
|
|
6190
|
+
className: cn(buttonClasses, stateClasses),
|
|
6191
|
+
...buttonSize ? props : {},
|
|
6192
|
+
children: [
|
|
6193
|
+
showIcons && icon,
|
|
6194
|
+
showLabels && label
|
|
6195
|
+
]
|
|
6196
|
+
}
|
|
6197
|
+
);
|
|
6198
|
+
};
|
|
6199
|
+
if (variant === "simple") {
|
|
6200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6201
|
+
"button",
|
|
6202
|
+
{
|
|
6203
|
+
type: "button",
|
|
6204
|
+
ref,
|
|
6205
|
+
onClick: toggleTheme,
|
|
6206
|
+
className: cn(
|
|
6207
|
+
"inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 dark:border-gray-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
6208
|
+
sizeClasses[size],
|
|
6209
|
+
className
|
|
6210
|
+
),
|
|
6211
|
+
...props,
|
|
6212
|
+
children: children || /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
6213
|
+
showIcons && (isDark ? "\u2600\uFE0F" : "\u{1F319}"),
|
|
6214
|
+
showLabels && (isDark ? "Claro" : "Escuro")
|
|
6215
|
+
] })
|
|
6216
|
+
}
|
|
6217
|
+
);
|
|
6218
|
+
}
|
|
6219
|
+
if (variant === "detailed") {
|
|
6220
|
+
const getLabel = () => {
|
|
6221
|
+
if (themeMode === "system") return "Sistema";
|
|
6222
|
+
if (isDark) return "Escuro";
|
|
6223
|
+
return "Claro";
|
|
6224
|
+
};
|
|
6225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
6226
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
6227
|
+
"Tema: ",
|
|
6228
|
+
getLabel()
|
|
6229
|
+
] }),
|
|
6230
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-1", children: [
|
|
6231
|
+
renderThemeButton("light", "\u2600\uFE0F ", "Claro", themeMode === "light"),
|
|
6232
|
+
renderThemeButton("dark", "\u{1F319} ", "Escuro", themeMode === "dark"),
|
|
6233
|
+
renderThemeButton(
|
|
6234
|
+
"system",
|
|
6235
|
+
"\u2699\uFE0F ",
|
|
6236
|
+
"Sistema",
|
|
6237
|
+
themeMode === "system"
|
|
6238
|
+
)
|
|
6239
|
+
] })
|
|
6240
|
+
] });
|
|
6241
|
+
}
|
|
6242
|
+
if (variant === "buttons") {
|
|
6243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex gap-2", className), children: [
|
|
6244
|
+
renderThemeButton(
|
|
6245
|
+
"light",
|
|
6246
|
+
"\u2600\uFE0F",
|
|
6247
|
+
"Claro",
|
|
6248
|
+
themeMode === "light",
|
|
6249
|
+
size
|
|
6250
|
+
),
|
|
6251
|
+
renderThemeButton(
|
|
6252
|
+
"dark",
|
|
6253
|
+
"\u{1F319}",
|
|
6254
|
+
"Escuro",
|
|
6255
|
+
themeMode === "dark",
|
|
6256
|
+
size
|
|
6257
|
+
),
|
|
6258
|
+
renderThemeButton(
|
|
6259
|
+
"system",
|
|
6260
|
+
"\u2699\uFE0F",
|
|
6261
|
+
"Sistema",
|
|
6262
|
+
themeMode === "system",
|
|
6263
|
+
size
|
|
6264
|
+
)
|
|
6265
|
+
] });
|
|
6266
|
+
}
|
|
6267
|
+
return null;
|
|
6268
|
+
}
|
|
6269
|
+
);
|
|
6270
|
+
ThemeToggle.displayName = "ThemeToggle";
|
|
6271
|
+
|
|
6096
6272
|
// src/components/Select/Select.tsx
|
|
6097
6273
|
var import_zustand5 = require("zustand");
|
|
6098
|
-
var
|
|
6274
|
+
var import_react22 = require("react");
|
|
6099
6275
|
var import_phosphor_react16 = require("phosphor-react");
|
|
6100
|
-
var
|
|
6276
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6101
6277
|
var VARIANT_CLASSES4 = {
|
|
6102
6278
|
outlined: "border-2 rounded-lg focus:border-primary-950",
|
|
6103
6279
|
underlined: "border-b-2 focus:border-primary-950",
|
|
@@ -6155,13 +6331,13 @@ function getLabelAsNode(children) {
|
|
|
6155
6331
|
if (typeof children === "string" || typeof children === "number") {
|
|
6156
6332
|
return children;
|
|
6157
6333
|
}
|
|
6158
|
-
const flattened =
|
|
6334
|
+
const flattened = import_react22.Children.toArray(children);
|
|
6159
6335
|
if (flattened.length === 1) return flattened[0];
|
|
6160
|
-
return /* @__PURE__ */ (0,
|
|
6336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: flattened });
|
|
6161
6337
|
}
|
|
6162
6338
|
var injectStore4 = (children, store, size, selectId) => {
|
|
6163
|
-
return
|
|
6164
|
-
if ((0,
|
|
6339
|
+
return import_react22.Children.map(children, (child) => {
|
|
6340
|
+
if ((0, import_react22.isValidElement)(child)) {
|
|
6165
6341
|
const typedChild = child;
|
|
6166
6342
|
const newProps = {
|
|
6167
6343
|
store
|
|
@@ -6178,7 +6354,7 @@ var injectStore4 = (children, store, size, selectId) => {
|
|
|
6178
6354
|
selectId
|
|
6179
6355
|
);
|
|
6180
6356
|
}
|
|
6181
|
-
return (0,
|
|
6357
|
+
return (0, import_react22.cloneElement)(typedChild, newProps);
|
|
6182
6358
|
}
|
|
6183
6359
|
return child;
|
|
6184
6360
|
});
|
|
@@ -6195,18 +6371,18 @@ var Select = ({
|
|
|
6195
6371
|
errorMessage,
|
|
6196
6372
|
id
|
|
6197
6373
|
}) => {
|
|
6198
|
-
const storeRef = (0,
|
|
6374
|
+
const storeRef = (0, import_react22.useRef)(null);
|
|
6199
6375
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
6200
6376
|
const store = storeRef.current;
|
|
6201
|
-
const selectRef = (0,
|
|
6377
|
+
const selectRef = (0, import_react22.useRef)(null);
|
|
6202
6378
|
const { open, setOpen, setValue, selectedLabel } = (0, import_zustand5.useStore)(store, (s) => s);
|
|
6203
|
-
const generatedId = (0,
|
|
6379
|
+
const generatedId = (0, import_react22.useId)();
|
|
6204
6380
|
const selectId = id ?? `select-${generatedId}`;
|
|
6205
6381
|
const findLabelForValue = (children2, targetValue) => {
|
|
6206
6382
|
let found = null;
|
|
6207
6383
|
const search = (nodes) => {
|
|
6208
|
-
|
|
6209
|
-
if (!(0,
|
|
6384
|
+
import_react22.Children.forEach(nodes, (child) => {
|
|
6385
|
+
if (!(0, import_react22.isValidElement)(child)) return;
|
|
6210
6386
|
const typedChild = child;
|
|
6211
6387
|
if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
|
|
6212
6388
|
if (typeof typedChild.props.children === "string")
|
|
@@ -6219,13 +6395,13 @@ var Select = ({
|
|
|
6219
6395
|
search(children2);
|
|
6220
6396
|
return found;
|
|
6221
6397
|
};
|
|
6222
|
-
(0,
|
|
6398
|
+
(0, import_react22.useEffect)(() => {
|
|
6223
6399
|
if (!selectedLabel && defaultValue) {
|
|
6224
6400
|
const label2 = findLabelForValue(children, defaultValue);
|
|
6225
6401
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
6226
6402
|
}
|
|
6227
6403
|
}, [children, defaultValue, selectedLabel]);
|
|
6228
|
-
(0,
|
|
6404
|
+
(0, import_react22.useEffect)(() => {
|
|
6229
6405
|
const handleClickOutside = (event) => {
|
|
6230
6406
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
6231
6407
|
setOpen(false);
|
|
@@ -6260,7 +6436,7 @@ var Select = ({
|
|
|
6260
6436
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
6261
6437
|
};
|
|
6262
6438
|
}, [open]);
|
|
6263
|
-
(0,
|
|
6439
|
+
(0, import_react22.useEffect)(() => {
|
|
6264
6440
|
if (propValue) {
|
|
6265
6441
|
setValue(propValue);
|
|
6266
6442
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -6268,8 +6444,8 @@ var Select = ({
|
|
|
6268
6444
|
}
|
|
6269
6445
|
}, [propValue]);
|
|
6270
6446
|
const sizeClasses = SIZE_CLASSES12[size];
|
|
6271
|
-
return /* @__PURE__ */ (0,
|
|
6272
|
-
label && /* @__PURE__ */ (0,
|
|
6447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("w-full", className), children: [
|
|
6448
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6273
6449
|
"label",
|
|
6274
6450
|
{
|
|
6275
6451
|
htmlFor: selectId,
|
|
@@ -6277,11 +6453,11 @@ var Select = ({
|
|
|
6277
6453
|
children: label
|
|
6278
6454
|
}
|
|
6279
6455
|
),
|
|
6280
|
-
/* @__PURE__ */ (0,
|
|
6281
|
-
(helperText || errorMessage) && /* @__PURE__ */ (0,
|
|
6282
|
-
helperText && /* @__PURE__ */ (0,
|
|
6283
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
6284
|
-
/* @__PURE__ */ (0,
|
|
6456
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
6457
|
+
(helperText || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
|
|
6458
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
|
|
6459
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_phosphor_react16.WarningCircle, { size: 16 }),
|
|
6285
6461
|
" ",
|
|
6286
6462
|
errorMessage
|
|
6287
6463
|
] })
|
|
@@ -6295,9 +6471,9 @@ var SelectValue = ({
|
|
|
6295
6471
|
const store = useSelectStore(externalStore);
|
|
6296
6472
|
const selectedLabel = (0, import_zustand5.useStore)(store, (s) => s.selectedLabel);
|
|
6297
6473
|
const value = (0, import_zustand5.useStore)(store, (s) => s.value);
|
|
6298
|
-
return /* @__PURE__ */ (0,
|
|
6474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
6299
6475
|
};
|
|
6300
|
-
var SelectTrigger = (0,
|
|
6476
|
+
var SelectTrigger = (0, import_react22.forwardRef)(
|
|
6301
6477
|
({
|
|
6302
6478
|
className,
|
|
6303
6479
|
invalid = false,
|
|
@@ -6314,7 +6490,7 @@ var SelectTrigger = (0, import_react21.forwardRef)(
|
|
|
6314
6490
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
6315
6491
|
const heightClasses = HEIGHT_CLASSES[size];
|
|
6316
6492
|
const paddingClasses = PADDING_CLASSES[size];
|
|
6317
|
-
return /* @__PURE__ */ (0,
|
|
6493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6318
6494
|
"button",
|
|
6319
6495
|
{
|
|
6320
6496
|
ref,
|
|
@@ -6336,7 +6512,7 @@ var SelectTrigger = (0, import_react21.forwardRef)(
|
|
|
6336
6512
|
...props,
|
|
6337
6513
|
children: [
|
|
6338
6514
|
props.children,
|
|
6339
|
-
/* @__PURE__ */ (0,
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6340
6516
|
import_phosphor_react16.CaretDown,
|
|
6341
6517
|
{
|
|
6342
6518
|
className: cn(
|
|
@@ -6351,7 +6527,7 @@ var SelectTrigger = (0, import_react21.forwardRef)(
|
|
|
6351
6527
|
}
|
|
6352
6528
|
);
|
|
6353
6529
|
SelectTrigger.displayName = "SelectTrigger";
|
|
6354
|
-
var SelectContent = (0,
|
|
6530
|
+
var SelectContent = (0, import_react22.forwardRef)(
|
|
6355
6531
|
({
|
|
6356
6532
|
children,
|
|
6357
6533
|
className,
|
|
@@ -6364,7 +6540,7 @@ var SelectContent = (0, import_react21.forwardRef)(
|
|
|
6364
6540
|
const open = (0, import_zustand5.useStore)(store, (s) => s.open);
|
|
6365
6541
|
if (!open) return null;
|
|
6366
6542
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
6367
|
-
return /* @__PURE__ */ (0,
|
|
6543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6368
6544
|
"div",
|
|
6369
6545
|
{
|
|
6370
6546
|
role: "menu",
|
|
@@ -6381,7 +6557,7 @@ var SelectContent = (0, import_react21.forwardRef)(
|
|
|
6381
6557
|
}
|
|
6382
6558
|
);
|
|
6383
6559
|
SelectContent.displayName = "SelectContent";
|
|
6384
|
-
var SelectItem = (0,
|
|
6560
|
+
var SelectItem = (0, import_react22.forwardRef)(
|
|
6385
6561
|
({
|
|
6386
6562
|
className,
|
|
6387
6563
|
children,
|
|
@@ -6408,7 +6584,7 @@ var SelectItem = (0, import_react21.forwardRef)(
|
|
|
6408
6584
|
}
|
|
6409
6585
|
props.onClick?.(e);
|
|
6410
6586
|
};
|
|
6411
|
-
return /* @__PURE__ */ (0,
|
|
6587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6412
6588
|
"div",
|
|
6413
6589
|
{
|
|
6414
6590
|
role: "menuitem",
|
|
@@ -6428,7 +6604,7 @@ var SelectItem = (0, import_react21.forwardRef)(
|
|
|
6428
6604
|
tabIndex: disabled ? -1 : 0,
|
|
6429
6605
|
...props,
|
|
6430
6606
|
children: [
|
|
6431
|
-
/* @__PURE__ */ (0,
|
|
6607
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_phosphor_react16.Check, { className: "" }) }),
|
|
6432
6608
|
children
|
|
6433
6609
|
]
|
|
6434
6610
|
}
|
|
@@ -6440,9 +6616,9 @@ var Select_default = Select;
|
|
|
6440
6616
|
|
|
6441
6617
|
// src/components/Menu/Menu.tsx
|
|
6442
6618
|
var import_zustand6 = require("zustand");
|
|
6443
|
-
var
|
|
6619
|
+
var import_react23 = require("react");
|
|
6444
6620
|
var import_phosphor_react17 = require("phosphor-react");
|
|
6445
|
-
var
|
|
6621
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6446
6622
|
var createMenuStore = (onValueChange) => (0, import_zustand6.create)((set) => ({
|
|
6447
6623
|
value: "",
|
|
6448
6624
|
setValue: (value) => {
|
|
@@ -6461,7 +6637,7 @@ var VARIANT_CLASSES5 = {
|
|
|
6461
6637
|
"menu-overflow": "",
|
|
6462
6638
|
breadcrumb: "bg-transparent shadow-none !px-0"
|
|
6463
6639
|
};
|
|
6464
|
-
var Menu = (0,
|
|
6640
|
+
var Menu = (0, import_react23.forwardRef)(
|
|
6465
6641
|
({
|
|
6466
6642
|
className,
|
|
6467
6643
|
children,
|
|
@@ -6471,16 +6647,16 @@ var Menu = (0, import_react22.forwardRef)(
|
|
|
6471
6647
|
onValueChange,
|
|
6472
6648
|
...props
|
|
6473
6649
|
}, ref) => {
|
|
6474
|
-
const storeRef = (0,
|
|
6650
|
+
const storeRef = (0, import_react23.useRef)(null);
|
|
6475
6651
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
6476
6652
|
const store = storeRef.current;
|
|
6477
6653
|
const { setValue } = (0, import_zustand6.useStore)(store, (s) => s);
|
|
6478
|
-
(0,
|
|
6654
|
+
(0, import_react23.useEffect)(() => {
|
|
6479
6655
|
setValue(propValue ?? defaultValue);
|
|
6480
6656
|
}, [defaultValue, propValue, setValue]);
|
|
6481
6657
|
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";
|
|
6482
6658
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6484
6660
|
"div",
|
|
6485
6661
|
{
|
|
6486
6662
|
ref,
|
|
@@ -6496,11 +6672,11 @@ var Menu = (0, import_react22.forwardRef)(
|
|
|
6496
6672
|
}
|
|
6497
6673
|
);
|
|
6498
6674
|
Menu.displayName = "Menu";
|
|
6499
|
-
var MenuContent = (0,
|
|
6675
|
+
var MenuContent = (0, import_react23.forwardRef)(
|
|
6500
6676
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
6501
6677
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
6502
6678
|
const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
|
|
6503
|
-
return /* @__PURE__ */ (0,
|
|
6679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6504
6680
|
"ul",
|
|
6505
6681
|
{
|
|
6506
6682
|
ref,
|
|
@@ -6518,7 +6694,7 @@ var MenuContent = (0, import_react22.forwardRef)(
|
|
|
6518
6694
|
}
|
|
6519
6695
|
);
|
|
6520
6696
|
MenuContent.displayName = "MenuContent";
|
|
6521
|
-
var MenuItem = (0,
|
|
6697
|
+
var MenuItem = (0, import_react23.forwardRef)(
|
|
6522
6698
|
({
|
|
6523
6699
|
className,
|
|
6524
6700
|
children,
|
|
@@ -6552,7 +6728,7 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6552
6728
|
...props
|
|
6553
6729
|
};
|
|
6554
6730
|
const variants = {
|
|
6555
|
-
menu: /* @__PURE__ */ (0,
|
|
6731
|
+
menu: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6556
6732
|
"li",
|
|
6557
6733
|
{
|
|
6558
6734
|
"data-variant": "menu",
|
|
@@ -6567,7 +6743,7 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6567
6743
|
children
|
|
6568
6744
|
}
|
|
6569
6745
|
),
|
|
6570
|
-
menu2: /* @__PURE__ */ (0,
|
|
6746
|
+
menu2: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6571
6747
|
"li",
|
|
6572
6748
|
{
|
|
6573
6749
|
"data-variant": "menu2",
|
|
@@ -6578,7 +6754,7 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6578
6754
|
`,
|
|
6579
6755
|
...commonProps,
|
|
6580
6756
|
children: [
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6757
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6582
6758
|
"span",
|
|
6583
6759
|
{
|
|
6584
6760
|
className: cn(
|
|
@@ -6588,11 +6764,11 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6588
6764
|
children
|
|
6589
6765
|
}
|
|
6590
6766
|
),
|
|
6591
|
-
selectedValue === value && /* @__PURE__ */ (0,
|
|
6767
|
+
selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
6592
6768
|
]
|
|
6593
6769
|
}
|
|
6594
6770
|
),
|
|
6595
|
-
"menu-overflow": /* @__PURE__ */ (0,
|
|
6771
|
+
"menu-overflow": /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6596
6772
|
"li",
|
|
6597
6773
|
{
|
|
6598
6774
|
"data-variant": "menu-overflow",
|
|
@@ -6603,7 +6779,7 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6603
6779
|
`,
|
|
6604
6780
|
...commonProps,
|
|
6605
6781
|
children: [
|
|
6606
|
-
/* @__PURE__ */ (0,
|
|
6782
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6607
6783
|
"span",
|
|
6608
6784
|
{
|
|
6609
6785
|
className: cn(
|
|
@@ -6613,11 +6789,11 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6613
6789
|
children
|
|
6614
6790
|
}
|
|
6615
6791
|
),
|
|
6616
|
-
selectedValue === value && /* @__PURE__ */ (0,
|
|
6792
|
+
selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
6617
6793
|
]
|
|
6618
6794
|
}
|
|
6619
6795
|
),
|
|
6620
|
-
breadcrumb: /* @__PURE__ */ (0,
|
|
6796
|
+
breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6621
6797
|
"li",
|
|
6622
6798
|
{
|
|
6623
6799
|
"data-variant": "breadcrumb",
|
|
@@ -6629,7 +6805,7 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6629
6805
|
`,
|
|
6630
6806
|
...commonProps,
|
|
6631
6807
|
children: [
|
|
6632
|
-
/* @__PURE__ */ (0,
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6633
6809
|
"span",
|
|
6634
6810
|
{
|
|
6635
6811
|
className: cn(
|
|
@@ -6639,7 +6815,7 @@ var MenuItem = (0, import_react22.forwardRef)(
|
|
|
6639
6815
|
children
|
|
6640
6816
|
}
|
|
6641
6817
|
),
|
|
6642
|
-
separator && /* @__PURE__ */ (0,
|
|
6818
|
+
separator && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6643
6819
|
import_phosphor_react17.CaretRight,
|
|
6644
6820
|
{
|
|
6645
6821
|
size: 16,
|
|
@@ -6676,10 +6852,10 @@ var MenuOverflow = ({
|
|
|
6676
6852
|
onValueChange,
|
|
6677
6853
|
...props
|
|
6678
6854
|
}) => {
|
|
6679
|
-
const containerRef = (0,
|
|
6680
|
-
const [showLeftArrow, setShowLeftArrow] = (0,
|
|
6681
|
-
const [showRightArrow, setShowRightArrow] = (0,
|
|
6682
|
-
(0,
|
|
6855
|
+
const containerRef = (0, import_react23.useRef)(null);
|
|
6856
|
+
const [showLeftArrow, setShowLeftArrow] = (0, import_react23.useState)(false);
|
|
6857
|
+
const [showRightArrow, setShowRightArrow] = (0, import_react23.useState)(false);
|
|
6858
|
+
(0, import_react23.useEffect)(() => {
|
|
6683
6859
|
const checkScroll = () => internalCheckScroll(
|
|
6684
6860
|
containerRef.current,
|
|
6685
6861
|
setShowLeftArrow,
|
|
@@ -6694,25 +6870,25 @@ var MenuOverflow = ({
|
|
|
6694
6870
|
window.removeEventListener("resize", checkScroll);
|
|
6695
6871
|
};
|
|
6696
6872
|
}, []);
|
|
6697
|
-
return /* @__PURE__ */ (0,
|
|
6873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6698
6874
|
"div",
|
|
6699
6875
|
{
|
|
6700
6876
|
"data-testid": "menu-overflow-wrapper",
|
|
6701
6877
|
className: cn("relative w-full overflow-hidden", className),
|
|
6702
6878
|
children: [
|
|
6703
|
-
showLeftArrow && /* @__PURE__ */ (0,
|
|
6879
|
+
showLeftArrow && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6704
6880
|
"button",
|
|
6705
6881
|
{
|
|
6706
6882
|
onClick: () => internalScroll(containerRef.current, "left"),
|
|
6707
6883
|
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
6708
6884
|
"data-testid": "scroll-left-button",
|
|
6709
6885
|
children: [
|
|
6710
|
-
/* @__PURE__ */ (0,
|
|
6711
|
-
/* @__PURE__ */ (0,
|
|
6886
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react17.CaretLeft, { size: 16 }),
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sr-only", children: "Scroll left" })
|
|
6712
6888
|
]
|
|
6713
6889
|
}
|
|
6714
6890
|
),
|
|
6715
|
-
/* @__PURE__ */ (0,
|
|
6891
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6716
6892
|
Menu,
|
|
6717
6893
|
{
|
|
6718
6894
|
defaultValue,
|
|
@@ -6720,18 +6896,18 @@ var MenuOverflow = ({
|
|
|
6720
6896
|
value,
|
|
6721
6897
|
variant: "menu2",
|
|
6722
6898
|
...props,
|
|
6723
|
-
children: /* @__PURE__ */ (0,
|
|
6899
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MenuContent, { ref: containerRef, variant: "menu2", children })
|
|
6724
6900
|
}
|
|
6725
6901
|
),
|
|
6726
|
-
showRightArrow && /* @__PURE__ */ (0,
|
|
6902
|
+
showRightArrow && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6727
6903
|
"button",
|
|
6728
6904
|
{
|
|
6729
6905
|
onClick: () => internalScroll(containerRef.current, "right"),
|
|
6730
6906
|
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
6731
6907
|
"data-testid": "scroll-right-button",
|
|
6732
6908
|
children: [
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
6734
|
-
/* @__PURE__ */ (0,
|
|
6909
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react17.CaretRight, { size: 16 }),
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sr-only", children: "Scroll right" })
|
|
6735
6911
|
]
|
|
6736
6912
|
}
|
|
6737
6913
|
)
|
|
@@ -6739,11 +6915,11 @@ var MenuOverflow = ({
|
|
|
6739
6915
|
}
|
|
6740
6916
|
);
|
|
6741
6917
|
};
|
|
6742
|
-
var injectStore5 = (children, store) =>
|
|
6743
|
-
if (!(0,
|
|
6918
|
+
var injectStore5 = (children, store) => import_react23.Children.map(children, (child) => {
|
|
6919
|
+
if (!(0, import_react23.isValidElement)(child)) return child;
|
|
6744
6920
|
const typedChild = child;
|
|
6745
6921
|
const shouldInject = typedChild.type === MenuItem;
|
|
6746
|
-
return (0,
|
|
6922
|
+
return (0, import_react23.cloneElement)(typedChild, {
|
|
6747
6923
|
...shouldInject ? { store } : {},
|
|
6748
6924
|
...typedChild.props.children ? { children: injectStore5(typedChild.props.children, store) } : {}
|
|
6749
6925
|
});
|
|
@@ -6751,8 +6927,8 @@ var injectStore5 = (children, store) => import_react22.Children.map(children, (c
|
|
|
6751
6927
|
var Menu_default = Menu;
|
|
6752
6928
|
|
|
6753
6929
|
// src/components/Skeleton/Skeleton.tsx
|
|
6754
|
-
var
|
|
6755
|
-
var
|
|
6930
|
+
var import_react24 = require("react");
|
|
6931
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6756
6932
|
var SKELETON_ANIMATION_CLASSES = {
|
|
6757
6933
|
pulse: "animate-pulse",
|
|
6758
6934
|
none: ""
|
|
@@ -6769,7 +6945,7 @@ var SPACING_CLASSES = {
|
|
|
6769
6945
|
medium: "space-y-2",
|
|
6770
6946
|
large: "space-y-3"
|
|
6771
6947
|
};
|
|
6772
|
-
var Skeleton = (0,
|
|
6948
|
+
var Skeleton = (0, import_react24.forwardRef)(
|
|
6773
6949
|
({
|
|
6774
6950
|
variant = "text",
|
|
6775
6951
|
width,
|
|
@@ -6789,13 +6965,13 @@ var Skeleton = (0, import_react23.forwardRef)(
|
|
|
6789
6965
|
height: typeof height === "number" ? `${height}px` : height
|
|
6790
6966
|
};
|
|
6791
6967
|
if (variant === "text" && lines > 1) {
|
|
6792
|
-
return /* @__PURE__ */ (0,
|
|
6968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6793
6969
|
"div",
|
|
6794
6970
|
{
|
|
6795
6971
|
ref,
|
|
6796
6972
|
className: cn("flex flex-col", spacingClass, className),
|
|
6797
6973
|
...props,
|
|
6798
|
-
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0,
|
|
6974
|
+
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6799
6975
|
"div",
|
|
6800
6976
|
{
|
|
6801
6977
|
className: cn(variantClass, animationClass),
|
|
@@ -6806,7 +6982,7 @@ var Skeleton = (0, import_react23.forwardRef)(
|
|
|
6806
6982
|
}
|
|
6807
6983
|
);
|
|
6808
6984
|
}
|
|
6809
|
-
return /* @__PURE__ */ (0,
|
|
6985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6810
6986
|
"div",
|
|
6811
6987
|
{
|
|
6812
6988
|
ref,
|
|
@@ -6818,13 +6994,13 @@ var Skeleton = (0, import_react23.forwardRef)(
|
|
|
6818
6994
|
);
|
|
6819
6995
|
}
|
|
6820
6996
|
);
|
|
6821
|
-
var SkeletonText = (0,
|
|
6822
|
-
(props, ref) => /* @__PURE__ */ (0,
|
|
6997
|
+
var SkeletonText = (0, import_react24.forwardRef)(
|
|
6998
|
+
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { ref, variant: "text", ...props })
|
|
6823
6999
|
);
|
|
6824
|
-
var SkeletonCircle = (0,
|
|
6825
|
-
var SkeletonRectangle = (0,
|
|
6826
|
-
var SkeletonRounded = (0,
|
|
6827
|
-
var SkeletonCard = (0,
|
|
7000
|
+
var SkeletonCircle = (0, import_react24.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { ref, variant: "circular", ...props }));
|
|
7001
|
+
var SkeletonRectangle = (0, import_react24.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
|
|
7002
|
+
var SkeletonRounded = (0, import_react24.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
|
|
7003
|
+
var SkeletonCard = (0, import_react24.forwardRef)(
|
|
6828
7004
|
({
|
|
6829
7005
|
showAvatar = true,
|
|
6830
7006
|
showTitle = true,
|
|
@@ -6834,7 +7010,7 @@ var SkeletonCard = (0, import_react23.forwardRef)(
|
|
|
6834
7010
|
className = "",
|
|
6835
7011
|
...props
|
|
6836
7012
|
}, ref) => {
|
|
6837
|
-
return /* @__PURE__ */ (0,
|
|
7013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6838
7014
|
"div",
|
|
6839
7015
|
{
|
|
6840
7016
|
ref,
|
|
@@ -6844,23 +7020,23 @@ var SkeletonCard = (0, import_react23.forwardRef)(
|
|
|
6844
7020
|
),
|
|
6845
7021
|
...props,
|
|
6846
7022
|
children: [
|
|
6847
|
-
/* @__PURE__ */ (0,
|
|
6848
|
-
showAvatar && /* @__PURE__ */ (0,
|
|
6849
|
-
/* @__PURE__ */ (0,
|
|
6850
|
-
showTitle && /* @__PURE__ */ (0,
|
|
6851
|
-
showDescription && /* @__PURE__ */ (0,
|
|
7023
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
7024
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonCircle, { width: 40, height: 40 }),
|
|
7025
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
7026
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonText, { width: "60%", height: 20 }),
|
|
7027
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonText, { lines, spacing: "small" })
|
|
6852
7028
|
] })
|
|
6853
7029
|
] }),
|
|
6854
|
-
showActions && /* @__PURE__ */ (0,
|
|
6855
|
-
/* @__PURE__ */ (0,
|
|
6856
|
-
/* @__PURE__ */ (0,
|
|
7030
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex justify-end space-x-2 mt-4", children: [
|
|
7031
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonRectangle, { width: 80, height: 32 }),
|
|
7032
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonRectangle, { width: 80, height: 32 })
|
|
6857
7033
|
] })
|
|
6858
7034
|
]
|
|
6859
7035
|
}
|
|
6860
7036
|
);
|
|
6861
7037
|
}
|
|
6862
7038
|
);
|
|
6863
|
-
var SkeletonList = (0,
|
|
7039
|
+
var SkeletonList = (0, import_react24.forwardRef)(
|
|
6864
7040
|
({
|
|
6865
7041
|
items = 3,
|
|
6866
7042
|
showAvatar = true,
|
|
@@ -6870,19 +7046,19 @@ var SkeletonList = (0, import_react23.forwardRef)(
|
|
|
6870
7046
|
className = "",
|
|
6871
7047
|
...props
|
|
6872
7048
|
}, ref) => {
|
|
6873
|
-
return /* @__PURE__ */ (0,
|
|
6874
|
-
showAvatar && /* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6876
|
-
showTitle && /* @__PURE__ */ (0,
|
|
6877
|
-
showDescription && /* @__PURE__ */ (0,
|
|
7049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start space-x-3 p-3", children: [
|
|
7050
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonCircle, { width: 32, height: 32 }),
|
|
7051
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
7052
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonText, { width: "40%", height: 16 }),
|
|
7053
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SkeletonText, { lines, spacing: "small" })
|
|
6878
7054
|
] })
|
|
6879
7055
|
] }, index)) });
|
|
6880
7056
|
}
|
|
6881
7057
|
);
|
|
6882
|
-
var SkeletonTable = (0,
|
|
7058
|
+
var SkeletonTable = (0, import_react24.forwardRef)(
|
|
6883
7059
|
({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
|
|
6884
|
-
return /* @__PURE__ */ (0,
|
|
6885
|
-
showHeader && /* @__PURE__ */ (0,
|
|
7060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
7061
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6886
7062
|
SkeletonText,
|
|
6887
7063
|
{
|
|
6888
7064
|
width: `${100 / columns}%`,
|
|
@@ -6890,7 +7066,7 @@ var SkeletonTable = (0, import_react23.forwardRef)(
|
|
|
6890
7066
|
},
|
|
6891
7067
|
index
|
|
6892
7068
|
)) }),
|
|
6893
|
-
/* @__PURE__ */ (0,
|
|
7069
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6894
7070
|
SkeletonText,
|
|
6895
7071
|
{
|
|
6896
7072
|
width: `${100 / columns}%`,
|
|
@@ -6903,7 +7079,7 @@ var SkeletonTable = (0, import_react23.forwardRef)(
|
|
|
6903
7079
|
);
|
|
6904
7080
|
|
|
6905
7081
|
// src/components/NotFound/NotFound.tsx
|
|
6906
|
-
var
|
|
7082
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6907
7083
|
var NotFound = ({
|
|
6908
7084
|
title,
|
|
6909
7085
|
description,
|
|
@@ -6946,22 +7122,22 @@ var NotFound = ({
|
|
|
6946
7122
|
const errorTitle = title || getDefaultTitle();
|
|
6947
7123
|
const errorDescription = description || getDefaultDescription();
|
|
6948
7124
|
const errorCode = getErrorCode();
|
|
6949
|
-
return /* @__PURE__ */ (0,
|
|
7125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6950
7126
|
"div",
|
|
6951
7127
|
{
|
|
6952
7128
|
className: cn(
|
|
6953
7129
|
"flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4",
|
|
6954
7130
|
className
|
|
6955
7131
|
),
|
|
6956
|
-
children: /* @__PURE__ */ (0,
|
|
7132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6957
7133
|
"main",
|
|
6958
7134
|
{
|
|
6959
7135
|
role: "main",
|
|
6960
7136
|
"aria-labelledby": "error-title",
|
|
6961
7137
|
"aria-describedby": "error-description",
|
|
6962
7138
|
className: "flex flex-col items-center text-center max-w-md space-y-6",
|
|
6963
|
-
children: /* @__PURE__ */ (0,
|
|
6964
|
-
/* @__PURE__ */ (0,
|
|
7139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { "aria-label": `Erro ${errorCode}`, children: [
|
|
7140
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6965
7141
|
"div",
|
|
6966
7142
|
{
|
|
6967
7143
|
className: "text-8xl font-bold text-primary-300 select-none",
|
|
@@ -6969,8 +7145,8 @@ var NotFound = ({
|
|
|
6969
7145
|
children: errorCode
|
|
6970
7146
|
}
|
|
6971
7147
|
),
|
|
6972
|
-
/* @__PURE__ */ (0,
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
7148
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("header", { className: "space-y-2", children: [
|
|
7149
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6974
7150
|
Text_default,
|
|
6975
7151
|
{
|
|
6976
7152
|
size: "xl",
|
|
@@ -6981,9 +7157,9 @@ var NotFound = ({
|
|
|
6981
7157
|
children: errorTitle
|
|
6982
7158
|
}
|
|
6983
7159
|
),
|
|
6984
|
-
/* @__PURE__ */ (0,
|
|
7160
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text_default, { size: "md", className: "text-text-600", id: "error-description", children: errorDescription })
|
|
6985
7161
|
] }),
|
|
6986
|
-
onButtonClick && /* @__PURE__ */ (0,
|
|
7162
|
+
onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("nav", { "aria-label": "Navega\xE7\xE3o de erro", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6987
7163
|
Button_default,
|
|
6988
7164
|
{
|
|
6989
7165
|
onClick: handleButtonClick,
|
|
@@ -7004,9 +7180,10 @@ var NotFound = ({
|
|
|
7004
7180
|
var NotFound_default = NotFound;
|
|
7005
7181
|
|
|
7006
7182
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
7007
|
-
var
|
|
7183
|
+
var import_react25 = require("react");
|
|
7184
|
+
var import_react_dom = require("react-dom");
|
|
7008
7185
|
var import_phosphor_react18 = require("phosphor-react");
|
|
7009
|
-
var
|
|
7186
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
7010
7187
|
var CONTROLS_HIDE_TIMEOUT = 3e3;
|
|
7011
7188
|
var LEAVE_HIDE_TIMEOUT = 1e3;
|
|
7012
7189
|
var INIT_DELAY = 100;
|
|
@@ -7021,7 +7198,7 @@ var ProgressBar2 = ({
|
|
|
7021
7198
|
duration,
|
|
7022
7199
|
progressPercentage,
|
|
7023
7200
|
onSeek
|
|
7024
|
-
}) => /* @__PURE__ */ (0,
|
|
7201
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "px-4 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7025
7202
|
"input",
|
|
7026
7203
|
{
|
|
7027
7204
|
type: "range",
|
|
@@ -7041,17 +7218,17 @@ var VolumeControls = ({
|
|
|
7041
7218
|
isMuted,
|
|
7042
7219
|
onVolumeChange,
|
|
7043
7220
|
onToggleMute
|
|
7044
|
-
}) => /* @__PURE__ */ (0,
|
|
7045
|
-
/* @__PURE__ */ (0,
|
|
7221
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7222
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7046
7223
|
IconButton_default,
|
|
7047
7224
|
{
|
|
7048
|
-
icon: isMuted ? /* @__PURE__ */ (0,
|
|
7225
|
+
icon: isMuted ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.SpeakerSlash, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.SpeakerHigh, { size: 24 }),
|
|
7049
7226
|
onClick: onToggleMute,
|
|
7050
7227
|
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
7051
7228
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7052
7229
|
}
|
|
7053
7230
|
),
|
|
7054
|
-
/* @__PURE__ */ (0,
|
|
7231
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7055
7232
|
"input",
|
|
7056
7233
|
{
|
|
7057
7234
|
type: "range",
|
|
@@ -7071,30 +7248,63 @@ var SpeedMenu = ({
|
|
|
7071
7248
|
showSpeedMenu,
|
|
7072
7249
|
playbackRate,
|
|
7073
7250
|
onToggleMenu,
|
|
7074
|
-
onSpeedChange
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7251
|
+
onSpeedChange,
|
|
7252
|
+
isFullscreen
|
|
7253
|
+
}) => {
|
|
7254
|
+
const buttonRef = (0, import_react25.useRef)(null);
|
|
7255
|
+
const getMenuPosition = () => {
|
|
7256
|
+
if (!buttonRef.current) return { top: 0, left: 0 };
|
|
7257
|
+
const rect = buttonRef.current.getBoundingClientRect();
|
|
7258
|
+
return {
|
|
7259
|
+
// Fixed coords are viewport-based — no scroll offsets.
|
|
7260
|
+
top: Math.max(8, rect.top - 180),
|
|
7261
|
+
left: Math.max(8, rect.right - 80)
|
|
7262
|
+
};
|
|
7263
|
+
};
|
|
7264
|
+
const position = getMenuPosition();
|
|
7265
|
+
const menuContent = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7266
|
+
"div",
|
|
7078
7267
|
{
|
|
7079
|
-
|
|
7080
|
-
onClick: onToggleMenu,
|
|
7268
|
+
role: "menu",
|
|
7081
7269
|
"aria-label": "Playback speed",
|
|
7082
|
-
className: "
|
|
7270
|
+
className: isFullscreen ? "absolute bottom-12 right-0 bg-black/90 rounded-lg p-2 min-w-20 z-[9999]" : "fixed bg-black/90 rounded-lg p-2 min-w-20 z-[9999]",
|
|
7271
|
+
style: !isFullscreen ? {
|
|
7272
|
+
top: `${position.top}px`,
|
|
7273
|
+
left: `${position.left}px`
|
|
7274
|
+
} : void 0,
|
|
7275
|
+
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
7276
|
+
"button",
|
|
7277
|
+
{
|
|
7278
|
+
role: "menuitemradio",
|
|
7279
|
+
"aria-checked": playbackRate === speed,
|
|
7280
|
+
onClick: () => onSpeedChange(speed),
|
|
7281
|
+
className: `block w-full text-left px-3 py-1 text-sm rounded hover:bg-white/20 transition-colors ${playbackRate === speed ? "text-primary-400" : "text-white"}`,
|
|
7282
|
+
children: [
|
|
7283
|
+
speed,
|
|
7284
|
+
"x"
|
|
7285
|
+
]
|
|
7286
|
+
},
|
|
7287
|
+
speed
|
|
7288
|
+
))
|
|
7083
7289
|
}
|
|
7084
|
-
)
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7290
|
+
);
|
|
7291
|
+
const portalContent = typeof window !== "undefined" && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(menuContent, document.body) : null;
|
|
7292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", children: [
|
|
7293
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7294
|
+
IconButton_default,
|
|
7295
|
+
{
|
|
7296
|
+
ref: buttonRef,
|
|
7297
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.DotsThreeVertical, { size: 24 }),
|
|
7298
|
+
onClick: onToggleMenu,
|
|
7299
|
+
"aria-label": "Playback speed",
|
|
7300
|
+
"aria-haspopup": "menu",
|
|
7301
|
+
"aria-expanded": showSpeedMenu,
|
|
7302
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7303
|
+
}
|
|
7304
|
+
),
|
|
7305
|
+
showSpeedMenu && (isFullscreen ? menuContent : portalContent)
|
|
7306
|
+
] });
|
|
7307
|
+
};
|
|
7098
7308
|
var VideoPlayer = ({
|
|
7099
7309
|
src,
|
|
7100
7310
|
poster,
|
|
@@ -7109,26 +7319,26 @@ var VideoPlayer = ({
|
|
|
7109
7319
|
autoSave = true,
|
|
7110
7320
|
storageKey = "video-progress"
|
|
7111
7321
|
}) => {
|
|
7112
|
-
const videoRef = (0,
|
|
7113
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
7114
|
-
const [currentTime, setCurrentTime] = (0,
|
|
7115
|
-
const [duration, setDuration] = (0,
|
|
7116
|
-
const [isMuted, setIsMuted] = (0,
|
|
7117
|
-
const [volume, setVolume] = (0,
|
|
7118
|
-
const [isFullscreen, setIsFullscreen] = (0,
|
|
7119
|
-
const [showControls, setShowControls] = (0,
|
|
7120
|
-
const [hasCompleted, setHasCompleted] = (0,
|
|
7121
|
-
const [showCaptions, setShowCaptions] = (0,
|
|
7122
|
-
(0,
|
|
7322
|
+
const videoRef = (0, import_react25.useRef)(null);
|
|
7323
|
+
const [isPlaying, setIsPlaying] = (0, import_react25.useState)(false);
|
|
7324
|
+
const [currentTime, setCurrentTime] = (0, import_react25.useState)(0);
|
|
7325
|
+
const [duration, setDuration] = (0, import_react25.useState)(0);
|
|
7326
|
+
const [isMuted, setIsMuted] = (0, import_react25.useState)(false);
|
|
7327
|
+
const [volume, setVolume] = (0, import_react25.useState)(1);
|
|
7328
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react25.useState)(false);
|
|
7329
|
+
const [showControls, setShowControls] = (0, import_react25.useState)(true);
|
|
7330
|
+
const [hasCompleted, setHasCompleted] = (0, import_react25.useState)(false);
|
|
7331
|
+
const [showCaptions, setShowCaptions] = (0, import_react25.useState)(false);
|
|
7332
|
+
(0, import_react25.useEffect)(() => {
|
|
7123
7333
|
setHasCompleted(false);
|
|
7124
7334
|
}, [src]);
|
|
7125
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
7126
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
7127
|
-
const lastSaveTimeRef = (0,
|
|
7128
|
-
const trackRef = (0,
|
|
7129
|
-
const controlsTimeoutRef = (0,
|
|
7130
|
-
const lastMousePositionRef = (0,
|
|
7131
|
-
const isUserInteracting = (0,
|
|
7335
|
+
const [playbackRate, setPlaybackRate] = (0, import_react25.useState)(1);
|
|
7336
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react25.useState)(false);
|
|
7337
|
+
const lastSaveTimeRef = (0, import_react25.useRef)(0);
|
|
7338
|
+
const trackRef = (0, import_react25.useRef)(null);
|
|
7339
|
+
const controlsTimeoutRef = (0, import_react25.useRef)(null);
|
|
7340
|
+
const lastMousePositionRef = (0, import_react25.useRef)({ x: 0, y: 0 });
|
|
7341
|
+
const isUserInteracting = (0, import_react25.useCallback)(() => {
|
|
7132
7342
|
if (showSpeedMenu) {
|
|
7133
7343
|
return true;
|
|
7134
7344
|
}
|
|
@@ -7145,13 +7355,13 @@ var VideoPlayer = ({
|
|
|
7145
7355
|
}
|
|
7146
7356
|
return false;
|
|
7147
7357
|
}, [showSpeedMenu]);
|
|
7148
|
-
const clearControlsTimeout = (0,
|
|
7358
|
+
const clearControlsTimeout = (0, import_react25.useCallback)(() => {
|
|
7149
7359
|
if (controlsTimeoutRef.current) {
|
|
7150
7360
|
clearTimeout(controlsTimeoutRef.current);
|
|
7151
7361
|
controlsTimeoutRef.current = null;
|
|
7152
7362
|
}
|
|
7153
7363
|
}, []);
|
|
7154
|
-
const showControlsWithTimer = (0,
|
|
7364
|
+
const showControlsWithTimer = (0, import_react25.useCallback)(() => {
|
|
7155
7365
|
setShowControls(true);
|
|
7156
7366
|
clearControlsTimeout();
|
|
7157
7367
|
if (isFullscreen) {
|
|
@@ -7166,7 +7376,7 @@ var VideoPlayer = ({
|
|
|
7166
7376
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
7167
7377
|
}
|
|
7168
7378
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
7169
|
-
const handleMouseMove = (0,
|
|
7379
|
+
const handleMouseMove = (0, import_react25.useCallback)(
|
|
7170
7380
|
(event) => {
|
|
7171
7381
|
const currentX = event.clientX;
|
|
7172
7382
|
const currentY = event.clientY;
|
|
@@ -7179,10 +7389,10 @@ var VideoPlayer = ({
|
|
|
7179
7389
|
},
|
|
7180
7390
|
[showControlsWithTimer]
|
|
7181
7391
|
);
|
|
7182
|
-
const handleMouseEnter = (0,
|
|
7392
|
+
const handleMouseEnter = (0, import_react25.useCallback)(() => {
|
|
7183
7393
|
showControlsWithTimer();
|
|
7184
7394
|
}, [showControlsWithTimer]);
|
|
7185
|
-
const handleMouseLeave = (0,
|
|
7395
|
+
const handleMouseLeave = (0, import_react25.useCallback)(() => {
|
|
7186
7396
|
const userInteracting = isUserInteracting();
|
|
7187
7397
|
clearControlsTimeout();
|
|
7188
7398
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -7191,13 +7401,13 @@ var VideoPlayer = ({
|
|
|
7191
7401
|
}, LEAVE_HIDE_TIMEOUT);
|
|
7192
7402
|
}
|
|
7193
7403
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
7194
|
-
(0,
|
|
7404
|
+
(0, import_react25.useEffect)(() => {
|
|
7195
7405
|
if (videoRef.current) {
|
|
7196
7406
|
videoRef.current.volume = volume;
|
|
7197
7407
|
videoRef.current.muted = isMuted;
|
|
7198
7408
|
}
|
|
7199
7409
|
}, [volume, isMuted]);
|
|
7200
|
-
(0,
|
|
7410
|
+
(0, import_react25.useEffect)(() => {
|
|
7201
7411
|
const video = videoRef.current;
|
|
7202
7412
|
if (!video) return;
|
|
7203
7413
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -7212,7 +7422,7 @@ var VideoPlayer = ({
|
|
|
7212
7422
|
video.removeEventListener("ended", onEnded);
|
|
7213
7423
|
};
|
|
7214
7424
|
}, []);
|
|
7215
|
-
(0,
|
|
7425
|
+
(0, import_react25.useEffect)(() => {
|
|
7216
7426
|
if (isPlaying) {
|
|
7217
7427
|
showControlsWithTimer();
|
|
7218
7428
|
} else {
|
|
@@ -7224,7 +7434,7 @@ var VideoPlayer = ({
|
|
|
7224
7434
|
}
|
|
7225
7435
|
}
|
|
7226
7436
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
7227
|
-
(0,
|
|
7437
|
+
(0, import_react25.useEffect)(() => {
|
|
7228
7438
|
const handleFullscreenChange = () => {
|
|
7229
7439
|
const isCurrentlyFullscreen = !!document.fullscreenElement;
|
|
7230
7440
|
setIsFullscreen(isCurrentlyFullscreen);
|
|
@@ -7237,7 +7447,7 @@ var VideoPlayer = ({
|
|
|
7237
7447
|
document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
7238
7448
|
};
|
|
7239
7449
|
}, [showControlsWithTimer]);
|
|
7240
|
-
(0,
|
|
7450
|
+
(0, import_react25.useEffect)(() => {
|
|
7241
7451
|
const init = () => {
|
|
7242
7452
|
if (!isFullscreen) {
|
|
7243
7453
|
showControlsWithTimer();
|
|
@@ -7259,7 +7469,7 @@ var VideoPlayer = ({
|
|
|
7259
7469
|
};
|
|
7260
7470
|
}
|
|
7261
7471
|
}, []);
|
|
7262
|
-
const getInitialTime = (0,
|
|
7472
|
+
const getInitialTime = (0, import_react25.useCallback)(() => {
|
|
7263
7473
|
if (!autoSave || !storageKey) {
|
|
7264
7474
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
7265
7475
|
}
|
|
@@ -7270,14 +7480,14 @@ var VideoPlayer = ({
|
|
|
7270
7480
|
if (hasValidSaved) return saved;
|
|
7271
7481
|
return void 0;
|
|
7272
7482
|
}, [autoSave, storageKey, src, initialTime]);
|
|
7273
|
-
(0,
|
|
7483
|
+
(0, import_react25.useEffect)(() => {
|
|
7274
7484
|
const start = getInitialTime();
|
|
7275
7485
|
if (start !== void 0 && videoRef.current) {
|
|
7276
7486
|
videoRef.current.currentTime = start;
|
|
7277
7487
|
setCurrentTime(start);
|
|
7278
7488
|
}
|
|
7279
7489
|
}, [getInitialTime]);
|
|
7280
|
-
const saveProgress = (0,
|
|
7490
|
+
const saveProgress = (0, import_react25.useCallback)(
|
|
7281
7491
|
(time) => {
|
|
7282
7492
|
if (!autoSave || !storageKey) return;
|
|
7283
7493
|
const now = Date.now();
|
|
@@ -7288,7 +7498,7 @@ var VideoPlayer = ({
|
|
|
7288
7498
|
},
|
|
7289
7499
|
[autoSave, storageKey, src]
|
|
7290
7500
|
);
|
|
7291
|
-
const togglePlayPause = (0,
|
|
7501
|
+
const togglePlayPause = (0, import_react25.useCallback)(async () => {
|
|
7292
7502
|
const video = videoRef.current;
|
|
7293
7503
|
if (!video) return;
|
|
7294
7504
|
if (!video.paused) {
|
|
@@ -7300,7 +7510,7 @@ var VideoPlayer = ({
|
|
|
7300
7510
|
} catch {
|
|
7301
7511
|
}
|
|
7302
7512
|
}, []);
|
|
7303
|
-
const handleVolumeChange = (0,
|
|
7513
|
+
const handleVolumeChange = (0, import_react25.useCallback)(
|
|
7304
7514
|
(newVolume) => {
|
|
7305
7515
|
const video = videoRef.current;
|
|
7306
7516
|
if (!video) return;
|
|
@@ -7319,7 +7529,7 @@ var VideoPlayer = ({
|
|
|
7319
7529
|
},
|
|
7320
7530
|
[isMuted]
|
|
7321
7531
|
);
|
|
7322
|
-
const toggleMute = (0,
|
|
7532
|
+
const toggleMute = (0, import_react25.useCallback)(() => {
|
|
7323
7533
|
const video = videoRef.current;
|
|
7324
7534
|
if (!video) return;
|
|
7325
7535
|
if (isMuted) {
|
|
@@ -7333,13 +7543,13 @@ var VideoPlayer = ({
|
|
|
7333
7543
|
setIsMuted(true);
|
|
7334
7544
|
}
|
|
7335
7545
|
}, [isMuted, volume]);
|
|
7336
|
-
const handleSeek = (0,
|
|
7546
|
+
const handleSeek = (0, import_react25.useCallback)((newTime) => {
|
|
7337
7547
|
const video = videoRef.current;
|
|
7338
7548
|
if (video) {
|
|
7339
7549
|
video.currentTime = newTime;
|
|
7340
7550
|
}
|
|
7341
7551
|
}, []);
|
|
7342
|
-
const toggleFullscreen = (0,
|
|
7552
|
+
const toggleFullscreen = (0, import_react25.useCallback)(() => {
|
|
7343
7553
|
const container = videoRef.current?.parentElement;
|
|
7344
7554
|
if (!container) return;
|
|
7345
7555
|
if (!isFullscreen && container.requestFullscreen) {
|
|
@@ -7348,23 +7558,23 @@ var VideoPlayer = ({
|
|
|
7348
7558
|
document.exitFullscreen();
|
|
7349
7559
|
}
|
|
7350
7560
|
}, [isFullscreen]);
|
|
7351
|
-
const handleSpeedChange = (0,
|
|
7561
|
+
const handleSpeedChange = (0, import_react25.useCallback)((speed) => {
|
|
7352
7562
|
if (videoRef.current) {
|
|
7353
7563
|
videoRef.current.playbackRate = speed;
|
|
7354
7564
|
setPlaybackRate(speed);
|
|
7355
7565
|
setShowSpeedMenu(false);
|
|
7356
7566
|
}
|
|
7357
7567
|
}, []);
|
|
7358
|
-
const toggleSpeedMenu = (0,
|
|
7568
|
+
const toggleSpeedMenu = (0, import_react25.useCallback)(() => {
|
|
7359
7569
|
setShowSpeedMenu(!showSpeedMenu);
|
|
7360
7570
|
}, [showSpeedMenu]);
|
|
7361
|
-
const toggleCaptions = (0,
|
|
7571
|
+
const toggleCaptions = (0, import_react25.useCallback)(() => {
|
|
7362
7572
|
if (!trackRef.current?.track || !subtitles) return;
|
|
7363
7573
|
const newShowCaptions = !showCaptions;
|
|
7364
7574
|
setShowCaptions(newShowCaptions);
|
|
7365
7575
|
trackRef.current.track.mode = newShowCaptions && subtitles ? "showing" : "hidden";
|
|
7366
7576
|
}, [showCaptions, subtitles]);
|
|
7367
|
-
const checkVideoCompletion = (0,
|
|
7577
|
+
const checkVideoCompletion = (0, import_react25.useCallback)(
|
|
7368
7578
|
(progressPercent) => {
|
|
7369
7579
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
7370
7580
|
setHasCompleted(true);
|
|
@@ -7373,7 +7583,7 @@ var VideoPlayer = ({
|
|
|
7373
7583
|
},
|
|
7374
7584
|
[hasCompleted, onVideoComplete]
|
|
7375
7585
|
);
|
|
7376
|
-
const handleTimeUpdate = (0,
|
|
7586
|
+
const handleTimeUpdate = (0, import_react25.useCallback)(() => {
|
|
7377
7587
|
const video = videoRef.current;
|
|
7378
7588
|
if (!video) return;
|
|
7379
7589
|
const current = video.currentTime;
|
|
@@ -7386,17 +7596,17 @@ var VideoPlayer = ({
|
|
|
7386
7596
|
checkVideoCompletion(progressPercent);
|
|
7387
7597
|
}
|
|
7388
7598
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
7389
|
-
const handleLoadedMetadata = (0,
|
|
7599
|
+
const handleLoadedMetadata = (0, import_react25.useCallback)(() => {
|
|
7390
7600
|
if (videoRef.current) {
|
|
7391
7601
|
setDuration(videoRef.current.duration);
|
|
7392
7602
|
}
|
|
7393
7603
|
}, []);
|
|
7394
|
-
(0,
|
|
7604
|
+
(0, import_react25.useEffect)(() => {
|
|
7395
7605
|
if (trackRef.current?.track) {
|
|
7396
7606
|
trackRef.current.track.mode = showCaptions && subtitles ? "showing" : "hidden";
|
|
7397
7607
|
}
|
|
7398
7608
|
}, [subtitles, showCaptions]);
|
|
7399
|
-
(0,
|
|
7609
|
+
(0, import_react25.useEffect)(() => {
|
|
7400
7610
|
const handleVisibilityChange = () => {
|
|
7401
7611
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
7402
7612
|
videoRef.current.pause();
|
|
@@ -7418,13 +7628,13 @@ var VideoPlayer = ({
|
|
|
7418
7628
|
};
|
|
7419
7629
|
}, [isPlaying, clearControlsTimeout]);
|
|
7420
7630
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
7421
|
-
const getTopControlsOpacity = (0,
|
|
7631
|
+
const getTopControlsOpacity = (0, import_react25.useCallback)(() => {
|
|
7422
7632
|
return showControls ? "opacity-100" : "opacity-0";
|
|
7423
7633
|
}, [showControls]);
|
|
7424
|
-
const getBottomControlsOpacity = (0,
|
|
7634
|
+
const getBottomControlsOpacity = (0, import_react25.useCallback)(() => {
|
|
7425
7635
|
return showControls ? "opacity-100" : "opacity-0";
|
|
7426
7636
|
}, [showControls]);
|
|
7427
|
-
const handleVideoKeyDown = (0,
|
|
7637
|
+
const handleVideoKeyDown = (0, import_react25.useCallback)(
|
|
7428
7638
|
(e) => {
|
|
7429
7639
|
if (e.key) {
|
|
7430
7640
|
e.stopPropagation();
|
|
@@ -7479,9 +7689,9 @@ var VideoPlayer = ({
|
|
|
7479
7689
|
toggleFullscreen
|
|
7480
7690
|
]
|
|
7481
7691
|
);
|
|
7482
|
-
return /* @__PURE__ */ (0,
|
|
7483
|
-
(title || subtitleText) && /* @__PURE__ */ (0,
|
|
7484
|
-
title && /* @__PURE__ */ (0,
|
|
7692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex flex-col", className), children: [
|
|
7693
|
+
(title || subtitleText) && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "bg-subject-1 px-8 py-4 flex items-end justify-between min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
7694
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7485
7695
|
Text_default,
|
|
7486
7696
|
{
|
|
7487
7697
|
as: "h2",
|
|
@@ -7492,7 +7702,7 @@ var VideoPlayer = ({
|
|
|
7492
7702
|
children: title
|
|
7493
7703
|
}
|
|
7494
7704
|
),
|
|
7495
|
-
subtitleText && /* @__PURE__ */ (0,
|
|
7705
|
+
subtitleText && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7496
7706
|
Text_default,
|
|
7497
7707
|
{
|
|
7498
7708
|
as: "p",
|
|
@@ -7504,7 +7714,7 @@ var VideoPlayer = ({
|
|
|
7504
7714
|
}
|
|
7505
7715
|
)
|
|
7506
7716
|
] }) }),
|
|
7507
|
-
/* @__PURE__ */ (0,
|
|
7717
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
7508
7718
|
"section",
|
|
7509
7719
|
{
|
|
7510
7720
|
className: cn(
|
|
@@ -7519,7 +7729,7 @@ var VideoPlayer = ({
|
|
|
7519
7729
|
onTouchStart: handleMouseEnter,
|
|
7520
7730
|
onMouseLeave: handleMouseLeave,
|
|
7521
7731
|
children: [
|
|
7522
|
-
/* @__PURE__ */ (0,
|
|
7732
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7523
7733
|
"video",
|
|
7524
7734
|
{
|
|
7525
7735
|
ref: videoRef,
|
|
@@ -7533,7 +7743,7 @@ var VideoPlayer = ({
|
|
|
7533
7743
|
onKeyDown: handleVideoKeyDown,
|
|
7534
7744
|
tabIndex: 0,
|
|
7535
7745
|
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
7536
|
-
children: /* @__PURE__ */ (0,
|
|
7746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7537
7747
|
"track",
|
|
7538
7748
|
{
|
|
7539
7749
|
ref: trackRef,
|
|
@@ -7546,26 +7756,26 @@ var VideoPlayer = ({
|
|
|
7546
7756
|
)
|
|
7547
7757
|
}
|
|
7548
7758
|
),
|
|
7549
|
-
!isPlaying && /* @__PURE__ */ (0,
|
|
7759
|
+
!isPlaying && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7550
7760
|
IconButton_default,
|
|
7551
7761
|
{
|
|
7552
|
-
icon: /* @__PURE__ */ (0,
|
|
7762
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.Play, { size: 32, weight: "regular", className: "ml-1" }),
|
|
7553
7763
|
onClick: togglePlayPause,
|
|
7554
7764
|
"aria-label": "Play video",
|
|
7555
7765
|
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
7556
7766
|
}
|
|
7557
7767
|
) }),
|
|
7558
|
-
/* @__PURE__ */ (0,
|
|
7768
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7559
7769
|
"div",
|
|
7560
7770
|
{
|
|
7561
7771
|
className: cn(
|
|
7562
7772
|
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
7563
7773
|
getTopControlsOpacity()
|
|
7564
7774
|
),
|
|
7565
|
-
children: /* @__PURE__ */ (0,
|
|
7775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7566
7776
|
IconButton_default,
|
|
7567
7777
|
{
|
|
7568
|
-
icon: isFullscreen ? /* @__PURE__ */ (0,
|
|
7778
|
+
icon: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.ArrowsOutSimple, { size: 24 }),
|
|
7569
7779
|
onClick: toggleFullscreen,
|
|
7570
7780
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
7571
7781
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
@@ -7573,7 +7783,7 @@ var VideoPlayer = ({
|
|
|
7573
7783
|
) })
|
|
7574
7784
|
}
|
|
7575
7785
|
),
|
|
7576
|
-
/* @__PURE__ */ (0,
|
|
7786
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
7577
7787
|
"div",
|
|
7578
7788
|
{
|
|
7579
7789
|
className: cn(
|
|
@@ -7581,7 +7791,7 @@ var VideoPlayer = ({
|
|
|
7581
7791
|
getBottomControlsOpacity()
|
|
7582
7792
|
),
|
|
7583
7793
|
children: [
|
|
7584
|
-
/* @__PURE__ */ (0,
|
|
7794
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7585
7795
|
ProgressBar2,
|
|
7586
7796
|
{
|
|
7587
7797
|
currentTime,
|
|
@@ -7590,18 +7800,18 @@ var VideoPlayer = ({
|
|
|
7590
7800
|
onSeek: handleSeek
|
|
7591
7801
|
}
|
|
7592
7802
|
),
|
|
7593
|
-
/* @__PURE__ */ (0,
|
|
7594
|
-
/* @__PURE__ */ (0,
|
|
7595
|
-
/* @__PURE__ */ (0,
|
|
7803
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between px-4 pb-4", children: [
|
|
7804
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
7805
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7596
7806
|
IconButton_default,
|
|
7597
7807
|
{
|
|
7598
|
-
icon: isPlaying ? /* @__PURE__ */ (0,
|
|
7808
|
+
icon: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.Pause, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.Play, { size: 24 }),
|
|
7599
7809
|
onClick: togglePlayPause,
|
|
7600
7810
|
"aria-label": isPlaying ? "Pause" : "Play",
|
|
7601
7811
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7602
7812
|
}
|
|
7603
7813
|
),
|
|
7604
|
-
/* @__PURE__ */ (0,
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7605
7815
|
VolumeControls,
|
|
7606
7816
|
{
|
|
7607
7817
|
volume,
|
|
@@ -7610,10 +7820,10 @@ var VideoPlayer = ({
|
|
|
7610
7820
|
onToggleMute: toggleMute
|
|
7611
7821
|
}
|
|
7612
7822
|
),
|
|
7613
|
-
subtitles && /* @__PURE__ */ (0,
|
|
7823
|
+
subtitles && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7614
7824
|
IconButton_default,
|
|
7615
7825
|
{
|
|
7616
|
-
icon: /* @__PURE__ */ (0,
|
|
7826
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.ClosedCaptioning, { size: 24 }),
|
|
7617
7827
|
onClick: toggleCaptions,
|
|
7618
7828
|
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
7619
7829
|
className: cn(
|
|
@@ -7622,19 +7832,20 @@ var VideoPlayer = ({
|
|
|
7622
7832
|
)
|
|
7623
7833
|
}
|
|
7624
7834
|
),
|
|
7625
|
-
/* @__PURE__ */ (0,
|
|
7835
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
7626
7836
|
formatTime(currentTime),
|
|
7627
7837
|
" / ",
|
|
7628
7838
|
formatTime(duration)
|
|
7629
7839
|
] })
|
|
7630
7840
|
] }),
|
|
7631
|
-
/* @__PURE__ */ (0,
|
|
7841
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7632
7842
|
SpeedMenu,
|
|
7633
7843
|
{
|
|
7634
7844
|
showSpeedMenu,
|
|
7635
7845
|
playbackRate,
|
|
7636
7846
|
onToggleMenu: toggleSpeedMenu,
|
|
7637
|
-
onSpeedChange: handleSpeedChange
|
|
7847
|
+
onSpeedChange: handleSpeedChange,
|
|
7848
|
+
isFullscreen
|
|
7638
7849
|
}
|
|
7639
7850
|
) })
|
|
7640
7851
|
] })
|
|
@@ -7649,9 +7860,9 @@ var VideoPlayer = ({
|
|
|
7649
7860
|
var VideoPlayer_default = VideoPlayer;
|
|
7650
7861
|
|
|
7651
7862
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
7652
|
-
var
|
|
7863
|
+
var import_react26 = require("react");
|
|
7653
7864
|
var import_phosphor_react19 = require("phosphor-react");
|
|
7654
|
-
var
|
|
7865
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
7655
7866
|
var IMAGE_WIDTH = 225;
|
|
7656
7867
|
var IMAGE_HEIGHT = 90;
|
|
7657
7868
|
var Whiteboard = ({
|
|
@@ -7662,8 +7873,8 @@ var Whiteboard = ({
|
|
|
7662
7873
|
imagesPerRow = 2,
|
|
7663
7874
|
...rest
|
|
7664
7875
|
}) => {
|
|
7665
|
-
const [imageErrors, setImageErrors] = (0,
|
|
7666
|
-
const handleDownload = (0,
|
|
7876
|
+
const [imageErrors, setImageErrors] = (0, import_react26.useState)(/* @__PURE__ */ new Set());
|
|
7877
|
+
const handleDownload = (0, import_react26.useCallback)(
|
|
7667
7878
|
(image) => {
|
|
7668
7879
|
if (onDownload) {
|
|
7669
7880
|
onDownload(image);
|
|
@@ -7680,7 +7891,7 @@ var Whiteboard = ({
|
|
|
7680
7891
|
},
|
|
7681
7892
|
[onDownload]
|
|
7682
7893
|
);
|
|
7683
|
-
const handleImageError = (0,
|
|
7894
|
+
const handleImageError = (0, import_react26.useCallback)((imageId) => {
|
|
7684
7895
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
7685
7896
|
}, []);
|
|
7686
7897
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -7689,7 +7900,7 @@ var Whiteboard = ({
|
|
|
7689
7900
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
7690
7901
|
}[imagesPerRow];
|
|
7691
7902
|
if (!images || images.length === 0) {
|
|
7692
|
-
return /* @__PURE__ */ (0,
|
|
7903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7693
7904
|
"div",
|
|
7694
7905
|
{
|
|
7695
7906
|
className: cn(
|
|
@@ -7697,11 +7908,11 @@ var Whiteboard = ({
|
|
|
7697
7908
|
className
|
|
7698
7909
|
),
|
|
7699
7910
|
...rest,
|
|
7700
|
-
children: /* @__PURE__ */ (0,
|
|
7911
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-gray-400 text-sm", children: "Nenhuma imagem dispon\xEDvel" })
|
|
7701
7912
|
}
|
|
7702
7913
|
);
|
|
7703
7914
|
}
|
|
7704
|
-
return /* @__PURE__ */ (0,
|
|
7915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7705
7916
|
"div",
|
|
7706
7917
|
{
|
|
7707
7918
|
className: cn(
|
|
@@ -7709,7 +7920,7 @@ var Whiteboard = ({
|
|
|
7709
7920
|
className
|
|
7710
7921
|
),
|
|
7711
7922
|
...rest,
|
|
7712
|
-
children: /* @__PURE__ */ (0,
|
|
7923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("grid gap-4", gridColsClass), children: images.map((image) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7713
7924
|
"div",
|
|
7714
7925
|
{
|
|
7715
7926
|
className: "relative group overflow-hidden bg-gray-100 rounded-lg",
|
|
@@ -7717,7 +7928,7 @@ var Whiteboard = ({
|
|
|
7717
7928
|
width: `${IMAGE_WIDTH}px`
|
|
7718
7929
|
},
|
|
7719
7930
|
children: [
|
|
7720
|
-
/* @__PURE__ */ (0,
|
|
7931
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7721
7932
|
"div",
|
|
7722
7933
|
{
|
|
7723
7934
|
className: "relative",
|
|
@@ -7725,8 +7936,8 @@ var Whiteboard = ({
|
|
|
7725
7936
|
width: `${IMAGE_WIDTH}px`,
|
|
7726
7937
|
height: `${IMAGE_HEIGHT}px`
|
|
7727
7938
|
},
|
|
7728
|
-
children: imageErrors.has(image.id) ? /* @__PURE__ */ (0,
|
|
7729
|
-
/* @__PURE__ */ (0,
|
|
7939
|
+
children: imageErrors.has(image.id) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-gray-500 text-sm text-center px-2", children: "Imagem indispon\xEDvel" }) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
7940
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7730
7941
|
"img",
|
|
7731
7942
|
{
|
|
7732
7943
|
src: image.imageUrl,
|
|
@@ -7736,18 +7947,18 @@ var Whiteboard = ({
|
|
|
7736
7947
|
onError: () => handleImageError(image.id)
|
|
7737
7948
|
}
|
|
7738
7949
|
),
|
|
7739
|
-
/* @__PURE__ */ (0,
|
|
7950
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/20 to-transparent" })
|
|
7740
7951
|
] })
|
|
7741
7952
|
}
|
|
7742
7953
|
),
|
|
7743
|
-
showDownload && /* @__PURE__ */ (0,
|
|
7954
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7744
7955
|
"button",
|
|
7745
7956
|
{
|
|
7746
7957
|
type: "button",
|
|
7747
7958
|
onClick: () => handleDownload(image),
|
|
7748
7959
|
className: "cursor-pointer absolute bottom-3 right-3 flex items-center justify-center bg-black/20 backdrop-blur-sm rounded hover:bg-black/30 transition-colors duration-200 group/button w-6 h-6",
|
|
7749
7960
|
"aria-label": `Download ${image.title || "imagem"}`,
|
|
7750
|
-
children: /* @__PURE__ */ (0,
|
|
7961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7751
7962
|
import_phosphor_react19.ArrowsOut,
|
|
7752
7963
|
{
|
|
7753
7964
|
size: 24,
|
|
@@ -7767,10 +7978,10 @@ var Whiteboard = ({
|
|
|
7767
7978
|
var Whiteboard_default = Whiteboard;
|
|
7768
7979
|
|
|
7769
7980
|
// src/components/Auth/Auth.tsx
|
|
7770
|
-
var
|
|
7981
|
+
var import_react27 = require("react");
|
|
7771
7982
|
var import_react_router_dom = require("react-router-dom");
|
|
7772
|
-
var
|
|
7773
|
-
var AuthContext = (0,
|
|
7983
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
7984
|
+
var AuthContext = (0, import_react27.createContext)(void 0);
|
|
7774
7985
|
var AuthProvider = ({
|
|
7775
7986
|
children,
|
|
7776
7987
|
checkAuthFn,
|
|
@@ -7780,12 +7991,12 @@ var AuthProvider = ({
|
|
|
7780
7991
|
getSessionFn,
|
|
7781
7992
|
getTokensFn
|
|
7782
7993
|
}) => {
|
|
7783
|
-
const [authState, setAuthState] = (0,
|
|
7994
|
+
const [authState, setAuthState] = (0, import_react27.useState)({
|
|
7784
7995
|
isAuthenticated: false,
|
|
7785
7996
|
isLoading: true,
|
|
7786
7997
|
...initialAuthState
|
|
7787
7998
|
});
|
|
7788
|
-
const checkAuth = (0,
|
|
7999
|
+
const checkAuth = (0, import_react27.useCallback)(async () => {
|
|
7789
8000
|
try {
|
|
7790
8001
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
7791
8002
|
if (!checkAuthFn) {
|
|
@@ -7816,7 +8027,7 @@ var AuthProvider = ({
|
|
|
7816
8027
|
return false;
|
|
7817
8028
|
}
|
|
7818
8029
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
7819
|
-
const signOut = (0,
|
|
8030
|
+
const signOut = (0, import_react27.useCallback)(() => {
|
|
7820
8031
|
if (signOutFn) {
|
|
7821
8032
|
signOutFn();
|
|
7822
8033
|
}
|
|
@@ -7828,10 +8039,10 @@ var AuthProvider = ({
|
|
|
7828
8039
|
tokens: void 0
|
|
7829
8040
|
}));
|
|
7830
8041
|
}, [signOutFn]);
|
|
7831
|
-
(0,
|
|
8042
|
+
(0, import_react27.useEffect)(() => {
|
|
7832
8043
|
checkAuth();
|
|
7833
8044
|
}, [checkAuth]);
|
|
7834
|
-
const contextValue = (0,
|
|
8045
|
+
const contextValue = (0, import_react27.useMemo)(
|
|
7835
8046
|
() => ({
|
|
7836
8047
|
...authState,
|
|
7837
8048
|
checkAuth,
|
|
@@ -7839,10 +8050,10 @@ var AuthProvider = ({
|
|
|
7839
8050
|
}),
|
|
7840
8051
|
[authState, checkAuth, signOut]
|
|
7841
8052
|
);
|
|
7842
|
-
return /* @__PURE__ */ (0,
|
|
8053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AuthContext.Provider, { value: contextValue, children });
|
|
7843
8054
|
};
|
|
7844
8055
|
var useAuth = () => {
|
|
7845
|
-
const context = (0,
|
|
8056
|
+
const context = (0, import_react27.useContext)(AuthContext);
|
|
7846
8057
|
if (context === void 0) {
|
|
7847
8058
|
throw new Error("useAuth deve ser usado dentro de um AuthProvider");
|
|
7848
8059
|
}
|
|
@@ -7855,9 +8066,9 @@ var ProtectedRoute = ({
|
|
|
7855
8066
|
additionalCheck
|
|
7856
8067
|
}) => {
|
|
7857
8068
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
7858
|
-
const defaultLoadingComponent = /* @__PURE__ */ (0,
|
|
8069
|
+
const defaultLoadingComponent = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
7859
8070
|
if (isLoading) {
|
|
7860
|
-
return /* @__PURE__ */ (0,
|
|
8071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: loadingComponent || defaultLoadingComponent });
|
|
7861
8072
|
}
|
|
7862
8073
|
if (!isAuthenticated) {
|
|
7863
8074
|
if (typeof window !== "undefined") {
|
|
@@ -7868,12 +8079,12 @@ var ProtectedRoute = ({
|
|
|
7868
8079
|
return null;
|
|
7869
8080
|
}
|
|
7870
8081
|
}
|
|
7871
|
-
return /* @__PURE__ */ (0,
|
|
8082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
7872
8083
|
}
|
|
7873
8084
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
7874
|
-
return /* @__PURE__ */ (0,
|
|
8085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
7875
8086
|
}
|
|
7876
|
-
return /* @__PURE__ */ (0,
|
|
8087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children });
|
|
7877
8088
|
};
|
|
7878
8089
|
var PublicRoute = ({
|
|
7879
8090
|
children,
|
|
@@ -7883,15 +8094,15 @@ var PublicRoute = ({
|
|
|
7883
8094
|
}) => {
|
|
7884
8095
|
const { isAuthenticated, isLoading } = useAuth();
|
|
7885
8096
|
if (checkAuthBeforeRender && isLoading) {
|
|
7886
|
-
return /* @__PURE__ */ (0,
|
|
8097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
7887
8098
|
}
|
|
7888
8099
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
7889
|
-
return /* @__PURE__ */ (0,
|
|
8100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
7890
8101
|
}
|
|
7891
|
-
return /* @__PURE__ */ (0,
|
|
8102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children });
|
|
7892
8103
|
};
|
|
7893
8104
|
var withAuth = (Component, options = {}) => {
|
|
7894
|
-
return (props) => /* @__PURE__ */ (0,
|
|
8105
|
+
return (props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ProtectedRoute, { ...options, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Component, { ...props }) });
|
|
7895
8106
|
};
|
|
7896
8107
|
var useAuthGuard = (options = {}) => {
|
|
7897
8108
|
const authState = useAuth();
|
|
@@ -7906,7 +8117,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
7906
8117
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
7907
8118
|
const { isAuthenticated, isLoading } = useAuth();
|
|
7908
8119
|
const location = (0, import_react_router_dom.useLocation)();
|
|
7909
|
-
const redirectToLogin = () => /* @__PURE__ */ (0,
|
|
8120
|
+
const redirectToLogin = () => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom.Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
7910
8121
|
return {
|
|
7911
8122
|
isAuthenticated,
|
|
7912
8123
|
isLoading,
|
|
@@ -7982,7 +8193,7 @@ function createZustandAuthAdapter(useAuthStore) {
|
|
|
7982
8193
|
}
|
|
7983
8194
|
|
|
7984
8195
|
// src/components/Auth/useUrlAuthentication.ts
|
|
7985
|
-
var
|
|
8196
|
+
var import_react28 = require("react");
|
|
7986
8197
|
var import_react_router_dom2 = require("react-router-dom");
|
|
7987
8198
|
var getAuthParams = (location, extractParams) => {
|
|
7988
8199
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -8030,8 +8241,8 @@ var handleUserData = (responseData, setUser) => {
|
|
|
8030
8241
|
};
|
|
8031
8242
|
function useUrlAuthentication(options) {
|
|
8032
8243
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
8033
|
-
const processedRef = (0,
|
|
8034
|
-
(0,
|
|
8244
|
+
const processedRef = (0, import_react28.useRef)(false);
|
|
8245
|
+
(0, import_react28.useEffect)(() => {
|
|
8035
8246
|
const handleAuthentication = async () => {
|
|
8036
8247
|
if (processedRef.current) {
|
|
8037
8248
|
return;
|
|
@@ -8102,9 +8313,9 @@ function useUrlAuthentication(options) {
|
|
|
8102
8313
|
}
|
|
8103
8314
|
|
|
8104
8315
|
// src/components/Auth/useApiConfig.ts
|
|
8105
|
-
var
|
|
8316
|
+
var import_react29 = require("react");
|
|
8106
8317
|
function useApiConfig(api) {
|
|
8107
|
-
return (0,
|
|
8318
|
+
return (0, import_react29.useMemo)(
|
|
8108
8319
|
() => ({
|
|
8109
8320
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
8110
8321
|
}),
|
|
@@ -8114,7 +8325,7 @@ function useApiConfig(api) {
|
|
|
8114
8325
|
|
|
8115
8326
|
// src/components/Quiz/Quiz.tsx
|
|
8116
8327
|
var import_phosphor_react20 = require("phosphor-react");
|
|
8117
|
-
var
|
|
8328
|
+
var import_react30 = require("react");
|
|
8118
8329
|
|
|
8119
8330
|
// src/components/Quiz/useQuizStore.ts
|
|
8120
8331
|
var import_zustand7 = require("zustand");
|
|
@@ -8750,13 +8961,13 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
8750
8961
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
8751
8962
|
|
|
8752
8963
|
// src/components/Quiz/Quiz.tsx
|
|
8753
|
-
var
|
|
8964
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
8754
8965
|
var getStatusBadge = (status) => {
|
|
8755
8966
|
switch (status) {
|
|
8756
8967
|
case "correct":
|
|
8757
|
-
return /* @__PURE__ */ (0,
|
|
8968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.CheckCircle, {}), children: "Resposta correta" });
|
|
8758
8969
|
case "incorrect":
|
|
8759
|
-
return /* @__PURE__ */ (0,
|
|
8970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.XCircle, {}), children: "Resposta incorreta" });
|
|
8760
8971
|
default:
|
|
8761
8972
|
return null;
|
|
8762
8973
|
}
|
|
@@ -8769,18 +8980,18 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
8769
8980
|
return "bg-error-background border-error-300";
|
|
8770
8981
|
}
|
|
8771
8982
|
};
|
|
8772
|
-
var Quiz = (0,
|
|
8983
|
+
var Quiz = (0, import_react30.forwardRef)(({ children, className, variant = "default", ...props }, ref) => {
|
|
8773
8984
|
const { setVariant } = useQuizStore();
|
|
8774
|
-
(0,
|
|
8985
|
+
(0, import_react30.useEffect)(() => {
|
|
8775
8986
|
setVariant(variant);
|
|
8776
8987
|
}, [variant, setVariant]);
|
|
8777
|
-
return /* @__PURE__ */ (0,
|
|
8988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
8778
8989
|
});
|
|
8779
|
-
var QuizHeaderResult = (0,
|
|
8990
|
+
var QuizHeaderResult = (0, import_react30.forwardRef)(
|
|
8780
8991
|
({ className, ...props }, ref) => {
|
|
8781
8992
|
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
8782
|
-
const [status, setStatus] = (0,
|
|
8783
|
-
(0,
|
|
8993
|
+
const [status, setStatus] = (0, import_react30.useState)(void 0);
|
|
8994
|
+
(0, import_react30.useEffect)(() => {
|
|
8784
8995
|
const cq = getCurrentQuestion();
|
|
8785
8996
|
if (!cq) {
|
|
8786
8997
|
setStatus(void 0);
|
|
@@ -8815,7 +9026,7 @@ var QuizHeaderResult = (0, import_react29.forwardRef)(
|
|
|
8815
9026
|
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
8816
9027
|
}
|
|
8817
9028
|
};
|
|
8818
|
-
return /* @__PURE__ */ (0,
|
|
9029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
8819
9030
|
"div",
|
|
8820
9031
|
{
|
|
8821
9032
|
ref,
|
|
@@ -8826,14 +9037,14 @@ var QuizHeaderResult = (0, import_react29.forwardRef)(
|
|
|
8826
9037
|
),
|
|
8827
9038
|
...props,
|
|
8828
9039
|
children: [
|
|
8829
|
-
/* @__PURE__ */ (0,
|
|
8830
|
-
/* @__PURE__ */ (0,
|
|
9040
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
9041
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
8831
9042
|
]
|
|
8832
9043
|
}
|
|
8833
9044
|
);
|
|
8834
9045
|
}
|
|
8835
9046
|
);
|
|
8836
|
-
var QuizTitle = (0,
|
|
9047
|
+
var QuizTitle = (0, import_react30.forwardRef)(
|
|
8837
9048
|
({ className, ...props }, ref) => {
|
|
8838
9049
|
const {
|
|
8839
9050
|
currentQuestionIndex,
|
|
@@ -8843,7 +9054,7 @@ var QuizTitle = (0, import_react29.forwardRef)(
|
|
|
8843
9054
|
formatTime: formatTime2,
|
|
8844
9055
|
isStarted
|
|
8845
9056
|
} = useQuizStore();
|
|
8846
|
-
const [showExitConfirmation, setShowExitConfirmation] = (0,
|
|
9057
|
+
const [showExitConfirmation, setShowExitConfirmation] = (0, import_react30.useState)(false);
|
|
8847
9058
|
const totalQuestions = getTotalQuestions();
|
|
8848
9059
|
const quizTitle = getQuizTitle();
|
|
8849
9060
|
const handleBackClick = () => {
|
|
@@ -8860,8 +9071,8 @@ var QuizTitle = (0, import_react29.forwardRef)(
|
|
|
8860
9071
|
const handleCancelExit = () => {
|
|
8861
9072
|
setShowExitConfirmation(false);
|
|
8862
9073
|
};
|
|
8863
|
-
return /* @__PURE__ */ (0,
|
|
8864
|
-
/* @__PURE__ */ (0,
|
|
9074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9075
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
8865
9076
|
"div",
|
|
8866
9077
|
{
|
|
8867
9078
|
ref,
|
|
@@ -8871,24 +9082,24 @@ var QuizTitle = (0, import_react29.forwardRef)(
|
|
|
8871
9082
|
),
|
|
8872
9083
|
...props,
|
|
8873
9084
|
children: [
|
|
8874
|
-
/* @__PURE__ */ (0,
|
|
9085
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8875
9086
|
IconButton_default,
|
|
8876
9087
|
{
|
|
8877
|
-
icon: /* @__PURE__ */ (0,
|
|
9088
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.CaretLeft, { size: 24 }),
|
|
8878
9089
|
size: "md",
|
|
8879
9090
|
"aria-label": "Voltar",
|
|
8880
9091
|
onClick: handleBackClick
|
|
8881
9092
|
}
|
|
8882
9093
|
),
|
|
8883
|
-
/* @__PURE__ */ (0,
|
|
8884
|
-
/* @__PURE__ */ (0,
|
|
8885
|
-
/* @__PURE__ */ (0,
|
|
9094
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
9095
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
9096
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
8886
9097
|
] }),
|
|
8887
|
-
/* @__PURE__ */ (0,
|
|
9098
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.Clock, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
8888
9099
|
]
|
|
8889
9100
|
}
|
|
8890
9101
|
),
|
|
8891
|
-
/* @__PURE__ */ (0,
|
|
9102
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8892
9103
|
AlertDialog,
|
|
8893
9104
|
{
|
|
8894
9105
|
isOpen: showExitConfirmation,
|
|
@@ -8904,15 +9115,15 @@ var QuizTitle = (0, import_react29.forwardRef)(
|
|
|
8904
9115
|
] });
|
|
8905
9116
|
}
|
|
8906
9117
|
);
|
|
8907
|
-
var QuizSubTitle = (0,
|
|
9118
|
+
var QuizSubTitle = (0, import_react30.forwardRef)(
|
|
8908
9119
|
({ subTitle, ...props }, ref) => {
|
|
8909
|
-
return /* @__PURE__ */ (0,
|
|
9120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
8910
9121
|
}
|
|
8911
9122
|
);
|
|
8912
9123
|
var QuizHeader = () => {
|
|
8913
9124
|
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
8914
9125
|
const currentQuestion = getCurrentQuestion();
|
|
8915
|
-
return /* @__PURE__ */ (0,
|
|
9126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8916
9127
|
HeaderAlternative,
|
|
8917
9128
|
{
|
|
8918
9129
|
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
@@ -8921,8 +9132,8 @@ var QuizHeader = () => {
|
|
|
8921
9132
|
}
|
|
8922
9133
|
);
|
|
8923
9134
|
};
|
|
8924
|
-
var QuizContainer = (0,
|
|
8925
|
-
return /* @__PURE__ */ (0,
|
|
9135
|
+
var QuizContainer = (0, import_react30.forwardRef)(({ children, className, ...props }, ref) => {
|
|
9136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8926
9137
|
"div",
|
|
8927
9138
|
{
|
|
8928
9139
|
ref,
|
|
@@ -8935,7 +9146,7 @@ var QuizContainer = (0, import_react29.forwardRef)(({ children, className, ...pr
|
|
|
8935
9146
|
}
|
|
8936
9147
|
);
|
|
8937
9148
|
});
|
|
8938
|
-
var QuizContent = (0,
|
|
9149
|
+
var QuizContent = (0, import_react30.forwardRef)(({ paddingBottom }) => {
|
|
8939
9150
|
const { getCurrentQuestion } = useQuizStore();
|
|
8940
9151
|
const currentQuestion = getCurrentQuestion();
|
|
8941
9152
|
const questionComponents = {
|
|
@@ -8948,7 +9159,7 @@ var QuizContent = (0, import_react29.forwardRef)(({ paddingBottom }) => {
|
|
|
8948
9159
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
8949
9160
|
};
|
|
8950
9161
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
8951
|
-
return QuestionComponent ? /* @__PURE__ */ (0,
|
|
9162
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuestionComponent, { paddingBottom }) : null;
|
|
8952
9163
|
});
|
|
8953
9164
|
var QuizAlternative = ({ paddingBottom }) => {
|
|
8954
9165
|
const {
|
|
@@ -8985,10 +9196,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
8985
9196
|
};
|
|
8986
9197
|
});
|
|
8987
9198
|
if (!alternatives)
|
|
8988
|
-
return /* @__PURE__ */ (0,
|
|
8989
|
-
return /* @__PURE__ */ (0,
|
|
8990
|
-
/* @__PURE__ */ (0,
|
|
8991
|
-
/* @__PURE__ */ (0,
|
|
9199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
9200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9201
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
9202
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8992
9203
|
AlternativesList,
|
|
8993
9204
|
{
|
|
8994
9205
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -9020,15 +9231,15 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
9020
9231
|
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
9021
9232
|
currentQuestion?.id || ""
|
|
9022
9233
|
);
|
|
9023
|
-
const prevSelectedValuesRef = (0,
|
|
9024
|
-
const prevQuestionIdRef = (0,
|
|
9025
|
-
const allCurrentAnswerIds = (0,
|
|
9234
|
+
const prevSelectedValuesRef = (0, import_react30.useRef)([]);
|
|
9235
|
+
const prevQuestionIdRef = (0, import_react30.useRef)("");
|
|
9236
|
+
const allCurrentAnswerIds = (0, import_react30.useMemo)(() => {
|
|
9026
9237
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
9027
9238
|
}, [allCurrentAnswers]);
|
|
9028
|
-
const selectedValues = (0,
|
|
9239
|
+
const selectedValues = (0, import_react30.useMemo)(() => {
|
|
9029
9240
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
9030
9241
|
}, [allCurrentAnswerIds]);
|
|
9031
|
-
const stableSelectedValues = (0,
|
|
9242
|
+
const stableSelectedValues = (0, import_react30.useMemo)(() => {
|
|
9032
9243
|
const currentQuestionId = currentQuestion?.id || "";
|
|
9033
9244
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
9034
9245
|
if (hasQuestionChanged) {
|
|
@@ -9052,7 +9263,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
9052
9263
|
variant,
|
|
9053
9264
|
currentQuestionResult?.selectedOptions
|
|
9054
9265
|
]);
|
|
9055
|
-
const handleSelectedValues = (0,
|
|
9266
|
+
const handleSelectedValues = (0, import_react30.useCallback)(
|
|
9056
9267
|
(values) => {
|
|
9057
9268
|
if (currentQuestion) {
|
|
9058
9269
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -9060,7 +9271,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
9060
9271
|
},
|
|
9061
9272
|
[currentQuestion, selectMultipleAnswer]
|
|
9062
9273
|
);
|
|
9063
|
-
const questionKey = (0,
|
|
9274
|
+
const questionKey = (0, import_react30.useMemo)(
|
|
9064
9275
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
9065
9276
|
[currentQuestion?.id]
|
|
9066
9277
|
);
|
|
@@ -9086,10 +9297,10 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
9086
9297
|
};
|
|
9087
9298
|
});
|
|
9088
9299
|
if (!choices)
|
|
9089
|
-
return /* @__PURE__ */ (0,
|
|
9090
|
-
return /* @__PURE__ */ (0,
|
|
9091
|
-
/* @__PURE__ */ (0,
|
|
9092
|
-
/* @__PURE__ */ (0,
|
|
9300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
9301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9302
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
9303
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9093
9304
|
MultipleChoiceList,
|
|
9094
9305
|
{
|
|
9095
9306
|
choices,
|
|
@@ -9115,13 +9326,13 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
9115
9326
|
currentQuestion?.id || ""
|
|
9116
9327
|
);
|
|
9117
9328
|
const currentAnswer = getCurrentAnswer();
|
|
9118
|
-
const textareaRef = (0,
|
|
9329
|
+
const textareaRef = (0, import_react30.useRef)(null);
|
|
9119
9330
|
const handleAnswerChange = (value) => {
|
|
9120
9331
|
if (currentQuestion) {
|
|
9121
9332
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
9122
9333
|
}
|
|
9123
9334
|
};
|
|
9124
|
-
const adjustTextareaHeight = (0,
|
|
9335
|
+
const adjustTextareaHeight = (0, import_react30.useCallback)(() => {
|
|
9125
9336
|
if (textareaRef.current) {
|
|
9126
9337
|
textareaRef.current.style.height = "auto";
|
|
9127
9338
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -9131,16 +9342,16 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
9131
9342
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
9132
9343
|
}
|
|
9133
9344
|
}, []);
|
|
9134
|
-
(0,
|
|
9345
|
+
(0, import_react30.useEffect)(() => {
|
|
9135
9346
|
adjustTextareaHeight();
|
|
9136
9347
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
9137
9348
|
if (!currentQuestion) {
|
|
9138
|
-
return /* @__PURE__ */ (0,
|
|
9349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
9139
9350
|
}
|
|
9140
9351
|
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
9141
|
-
return /* @__PURE__ */ (0,
|
|
9142
|
-
/* @__PURE__ */ (0,
|
|
9143
|
-
/* @__PURE__ */ (0,
|
|
9352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9353
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
9354
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9144
9355
|
TextArea_default,
|
|
9145
9356
|
{
|
|
9146
9357
|
ref: textareaRef,
|
|
@@ -9150,10 +9361,10 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
9150
9361
|
rows: 4,
|
|
9151
9362
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
9152
9363
|
}
|
|
9153
|
-
) }) : /* @__PURE__ */ (0,
|
|
9154
|
-
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0,
|
|
9155
|
-
/* @__PURE__ */ (0,
|
|
9156
|
-
/* @__PURE__ */ (0,
|
|
9364
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
9365
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9366
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
9367
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Mauris euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim." }) })
|
|
9157
9368
|
] })
|
|
9158
9369
|
] });
|
|
9159
9370
|
};
|
|
@@ -9179,16 +9390,16 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
9179
9390
|
];
|
|
9180
9391
|
const getLetterByIndex = (index) => String.fromCharCode(97 + index);
|
|
9181
9392
|
const isDefaultVariant = variant == "default";
|
|
9182
|
-
return /* @__PURE__ */ (0,
|
|
9183
|
-
/* @__PURE__ */ (0,
|
|
9184
|
-
/* @__PURE__ */ (0,
|
|
9393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9394
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
9395
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
9185
9396
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
9186
|
-
return /* @__PURE__ */ (0,
|
|
9397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9187
9398
|
"section",
|
|
9188
9399
|
{
|
|
9189
9400
|
className: "flex flex-col gap-2",
|
|
9190
9401
|
children: [
|
|
9191
|
-
/* @__PURE__ */ (0,
|
|
9402
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9192
9403
|
"div",
|
|
9193
9404
|
{
|
|
9194
9405
|
className: cn(
|
|
@@ -9196,20 +9407,20 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
9196
9407
|
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
9197
9408
|
),
|
|
9198
9409
|
children: [
|
|
9199
|
-
/* @__PURE__ */ (0,
|
|
9200
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
9201
|
-
/* @__PURE__ */ (0,
|
|
9202
|
-
/* @__PURE__ */ (0,
|
|
9203
|
-
/* @__PURE__ */ (0,
|
|
9204
|
-
/* @__PURE__ */ (0,
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
9411
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Select_default, { size: "medium", children: [
|
|
9412
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
9413
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(SelectContent, { children: [
|
|
9414
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
9415
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: "F", children: "Falso" })
|
|
9205
9416
|
] })
|
|
9206
|
-
] }) : /* @__PURE__ */ (0,
|
|
9417
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
9207
9418
|
]
|
|
9208
9419
|
}
|
|
9209
9420
|
),
|
|
9210
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
9211
|
-
/* @__PURE__ */ (0,
|
|
9212
|
-
!option.isCorrect && /* @__PURE__ */ (0,
|
|
9421
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
9422
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
9423
|
+
!option.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
9213
9424
|
] })
|
|
9214
9425
|
]
|
|
9215
9426
|
},
|
|
@@ -9270,7 +9481,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
9270
9481
|
isCorrect: false
|
|
9271
9482
|
}
|
|
9272
9483
|
];
|
|
9273
|
-
const [userAnswers, setUserAnswers] = (0,
|
|
9484
|
+
const [userAnswers, setUserAnswers] = (0, import_react30.useState)(() => {
|
|
9274
9485
|
if (variant === "result") {
|
|
9275
9486
|
return mockUserAnswers;
|
|
9276
9487
|
}
|
|
@@ -9299,13 +9510,13 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
9299
9510
|
const assignedDots = new Set(
|
|
9300
9511
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
9301
9512
|
);
|
|
9302
|
-
return /* @__PURE__ */ (0,
|
|
9303
|
-
/* @__PURE__ */ (0,
|
|
9304
|
-
/* @__PURE__ */ (0,
|
|
9513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9514
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
9515
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
9305
9516
|
const answer = userAnswers[index];
|
|
9306
9517
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
9307
|
-
return /* @__PURE__ */ (0,
|
|
9308
|
-
/* @__PURE__ */ (0,
|
|
9518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
9519
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9309
9520
|
"div",
|
|
9310
9521
|
{
|
|
9311
9522
|
className: cn(
|
|
@@ -9313,30 +9524,30 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
9313
9524
|
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
9314
9525
|
),
|
|
9315
9526
|
children: [
|
|
9316
|
-
/* @__PURE__ */ (0,
|
|
9317
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
9527
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
9528
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9318
9529
|
Select_default,
|
|
9319
9530
|
{
|
|
9320
9531
|
size: "medium",
|
|
9321
9532
|
value: answer.dotOption || void 0,
|
|
9322
9533
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
9323
9534
|
children: [
|
|
9324
|
-
/* @__PURE__ */ (0,
|
|
9325
|
-
/* @__PURE__ */ (0,
|
|
9535
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
9536
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectContent, { children: dotsOptions.filter(
|
|
9326
9537
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
9327
|
-
).map((dot) => /* @__PURE__ */ (0,
|
|
9538
|
+
).map((dot) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
9328
9539
|
]
|
|
9329
9540
|
}
|
|
9330
|
-
) : /* @__PURE__ */ (0,
|
|
9541
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
9331
9542
|
]
|
|
9332
9543
|
}
|
|
9333
9544
|
),
|
|
9334
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
9335
|
-
/* @__PURE__ */ (0,
|
|
9545
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
9546
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
9336
9547
|
"Resposta selecionada: ",
|
|
9337
9548
|
answer.dotOption || "Nenhuma"
|
|
9338
9549
|
] }),
|
|
9339
|
-
!answer.isCorrect && /* @__PURE__ */ (0,
|
|
9550
|
+
!answer.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
9340
9551
|
"Resposta correta: ",
|
|
9341
9552
|
answer.correctOption
|
|
9342
9553
|
] })
|
|
@@ -9389,8 +9600,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9389
9600
|
isCorrect: true
|
|
9390
9601
|
}
|
|
9391
9602
|
];
|
|
9392
|
-
const [answers, setAnswers] = (0,
|
|
9393
|
-
const baseId = (0,
|
|
9603
|
+
const [answers, setAnswers] = (0, import_react30.useState)({});
|
|
9604
|
+
const baseId = (0, import_react30.useId)();
|
|
9394
9605
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
9395
9606
|
const usedOptions = Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value);
|
|
9396
9607
|
return options.filter((option) => !usedOptions.includes(option));
|
|
@@ -9403,18 +9614,18 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9403
9614
|
const mockAnswer = mockUserAnswers.find(
|
|
9404
9615
|
(answer) => answer.selectId === selectId
|
|
9405
9616
|
);
|
|
9406
|
-
return /* @__PURE__ */ (0,
|
|
9617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
9407
9618
|
};
|
|
9408
9619
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
9409
|
-
return /* @__PURE__ */ (0,
|
|
9620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9410
9621
|
Select_default,
|
|
9411
9622
|
{
|
|
9412
9623
|
value: selectedValue,
|
|
9413
9624
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
9414
9625
|
className: "inline-flex mb-2.5",
|
|
9415
9626
|
children: [
|
|
9416
|
-
/* @__PURE__ */ (0,
|
|
9417
|
-
/* @__PURE__ */ (0,
|
|
9627
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-white border-gray-300", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
9628
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
9418
9629
|
]
|
|
9419
9630
|
},
|
|
9420
9631
|
`${selectId}-${startIndex}`
|
|
@@ -9426,8 +9637,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9426
9637
|
);
|
|
9427
9638
|
if (!mockAnswer) return null;
|
|
9428
9639
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
9429
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0,
|
|
9430
|
-
return /* @__PURE__ */ (0,
|
|
9640
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.XCircle, {});
|
|
9641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9431
9642
|
Badge_default,
|
|
9432
9643
|
{
|
|
9433
9644
|
variant: "solid",
|
|
@@ -9435,7 +9646,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9435
9646
|
iconRight: icon,
|
|
9436
9647
|
size: "large",
|
|
9437
9648
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
9438
|
-
children: /* @__PURE__ */ (0,
|
|
9649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
9439
9650
|
},
|
|
9440
9651
|
selectId
|
|
9441
9652
|
);
|
|
@@ -9491,25 +9702,25 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9491
9702
|
}
|
|
9492
9703
|
return elements;
|
|
9493
9704
|
};
|
|
9494
|
-
return /* @__PURE__ */ (0,
|
|
9495
|
-
/* @__PURE__ */ (0,
|
|
9496
|
-
/* @__PURE__ */ (0,
|
|
9705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9706
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
9707
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9497
9708
|
"div",
|
|
9498
9709
|
{
|
|
9499
9710
|
className: cn(
|
|
9500
9711
|
"text-lg text-text-900 leading-8 h-auto",
|
|
9501
9712
|
variant != "result" && paddingBottom
|
|
9502
9713
|
),
|
|
9503
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0,
|
|
9714
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: element.element }, element.id))
|
|
9504
9715
|
}
|
|
9505
9716
|
) }) }),
|
|
9506
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
9507
|
-
/* @__PURE__ */ (0,
|
|
9508
|
-
/* @__PURE__ */ (0,
|
|
9717
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9718
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Resultado" }),
|
|
9719
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9509
9720
|
"div",
|
|
9510
9721
|
{
|
|
9511
9722
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
9512
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0,
|
|
9723
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: element.element }, element.id))
|
|
9513
9724
|
}
|
|
9514
9725
|
) }) })
|
|
9515
9726
|
] })
|
|
@@ -9527,7 +9738,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
9527
9738
|
};
|
|
9528
9739
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
9529
9740
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
9530
|
-
const [clickPositionRelative, setClickPositionRelative] = (0,
|
|
9741
|
+
const [clickPositionRelative, setClickPositionRelative] = (0, import_react30.useState)(variant == "result" ? mockUserAnswerRelative : null);
|
|
9531
9742
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
9532
9743
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
9533
9744
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -9563,36 +9774,36 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
9563
9774
|
}
|
|
9564
9775
|
return "bg-success-600/70 border-white";
|
|
9565
9776
|
};
|
|
9566
|
-
return /* @__PURE__ */ (0,
|
|
9567
|
-
/* @__PURE__ */ (0,
|
|
9568
|
-
/* @__PURE__ */ (0,
|
|
9777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
9778
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
9779
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9569
9780
|
"div",
|
|
9570
9781
|
{
|
|
9571
9782
|
"data-testid": "quiz-image-container",
|
|
9572
9783
|
className: "space-y-6 p-3 relative inline-block",
|
|
9573
9784
|
children: [
|
|
9574
|
-
variant == "result" && /* @__PURE__ */ (0,
|
|
9785
|
+
variant == "result" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9575
9786
|
"div",
|
|
9576
9787
|
{
|
|
9577
9788
|
"data-testid": "quiz-legend",
|
|
9578
9789
|
className: "flex items-center gap-4 text-xs",
|
|
9579
9790
|
children: [
|
|
9580
|
-
/* @__PURE__ */ (0,
|
|
9581
|
-
/* @__PURE__ */ (0,
|
|
9582
|
-
/* @__PURE__ */ (0,
|
|
9791
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9792
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
9793
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
9583
9794
|
] }),
|
|
9584
|
-
/* @__PURE__ */ (0,
|
|
9585
|
-
/* @__PURE__ */ (0,
|
|
9586
|
-
/* @__PURE__ */ (0,
|
|
9795
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9796
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
9797
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
9587
9798
|
] }),
|
|
9588
|
-
/* @__PURE__ */ (0,
|
|
9589
|
-
/* @__PURE__ */ (0,
|
|
9590
|
-
/* @__PURE__ */ (0,
|
|
9799
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9800
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
9801
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
9591
9802
|
] })
|
|
9592
9803
|
]
|
|
9593
9804
|
}
|
|
9594
9805
|
),
|
|
9595
|
-
/* @__PURE__ */ (0,
|
|
9806
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9596
9807
|
"button",
|
|
9597
9808
|
{
|
|
9598
9809
|
"data-testid": "quiz-image-button",
|
|
@@ -9607,7 +9818,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
9607
9818
|
},
|
|
9608
9819
|
"aria-label": "\xC1rea da imagem interativa",
|
|
9609
9820
|
children: [
|
|
9610
|
-
/* @__PURE__ */ (0,
|
|
9821
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9611
9822
|
"img",
|
|
9612
9823
|
{
|
|
9613
9824
|
"data-testid": "quiz-image",
|
|
@@ -9616,7 +9827,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
9616
9827
|
className: "w-full h-auto rounded-md"
|
|
9617
9828
|
}
|
|
9618
9829
|
),
|
|
9619
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
9830
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9620
9831
|
"div",
|
|
9621
9832
|
{
|
|
9622
9833
|
"data-testid": "quiz-correct-circle",
|
|
@@ -9631,7 +9842,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
9631
9842
|
}
|
|
9632
9843
|
}
|
|
9633
9844
|
),
|
|
9634
|
-
clickPositionRelative && /* @__PURE__ */ (0,
|
|
9845
|
+
clickPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9635
9846
|
"div",
|
|
9636
9847
|
{
|
|
9637
9848
|
"data-testid": "quiz-user-circle",
|
|
@@ -9699,18 +9910,18 @@ var QuizQuestionList = ({
|
|
|
9699
9910
|
return "Em branco";
|
|
9700
9911
|
}
|
|
9701
9912
|
};
|
|
9702
|
-
return /* @__PURE__ */ (0,
|
|
9703
|
-
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ (0,
|
|
9913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-6 px-4 h-full", children: [
|
|
9914
|
+
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-lg", children: "Nenhum resultado" }) }),
|
|
9704
9915
|
Object.entries(filteredGroupedQuestions).map(
|
|
9705
|
-
([subjectId, questions]) => /* @__PURE__ */ (0,
|
|
9706
|
-
/* @__PURE__ */ (0,
|
|
9707
|
-
/* @__PURE__ */ (0,
|
|
9708
|
-
/* @__PURE__ */ (0,
|
|
9916
|
+
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
9917
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
9918
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.BookOpen, { size: 17, className: "text-white" }) }),
|
|
9919
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
9709
9920
|
] }),
|
|
9710
|
-
/* @__PURE__ */ (0,
|
|
9921
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
9711
9922
|
const status = getQuestionStatus(question.id);
|
|
9712
9923
|
const questionNumber = getQuestionIndex(question.id);
|
|
9713
|
-
return /* @__PURE__ */ (0,
|
|
9924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9714
9925
|
CardStatus,
|
|
9715
9926
|
{
|
|
9716
9927
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -9727,7 +9938,7 @@ var QuizQuestionList = ({
|
|
|
9727
9938
|
)
|
|
9728
9939
|
] });
|
|
9729
9940
|
};
|
|
9730
|
-
var QuizFooter = (0,
|
|
9941
|
+
var QuizFooter = (0, import_react30.forwardRef)(
|
|
9731
9942
|
({
|
|
9732
9943
|
className,
|
|
9733
9944
|
onGoToSimulated,
|
|
@@ -9755,11 +9966,11 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9755
9966
|
const currentAnswer = getCurrentAnswer();
|
|
9756
9967
|
const currentQuestion = getCurrentQuestion();
|
|
9757
9968
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
9758
|
-
const [alertDialogOpen, setAlertDialogOpen] = (0,
|
|
9759
|
-
const [modalResultOpen, setModalResultOpen] = (0,
|
|
9760
|
-
const [modalNavigateOpen, setModalNavigateOpen] = (0,
|
|
9761
|
-
const [modalResolutionOpen, setModalResolutionOpen] = (0,
|
|
9762
|
-
const [filterType, setFilterType] = (0,
|
|
9969
|
+
const [alertDialogOpen, setAlertDialogOpen] = (0, import_react30.useState)(false);
|
|
9970
|
+
const [modalResultOpen, setModalResultOpen] = (0, import_react30.useState)(false);
|
|
9971
|
+
const [modalNavigateOpen, setModalNavigateOpen] = (0, import_react30.useState)(false);
|
|
9972
|
+
const [modalResolutionOpen, setModalResolutionOpen] = (0, import_react30.useState)(false);
|
|
9973
|
+
const [filterType, setFilterType] = (0, import_react30.useState)("all");
|
|
9763
9974
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
9764
9975
|
const allQuestions = getTotalQuestions();
|
|
9765
9976
|
const handleFinishQuiz = async () => {
|
|
@@ -9790,8 +10001,8 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9790
10001
|
return;
|
|
9791
10002
|
}
|
|
9792
10003
|
};
|
|
9793
|
-
return /* @__PURE__ */ (0,
|
|
9794
|
-
/* @__PURE__ */ (0,
|
|
10004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
10005
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9795
10006
|
"footer",
|
|
9796
10007
|
{
|
|
9797
10008
|
ref,
|
|
@@ -9800,17 +10011,17 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9800
10011
|
className
|
|
9801
10012
|
),
|
|
9802
10013
|
...props,
|
|
9803
|
-
children: variant === "default" ? /* @__PURE__ */ (0,
|
|
9804
|
-
/* @__PURE__ */ (0,
|
|
9805
|
-
/* @__PURE__ */ (0,
|
|
10014
|
+
children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
10015
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
10016
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9806
10017
|
IconButton_default,
|
|
9807
10018
|
{
|
|
9808
|
-
icon: /* @__PURE__ */ (0,
|
|
10019
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.SquaresFour, { size: 24, className: "text-text-950" }),
|
|
9809
10020
|
size: "md",
|
|
9810
10021
|
onClick: () => setModalNavigateOpen(true)
|
|
9811
10022
|
}
|
|
9812
10023
|
),
|
|
9813
|
-
isFirstQuestion ? /* @__PURE__ */ (0,
|
|
10024
|
+
isFirstQuestion ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9814
10025
|
Button_default,
|
|
9815
10026
|
{
|
|
9816
10027
|
variant: "outline",
|
|
@@ -9821,13 +10032,13 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9821
10032
|
},
|
|
9822
10033
|
children: "Pular"
|
|
9823
10034
|
}
|
|
9824
|
-
) : /* @__PURE__ */ (0,
|
|
10035
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9825
10036
|
Button_default,
|
|
9826
10037
|
{
|
|
9827
10038
|
size: "medium",
|
|
9828
10039
|
variant: "link",
|
|
9829
10040
|
action: "primary",
|
|
9830
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
10041
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.CaretLeft, { size: 18 }),
|
|
9831
10042
|
onClick: () => {
|
|
9832
10043
|
goToPreviousQuestion();
|
|
9833
10044
|
},
|
|
@@ -9835,7 +10046,7 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9835
10046
|
}
|
|
9836
10047
|
)
|
|
9837
10048
|
] }),
|
|
9838
|
-
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ (0,
|
|
10049
|
+
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9839
10050
|
Button_default,
|
|
9840
10051
|
{
|
|
9841
10052
|
size: "small",
|
|
@@ -9848,7 +10059,7 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9848
10059
|
children: "Pular"
|
|
9849
10060
|
}
|
|
9850
10061
|
),
|
|
9851
|
-
isLastQuestion ? /* @__PURE__ */ (0,
|
|
10062
|
+
isLastQuestion ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9852
10063
|
Button_default,
|
|
9853
10064
|
{
|
|
9854
10065
|
size: "medium",
|
|
@@ -9858,13 +10069,13 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9858
10069
|
onClick: handleFinishQuiz,
|
|
9859
10070
|
children: "Finalizar"
|
|
9860
10071
|
}
|
|
9861
|
-
) : /* @__PURE__ */ (0,
|
|
10072
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9862
10073
|
Button_default,
|
|
9863
10074
|
{
|
|
9864
10075
|
size: "medium",
|
|
9865
10076
|
variant: "link",
|
|
9866
10077
|
action: "primary",
|
|
9867
|
-
iconRight: /* @__PURE__ */ (0,
|
|
10078
|
+
iconRight: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.CaretRight, { size: 18 }),
|
|
9868
10079
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
9869
10080
|
onClick: () => {
|
|
9870
10081
|
goToNextQuestion();
|
|
@@ -9872,7 +10083,7 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9872
10083
|
children: "Avan\xE7ar"
|
|
9873
10084
|
}
|
|
9874
10085
|
)
|
|
9875
|
-
] }) : /* @__PURE__ */ (0,
|
|
10086
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-row items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9876
10087
|
Button_default,
|
|
9877
10088
|
{
|
|
9878
10089
|
variant: "solid",
|
|
@@ -9884,7 +10095,7 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9884
10095
|
) })
|
|
9885
10096
|
}
|
|
9886
10097
|
),
|
|
9887
|
-
/* @__PURE__ */ (0,
|
|
10098
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9888
10099
|
AlertDialog,
|
|
9889
10100
|
{
|
|
9890
10101
|
isOpen: alertDialogOpen,
|
|
@@ -9896,7 +10107,7 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9896
10107
|
onSubmit: handleAlertSubmit
|
|
9897
10108
|
}
|
|
9898
10109
|
),
|
|
9899
|
-
/* @__PURE__ */ (0,
|
|
10110
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9900
10111
|
Modal_default,
|
|
9901
10112
|
{
|
|
9902
10113
|
isOpen: modalResultOpen,
|
|
@@ -9906,11 +10117,11 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9906
10117
|
closeOnEscape: false,
|
|
9907
10118
|
hideCloseButton: true,
|
|
9908
10119
|
size: "md",
|
|
9909
|
-
children: /* @__PURE__ */ (0,
|
|
9910
|
-
resultImageComponent ? /* @__PURE__ */ (0,
|
|
9911
|
-
/* @__PURE__ */ (0,
|
|
9912
|
-
/* @__PURE__ */ (0,
|
|
9913
|
-
/* @__PURE__ */ (0,
|
|
10120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
10121
|
+
resultImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
10122
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
10123
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
|
|
10124
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
9914
10125
|
"Voc\xEA acertou",
|
|
9915
10126
|
" ",
|
|
9916
10127
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
@@ -9920,8 +10131,8 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9920
10131
|
" quest\xF5es."
|
|
9921
10132
|
] })
|
|
9922
10133
|
] }),
|
|
9923
|
-
/* @__PURE__ */ (0,
|
|
9924
|
-
/* @__PURE__ */ (0,
|
|
10134
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
10135
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9925
10136
|
Button_default,
|
|
9926
10137
|
{
|
|
9927
10138
|
variant: "outline",
|
|
@@ -9931,38 +10142,38 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9931
10142
|
children: "Ir para simulados"
|
|
9932
10143
|
}
|
|
9933
10144
|
),
|
|
9934
|
-
/* @__PURE__ */ (0,
|
|
10145
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
9935
10146
|
] })
|
|
9936
10147
|
] })
|
|
9937
10148
|
}
|
|
9938
10149
|
),
|
|
9939
|
-
/* @__PURE__ */ (0,
|
|
10150
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9940
10151
|
Modal_default,
|
|
9941
10152
|
{
|
|
9942
10153
|
isOpen: modalNavigateOpen,
|
|
9943
10154
|
onClose: () => setModalNavigateOpen(false),
|
|
9944
10155
|
title: "Quest\xF5es",
|
|
9945
10156
|
size: "lg",
|
|
9946
|
-
children: /* @__PURE__ */ (0,
|
|
9947
|
-
/* @__PURE__ */ (0,
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
9950
|
-
/* @__PURE__ */ (0,
|
|
10157
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
|
|
10158
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [
|
|
10159
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
10160
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
10161
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9951
10162
|
SelectTrigger,
|
|
9952
10163
|
{
|
|
9953
10164
|
variant: "rounded",
|
|
9954
10165
|
className: "max-w-[266px] min-w-[160px]",
|
|
9955
|
-
children: /* @__PURE__ */ (0,
|
|
10166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
|
|
9956
10167
|
}
|
|
9957
10168
|
),
|
|
9958
|
-
/* @__PURE__ */ (0,
|
|
9959
|
-
/* @__PURE__ */ (0,
|
|
9960
|
-
/* @__PURE__ */ (0,
|
|
9961
|
-
/* @__PURE__ */ (0,
|
|
10169
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(SelectContent, { children: [
|
|
10170
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: "all", children: "Todas" }),
|
|
10171
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
10172
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: "answered", children: "Respondidas" })
|
|
9962
10173
|
] })
|
|
9963
10174
|
] }) })
|
|
9964
10175
|
] }),
|
|
9965
|
-
/* @__PURE__ */ (0,
|
|
10176
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9966
10177
|
QuizQuestionList,
|
|
9967
10178
|
{
|
|
9968
10179
|
filterType,
|
|
@@ -9972,7 +10183,7 @@ var QuizFooter = (0, import_react29.forwardRef)(
|
|
|
9972
10183
|
] })
|
|
9973
10184
|
}
|
|
9974
10185
|
),
|
|
9975
|
-
/* @__PURE__ */ (0,
|
|
10186
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9976
10187
|
Modal_default,
|
|
9977
10188
|
{
|
|
9978
10189
|
isOpen: modalResolutionOpen,
|
|
@@ -9990,40 +10201,40 @@ var QuizBadge = ({
|
|
|
9990
10201
|
}) => {
|
|
9991
10202
|
switch (subtype) {
|
|
9992
10203
|
case "PROVA" /* PROVA */:
|
|
9993
|
-
return /* @__PURE__ */ (0,
|
|
10204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "examsOutlined", action: "exam2", "data-testid": "quiz-badge", children: "Prova" });
|
|
9994
10205
|
case "ENEM_PROVA_1" /* ENEM_PROVA_1 */:
|
|
9995
10206
|
case "ENEM_PROVA_2" /* ENEM_PROVA_2 */:
|
|
9996
|
-
return /* @__PURE__ */ (0,
|
|
10207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "examsOutlined", action: "exam1", "data-testid": "quiz-badge", children: "Enem" });
|
|
9997
10208
|
case "VESTIBULAR" /* VESTIBULAR */:
|
|
9998
|
-
return /* @__PURE__ */ (0,
|
|
10209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "examsOutlined", action: "exam4", "data-testid": "quiz-badge", children: "Vestibular" });
|
|
9999
10210
|
case "SIMULADO" /* SIMULADO */:
|
|
10000
10211
|
case "SIMULADAO" /* SIMULADAO */:
|
|
10001
10212
|
case void 0:
|
|
10002
|
-
return /* @__PURE__ */ (0,
|
|
10213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "examsOutlined", action: "exam3", "data-testid": "quiz-badge", children: "Simulad\xE3o" });
|
|
10003
10214
|
default:
|
|
10004
|
-
return /* @__PURE__ */ (0,
|
|
10215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
10005
10216
|
}
|
|
10006
10217
|
};
|
|
10007
|
-
var QuizResultHeaderTitle = (0,
|
|
10218
|
+
var QuizResultHeaderTitle = (0, import_react30.forwardRef)(({ className, ...props }, ref) => {
|
|
10008
10219
|
const { getActiveQuiz } = useQuizStore();
|
|
10009
10220
|
const activeQuiz = getActiveQuiz();
|
|
10010
|
-
return /* @__PURE__ */ (0,
|
|
10221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10011
10222
|
"div",
|
|
10012
10223
|
{
|
|
10013
10224
|
ref,
|
|
10014
10225
|
className: cn("flex flex-row pt-4 justify-between", className),
|
|
10015
10226
|
...props,
|
|
10016
10227
|
children: [
|
|
10017
|
-
/* @__PURE__ */ (0,
|
|
10018
|
-
/* @__PURE__ */ (0,
|
|
10228
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
10229
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(QuizBadge, { subtype: activeQuiz?.quiz.subtype || void 0 })
|
|
10019
10230
|
]
|
|
10020
10231
|
}
|
|
10021
10232
|
);
|
|
10022
10233
|
});
|
|
10023
|
-
var QuizResultTitle = (0,
|
|
10234
|
+
var QuizResultTitle = (0, import_react30.forwardRef)(({ className, ...props }, ref) => {
|
|
10024
10235
|
const { getQuizTitle } = useQuizStore();
|
|
10025
10236
|
const quizTitle = getQuizTitle();
|
|
10026
|
-
return /* @__PURE__ */ (0,
|
|
10237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10027
10238
|
"p",
|
|
10028
10239
|
{
|
|
10029
10240
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -10033,7 +10244,7 @@ var QuizResultTitle = (0, import_react29.forwardRef)(({ className, ...props }, r
|
|
|
10033
10244
|
}
|
|
10034
10245
|
);
|
|
10035
10246
|
});
|
|
10036
|
-
var QuizResultPerformance = (0,
|
|
10247
|
+
var QuizResultPerformance = (0, import_react30.forwardRef)(
|
|
10037
10248
|
({ ...props }, ref) => {
|
|
10038
10249
|
const {
|
|
10039
10250
|
getTotalQuestions,
|
|
@@ -10075,15 +10286,15 @@ var QuizResultPerformance = (0, import_react29.forwardRef)(
|
|
|
10075
10286
|
});
|
|
10076
10287
|
}
|
|
10077
10288
|
const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
|
|
10078
|
-
return /* @__PURE__ */ (0,
|
|
10289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10079
10290
|
"div",
|
|
10080
10291
|
{
|
|
10081
10292
|
className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
|
|
10082
10293
|
ref,
|
|
10083
10294
|
...props,
|
|
10084
10295
|
children: [
|
|
10085
|
-
/* @__PURE__ */ (0,
|
|
10086
|
-
/* @__PURE__ */ (0,
|
|
10296
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", children: [
|
|
10297
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10087
10298
|
ProgressCircle_default,
|
|
10088
10299
|
{
|
|
10089
10300
|
size: "medium",
|
|
@@ -10093,24 +10304,24 @@ var QuizResultPerformance = (0, import_react29.forwardRef)(
|
|
|
10093
10304
|
label: ""
|
|
10094
10305
|
}
|
|
10095
10306
|
),
|
|
10096
|
-
/* @__PURE__ */ (0,
|
|
10097
|
-
/* @__PURE__ */ (0,
|
|
10098
|
-
/* @__PURE__ */ (0,
|
|
10099
|
-
/* @__PURE__ */ (0,
|
|
10307
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
10308
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
10309
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react20.Clock, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
10310
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(
|
|
10100
10311
|
(getQuestionResultStatistics()?.timeSpent ?? 0) * 60
|
|
10101
10312
|
) })
|
|
10102
10313
|
] }),
|
|
10103
|
-
/* @__PURE__ */ (0,
|
|
10314
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
10104
10315
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
10105
10316
|
" de",
|
|
10106
10317
|
" ",
|
|
10107
10318
|
totalQuestions
|
|
10108
10319
|
] }),
|
|
10109
|
-
/* @__PURE__ */ (0,
|
|
10320
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
10110
10321
|
] })
|
|
10111
10322
|
] }),
|
|
10112
|
-
/* @__PURE__ */ (0,
|
|
10113
|
-
/* @__PURE__ */ (0,
|
|
10323
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
10324
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10114
10325
|
ProgressBar_default,
|
|
10115
10326
|
{
|
|
10116
10327
|
className: "w-full",
|
|
@@ -10124,7 +10335,7 @@ var QuizResultPerformance = (0, import_react29.forwardRef)(
|
|
|
10124
10335
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
10125
10336
|
}
|
|
10126
10337
|
),
|
|
10127
|
-
/* @__PURE__ */ (0,
|
|
10338
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10128
10339
|
ProgressBar_default,
|
|
10129
10340
|
{
|
|
10130
10341
|
className: "w-full",
|
|
@@ -10138,7 +10349,7 @@ var QuizResultPerformance = (0, import_react29.forwardRef)(
|
|
|
10138
10349
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
10139
10350
|
}
|
|
10140
10351
|
),
|
|
10141
|
-
/* @__PURE__ */ (0,
|
|
10352
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10142
10353
|
ProgressBar_default,
|
|
10143
10354
|
{
|
|
10144
10355
|
className: "w-full",
|
|
@@ -10158,7 +10369,7 @@ var QuizResultPerformance = (0, import_react29.forwardRef)(
|
|
|
10158
10369
|
);
|
|
10159
10370
|
}
|
|
10160
10371
|
);
|
|
10161
|
-
var QuizListResult = (0,
|
|
10372
|
+
var QuizListResult = (0, import_react30.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
10162
10373
|
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
10163
10374
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
10164
10375
|
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
@@ -10185,9 +10396,9 @@ var QuizListResult = (0, import_react29.forwardRef)(({ className, onSubjectClick
|
|
|
10185
10396
|
};
|
|
10186
10397
|
}
|
|
10187
10398
|
);
|
|
10188
|
-
return /* @__PURE__ */ (0,
|
|
10189
|
-
/* @__PURE__ */ (0,
|
|
10190
|
-
/* @__PURE__ */ (0,
|
|
10399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { ref, className, ...props, children: [
|
|
10400
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
10401
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10191
10402
|
CardResults,
|
|
10192
10403
|
{
|
|
10193
10404
|
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
@@ -10209,16 +10420,16 @@ var QuizListResultByMateria = ({
|
|
|
10209
10420
|
const { getQuestionsGroupedBySubject, getQuestionIndex } = useQuizStore();
|
|
10210
10421
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
10211
10422
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
10212
|
-
return /* @__PURE__ */ (0,
|
|
10213
|
-
/* @__PURE__ */ (0,
|
|
10214
|
-
/* @__PURE__ */ (0,
|
|
10215
|
-
/* @__PURE__ */ (0,
|
|
10216
|
-
/* @__PURE__ */ (0,
|
|
10423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col", children: [
|
|
10424
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: answeredQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" }) }),
|
|
10425
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "flex flex-col ", children: [
|
|
10426
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
10427
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
10217
10428
|
const questionIndex = getQuestionIndex(
|
|
10218
10429
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10219
10430
|
question.questionId ?? question.id
|
|
10220
10431
|
);
|
|
10221
|
-
return /* @__PURE__ */ (0,
|
|
10432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10222
10433
|
CardStatus,
|
|
10223
10434
|
{
|
|
10224
10435
|
className: "max-w-full",
|
|
@@ -10241,12 +10452,12 @@ var QuizListResultByMateria = ({
|
|
|
10241
10452
|
};
|
|
10242
10453
|
|
|
10243
10454
|
// src/components/LoadingModal/loadingModal.tsx
|
|
10244
|
-
var
|
|
10245
|
-
var
|
|
10246
|
-
var LoadingModal = (0,
|
|
10455
|
+
var import_react31 = require("react");
|
|
10456
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
10457
|
+
var LoadingModal = (0, import_react31.forwardRef)(
|
|
10247
10458
|
({ open, title = "Titulo...", subtitle = "Subtitulo...", ...props }, ref) => {
|
|
10248
10459
|
if (!open) return null;
|
|
10249
|
-
return /* @__PURE__ */ (0,
|
|
10460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
10250
10461
|
"div",
|
|
10251
10462
|
{
|
|
10252
10463
|
ref,
|
|
@@ -10255,8 +10466,8 @@ var LoadingModal = (0, import_react30.forwardRef)(
|
|
|
10255
10466
|
"aria-describedby": "loading-modal-subtitle",
|
|
10256
10467
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-background/90 backdrop-blur-xs",
|
|
10257
10468
|
...props,
|
|
10258
|
-
children: /* @__PURE__ */ (0,
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-full max-w-[364px] flex flex-col items-center justify-center gap-14", children: [
|
|
10470
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "animate-spin", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
10260
10471
|
"svg",
|
|
10261
10472
|
{
|
|
10262
10473
|
width: "102",
|
|
@@ -10267,14 +10478,14 @@ var LoadingModal = (0, import_react30.forwardRef)(
|
|
|
10267
10478
|
"aria-hidden": "true",
|
|
10268
10479
|
focusable: false,
|
|
10269
10480
|
children: [
|
|
10270
|
-
/* @__PURE__ */ (0,
|
|
10481
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
10271
10482
|
"path",
|
|
10272
10483
|
{
|
|
10273
10484
|
d: "M101.5 51C101.5 78.8904 78.8904 101.5 51 101.5C23.1096 101.5 0.5 78.8904 0.5 51C0.5 23.1096 23.1096 0.5 51 0.5C78.8904 0.5 101.5 23.1096 101.5 51ZM8.62286 51C8.62286 74.4043 27.5957 93.3771 51 93.3771C74.4043 93.3771 93.3771 74.4043 93.3771 51C93.3771 27.5957 74.4043 8.62286 51 8.62286C27.5957 8.62286 8.62286 27.5957 8.62286 51Z",
|
|
10274
10485
|
className: "fill-primary-100"
|
|
10275
10486
|
}
|
|
10276
10487
|
),
|
|
10277
|
-
/* @__PURE__ */ (0,
|
|
10488
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
10278
10489
|
"path",
|
|
10279
10490
|
{
|
|
10280
10491
|
d: "M97.4386 51C99.6816 51 101.517 52.8213 101.337 55.0571C100.754 62.2833 98.6212 69.3162 95.0643 75.6696C90.8444 83.207 84.7616 89.536 77.3975 94.0514C70.0333 98.5668 61.6339 101.118 53.0024 101.46C44.371 101.803 35.7959 99.9255 28.0971 96.0078C20.3982 92.0902 13.833 86.2631 9.02917 79.0838C4.22529 71.9045 1.34332 63.6129 0.658804 55.0017C-0.0257159 46.3906 1.51009 37.7479 5.1194 29.8997C8.16173 23.2845 12.5915 17.4202 18.0904 12.6959C19.7917 11.2341 22.3444 11.6457 23.6647 13.459C24.9851 15.2723 24.5702 17.7988 22.8916 19.2866C18.5048 23.1747 14.9608 27.9413 12.4992 33.2937C9.47048 39.8794 8.1817 47.132 8.75612 54.3581C9.33053 61.5841 11.7489 68.542 15.7801 74.5666C19.8113 80.5911 25.3205 85.4809 31.781 88.7684C38.2414 92.0559 45.4372 93.6312 52.6804 93.3438C59.9235 93.0564 66.9718 90.9158 73.1515 87.1267C79.3311 83.3375 84.4355 78.0266 87.9766 71.7015C90.8546 66.561 92.6217 60.8903 93.1827 55.0553C93.3973 52.8225 95.1955 51 97.4386 51Z",
|
|
@@ -10284,9 +10495,9 @@ var LoadingModal = (0, import_react30.forwardRef)(
|
|
|
10284
10495
|
]
|
|
10285
10496
|
}
|
|
10286
10497
|
) }),
|
|
10287
|
-
/* @__PURE__ */ (0,
|
|
10288
|
-
/* @__PURE__ */ (0,
|
|
10289
|
-
/* @__PURE__ */ (0,
|
|
10498
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "flex flex-col gap-4 text-center", children: [
|
|
10499
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { id: "loading-modal-title", className: "text-text-950 text-lg", children: title }),
|
|
10500
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { id: "loading-modal-subtitle", className: "text-text-600 text-lg", children: subtitle })
|
|
10290
10501
|
] })
|
|
10291
10502
|
] })
|
|
10292
10503
|
}
|
|
@@ -10297,7 +10508,7 @@ var loadingModal_default = LoadingModal;
|
|
|
10297
10508
|
|
|
10298
10509
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
10299
10510
|
var import_phosphor_react21 = require("phosphor-react");
|
|
10300
|
-
var
|
|
10511
|
+
var import_react32 = require("react");
|
|
10301
10512
|
|
|
10302
10513
|
// src/store/notificationStore.ts
|
|
10303
10514
|
var import_zustand8 = require("zustand");
|
|
@@ -10540,14 +10751,14 @@ var createNotificationStore = (apiClient) => {
|
|
|
10540
10751
|
};
|
|
10541
10752
|
|
|
10542
10753
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
10543
|
-
var
|
|
10754
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
10544
10755
|
var NotificationEmpty = ({
|
|
10545
10756
|
emptyStateImage,
|
|
10546
10757
|
emptyStateTitle = "Nenhuma notifica\xE7\xE3o no momento",
|
|
10547
10758
|
emptyStateDescription = "Voc\xEA est\xE1 em dia com todas as novidades. Volte depois para conferir atualiza\xE7\xF5es!"
|
|
10548
10759
|
}) => {
|
|
10549
|
-
return /* @__PURE__ */ (0,
|
|
10550
|
-
emptyStateImage && /* @__PURE__ */ (0,
|
|
10760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col items-center justify-center gap-4 p-6 w-full", children: [
|
|
10761
|
+
emptyStateImage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-20 h-20 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10551
10762
|
"img",
|
|
10552
10763
|
{
|
|
10553
10764
|
src: emptyStateImage,
|
|
@@ -10557,17 +10768,17 @@ var NotificationEmpty = ({
|
|
|
10557
10768
|
className: "object-contain"
|
|
10558
10769
|
}
|
|
10559
10770
|
) }),
|
|
10560
|
-
/* @__PURE__ */ (0,
|
|
10561
|
-
/* @__PURE__ */ (0,
|
|
10771
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { className: "text-xl font-semibold text-text-950 text-center leading-[23px]", children: emptyStateTitle }),
|
|
10772
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-[316px] leading-[21px]", children: emptyStateDescription })
|
|
10562
10773
|
] });
|
|
10563
10774
|
};
|
|
10564
10775
|
var NotificationHeader = ({
|
|
10565
10776
|
unreadCount,
|
|
10566
10777
|
variant = "modal"
|
|
10567
10778
|
}) => {
|
|
10568
|
-
return /* @__PURE__ */ (0,
|
|
10569
|
-
variant === "modal" ? /* @__PURE__ */ (0,
|
|
10570
|
-
unreadCount > 0 && /* @__PURE__ */ (0,
|
|
10779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
10780
|
+
variant === "modal" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950", children: "Notifica\xE7\xF5es" }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { className: "text-sm font-semibold text-text-950", children: "Notifica\xE7\xF5es" }),
|
|
10781
|
+
unreadCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "px-2 py-1 bg-info-100 text-info-700 text-xs rounded-full", children: [
|
|
10571
10782
|
unreadCount,
|
|
10572
10783
|
" n\xE3o lidas"
|
|
10573
10784
|
] })
|
|
@@ -10602,7 +10813,7 @@ var SingleNotificationCard = ({
|
|
|
10602
10813
|
onNavigate();
|
|
10603
10814
|
}
|
|
10604
10815
|
};
|
|
10605
|
-
return /* @__PURE__ */ (0,
|
|
10816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
10606
10817
|
"div",
|
|
10607
10818
|
{
|
|
10608
10819
|
className: cn(
|
|
@@ -10611,20 +10822,20 @@ var SingleNotificationCard = ({
|
|
|
10611
10822
|
className
|
|
10612
10823
|
),
|
|
10613
10824
|
children: [
|
|
10614
|
-
/* @__PURE__ */ (0,
|
|
10615
|
-
!isRead && /* @__PURE__ */ (0,
|
|
10616
|
-
/* @__PURE__ */ (0,
|
|
10617
|
-
/* @__PURE__ */ (0,
|
|
10618
|
-
/* @__PURE__ */ (0,
|
|
10825
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2 w-full", children: [
|
|
10826
|
+
!isRead && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[7px] h-[7px] bg-info-300 rounded-full flex-shrink-0" }),
|
|
10827
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { className: "font-bold text-sm leading-4 text-text-950 flex-grow", children: title }),
|
|
10828
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DropdownMenu_default, { children: [
|
|
10829
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10619
10830
|
DropdownMenuTrigger,
|
|
10620
10831
|
{
|
|
10621
10832
|
className: "flex-shrink-0 inline-flex items-center justify-center font-medium bg-transparent text-text-950 cursor-pointer hover:bg-info-50 w-6 h-6 rounded-lg",
|
|
10622
10833
|
"aria-label": "Menu de a\xE7\xF5es",
|
|
10623
|
-
children: /* @__PURE__ */ (0,
|
|
10834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react21.DotsThreeVertical, { size: 24 })
|
|
10624
10835
|
}
|
|
10625
10836
|
),
|
|
10626
|
-
/* @__PURE__ */ (0,
|
|
10627
|
-
!isRead && /* @__PURE__ */ (0,
|
|
10837
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DropdownMenuContent, { align: "end", className: "min-w-[160px]", children: [
|
|
10838
|
+
!isRead && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10628
10839
|
DropdownMenuItem,
|
|
10629
10840
|
{
|
|
10630
10841
|
onClick: handleMarkAsRead,
|
|
@@ -10632,14 +10843,14 @@ var SingleNotificationCard = ({
|
|
|
10632
10843
|
children: "Marcar como lida"
|
|
10633
10844
|
}
|
|
10634
10845
|
),
|
|
10635
|
-
/* @__PURE__ */ (0,
|
|
10846
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropdownMenuItem, { onClick: handleDelete, className: "text-error-600", children: "Deletar" })
|
|
10636
10847
|
] })
|
|
10637
10848
|
] })
|
|
10638
10849
|
] }),
|
|
10639
|
-
/* @__PURE__ */ (0,
|
|
10640
|
-
/* @__PURE__ */ (0,
|
|
10641
|
-
/* @__PURE__ */ (0,
|
|
10642
|
-
onNavigate && actionLabel && /* @__PURE__ */ (0,
|
|
10850
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm leading-[21px] text-text-800 w-full", children: message }),
|
|
10851
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between w-full", children: [
|
|
10852
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-sm font-medium text-text-400", children: time }),
|
|
10853
|
+
onNavigate && actionLabel && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10643
10854
|
"button",
|
|
10644
10855
|
{
|
|
10645
10856
|
type: "button",
|
|
@@ -10666,9 +10877,9 @@ var NotificationList = ({
|
|
|
10666
10877
|
className
|
|
10667
10878
|
}) => {
|
|
10668
10879
|
if (error) {
|
|
10669
|
-
return /* @__PURE__ */ (0,
|
|
10670
|
-
/* @__PURE__ */ (0,
|
|
10671
|
-
onRetry && /* @__PURE__ */ (0,
|
|
10880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: [
|
|
10881
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm text-error-600", children: error }),
|
|
10882
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10672
10883
|
"button",
|
|
10673
10884
|
{
|
|
10674
10885
|
type: "button",
|
|
@@ -10680,8 +10891,8 @@ var NotificationList = ({
|
|
|
10680
10891
|
] });
|
|
10681
10892
|
}
|
|
10682
10893
|
if (loading) {
|
|
10683
|
-
return /* @__PURE__ */ (0,
|
|
10684
|
-
(skeletonId) => /* @__PURE__ */ (0,
|
|
10894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex flex-col gap-0 w-full", children: ["skeleton-first", "skeleton-second", "skeleton-third"].map(
|
|
10895
|
+
(skeletonId) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10685
10896
|
SkeletonCard,
|
|
10686
10897
|
{
|
|
10687
10898
|
className: "p-4 border-b border-border-200"
|
|
@@ -10691,11 +10902,11 @@ var NotificationList = ({
|
|
|
10691
10902
|
) });
|
|
10692
10903
|
}
|
|
10693
10904
|
if (!groupedNotifications || groupedNotifications.length === 0) {
|
|
10694
|
-
return renderEmpty ? /* @__PURE__ */ (0,
|
|
10905
|
+
return renderEmpty ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-full", children: renderEmpty() }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(NotificationEmpty, {});
|
|
10695
10906
|
}
|
|
10696
|
-
return /* @__PURE__ */ (0,
|
|
10697
|
-
/* @__PURE__ */ (0,
|
|
10698
|
-
group.notifications.map((notification) => /* @__PURE__ */ (0,
|
|
10907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: cn("flex flex-col gap-0 w-full", className), children: groupedNotifications.map((group, idx) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col", children: [
|
|
10908
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex items-end px-4 py-6 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: "text-lg font-bold text-text-500 flex-grow", children: group.label }) }),
|
|
10909
|
+
group.notifications.map((notification) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10699
10910
|
SingleNotificationCard,
|
|
10700
10911
|
{
|
|
10701
10912
|
title: notification.title,
|
|
@@ -10736,7 +10947,7 @@ var NotificationCenter = ({
|
|
|
10736
10947
|
className
|
|
10737
10948
|
}) => {
|
|
10738
10949
|
const { isMobile } = useMobile();
|
|
10739
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
10950
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react32.useState)(false);
|
|
10740
10951
|
const handleMobileClick = () => {
|
|
10741
10952
|
setIsModalOpen(true);
|
|
10742
10953
|
onFetchNotifications?.();
|
|
@@ -10744,7 +10955,7 @@ var NotificationCenter = ({
|
|
|
10744
10955
|
const handleDesktopClick = () => {
|
|
10745
10956
|
onToggleActive?.();
|
|
10746
10957
|
};
|
|
10747
|
-
(0,
|
|
10958
|
+
(0, import_react32.useEffect)(() => {
|
|
10748
10959
|
if (isActive) {
|
|
10749
10960
|
onFetchNotifications?.();
|
|
10750
10961
|
}
|
|
@@ -10753,7 +10964,7 @@ var NotificationCenter = ({
|
|
|
10753
10964
|
onCleanup?.();
|
|
10754
10965
|
onNavigateById?.(entityType, entityId);
|
|
10755
10966
|
};
|
|
10756
|
-
const renderEmptyState = () => /* @__PURE__ */ (0,
|
|
10967
|
+
const renderEmptyState = () => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10757
10968
|
NotificationEmpty,
|
|
10758
10969
|
{
|
|
10759
10970
|
emptyStateImage,
|
|
@@ -10762,17 +10973,17 @@ var NotificationCenter = ({
|
|
|
10762
10973
|
}
|
|
10763
10974
|
);
|
|
10764
10975
|
if (isMobile) {
|
|
10765
|
-
return /* @__PURE__ */ (0,
|
|
10766
|
-
/* @__PURE__ */ (0,
|
|
10976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
10977
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10767
10978
|
IconButton_default,
|
|
10768
10979
|
{
|
|
10769
10980
|
active: isModalOpen,
|
|
10770
10981
|
onClick: handleMobileClick,
|
|
10771
|
-
icon: /* @__PURE__ */ (0,
|
|
10982
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react21.Bell, { size: 24, className: "text-primary" }),
|
|
10772
10983
|
className
|
|
10773
10984
|
}
|
|
10774
10985
|
),
|
|
10775
|
-
/* @__PURE__ */ (0,
|
|
10986
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10776
10987
|
Modal_default,
|
|
10777
10988
|
{
|
|
10778
10989
|
isOpen: isModalOpen,
|
|
@@ -10782,10 +10993,10 @@ var NotificationCenter = ({
|
|
|
10782
10993
|
hideCloseButton: false,
|
|
10783
10994
|
closeOnBackdropClick: true,
|
|
10784
10995
|
closeOnEscape: true,
|
|
10785
|
-
children: /* @__PURE__ */ (0,
|
|
10786
|
-
/* @__PURE__ */ (0,
|
|
10787
|
-
/* @__PURE__ */ (0,
|
|
10788
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0,
|
|
10996
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col h-full max-h-[80vh]", children: [
|
|
10997
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "px-0 pb-3 border-b border-border-200", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
10998
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(NotificationHeader, { unreadCount, variant: "modal" }),
|
|
10999
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10789
11000
|
"button",
|
|
10790
11001
|
{
|
|
10791
11002
|
type: "button",
|
|
@@ -10795,7 +11006,7 @@ var NotificationCenter = ({
|
|
|
10795
11006
|
}
|
|
10796
11007
|
)
|
|
10797
11008
|
] }) }),
|
|
10798
|
-
/* @__PURE__ */ (0,
|
|
11009
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10799
11010
|
NotificationList,
|
|
10800
11011
|
{
|
|
10801
11012
|
groupedNotifications,
|
|
@@ -10818,13 +11029,13 @@ var NotificationCenter = ({
|
|
|
10818
11029
|
)
|
|
10819
11030
|
] });
|
|
10820
11031
|
}
|
|
10821
|
-
return /* @__PURE__ */ (0,
|
|
10822
|
-
/* @__PURE__ */ (0,
|
|
11032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DropdownMenu_default, { children: [
|
|
11033
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropdownMenuTrigger, { className: "text-primary cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10823
11034
|
IconButton_default,
|
|
10824
11035
|
{
|
|
10825
11036
|
active: isActive,
|
|
10826
11037
|
onClick: handleDesktopClick,
|
|
10827
|
-
icon: /* @__PURE__ */ (0,
|
|
11038
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10828
11039
|
import_phosphor_react21.Bell,
|
|
10829
11040
|
{
|
|
10830
11041
|
size: 24,
|
|
@@ -10834,22 +11045,22 @@ var NotificationCenter = ({
|
|
|
10834
11045
|
className
|
|
10835
11046
|
}
|
|
10836
11047
|
) }),
|
|
10837
|
-
/* @__PURE__ */ (0,
|
|
11048
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10838
11049
|
DropdownMenuContent,
|
|
10839
11050
|
{
|
|
10840
11051
|
className: "min-w-[320px] max-w-[400px] max-h-[500px] overflow-hidden",
|
|
10841
11052
|
side: "bottom",
|
|
10842
11053
|
align: "end",
|
|
10843
|
-
children: /* @__PURE__ */ (0,
|
|
10844
|
-
/* @__PURE__ */ (0,
|
|
10845
|
-
/* @__PURE__ */ (0,
|
|
11054
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col", children: [
|
|
11055
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "px-4 py-3 border-b border-border-200", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10846
11057
|
NotificationHeader,
|
|
10847
11058
|
{
|
|
10848
11059
|
unreadCount,
|
|
10849
11060
|
variant: "dropdown"
|
|
10850
11061
|
}
|
|
10851
11062
|
),
|
|
10852
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0,
|
|
11063
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10853
11064
|
"button",
|
|
10854
11065
|
{
|
|
10855
11066
|
type: "button",
|
|
@@ -10859,7 +11070,7 @@ var NotificationCenter = ({
|
|
|
10859
11070
|
}
|
|
10860
11071
|
)
|
|
10861
11072
|
] }) }),
|
|
10862
|
-
/* @__PURE__ */ (0,
|
|
11073
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10863
11074
|
NotificationList,
|
|
10864
11075
|
{
|
|
10865
11076
|
groupedNotifications,
|
|
@@ -10881,7 +11092,7 @@ var NotificationCenter = ({
|
|
|
10881
11092
|
var NotificationCard = (props) => {
|
|
10882
11093
|
switch (props.mode) {
|
|
10883
11094
|
case "single":
|
|
10884
|
-
return /* @__PURE__ */ (0,
|
|
11095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10885
11096
|
SingleNotificationCard,
|
|
10886
11097
|
{
|
|
10887
11098
|
title: props.title,
|
|
@@ -10896,7 +11107,7 @@ var NotificationCard = (props) => {
|
|
|
10896
11107
|
}
|
|
10897
11108
|
);
|
|
10898
11109
|
case "list":
|
|
10899
|
-
return /* @__PURE__ */ (0,
|
|
11110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10900
11111
|
NotificationList,
|
|
10901
11112
|
{
|
|
10902
11113
|
groupedNotifications: props.groupedNotifications ?? (props.notifications ? [
|
|
@@ -10917,9 +11128,9 @@ var NotificationCard = (props) => {
|
|
|
10917
11128
|
}
|
|
10918
11129
|
);
|
|
10919
11130
|
case "center":
|
|
10920
|
-
return /* @__PURE__ */ (0,
|
|
11131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(NotificationCenter, { ...props });
|
|
10921
11132
|
default:
|
|
10922
|
-
return /* @__PURE__ */ (0,
|
|
11133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm text-text-600", children: "Modo de notifica\xE7\xE3o n\xE3o reconhecido" }) });
|
|
10923
11134
|
}
|
|
10924
11135
|
};
|
|
10925
11136
|
var NotificationCard_default = NotificationCard;
|
|
@@ -10930,7 +11141,7 @@ var createUseNotificationStore = (apiClient) => {
|
|
|
10930
11141
|
};
|
|
10931
11142
|
|
|
10932
11143
|
// src/hooks/useNotifications.ts
|
|
10933
|
-
var
|
|
11144
|
+
var import_react33 = require("react");
|
|
10934
11145
|
var createUseNotifications = (apiClient) => {
|
|
10935
11146
|
const useNotificationStore = createUseNotificationStore(apiClient);
|
|
10936
11147
|
return () => {
|
|
@@ -10949,7 +11160,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
10949
11160
|
resetError,
|
|
10950
11161
|
getGroupedNotifications
|
|
10951
11162
|
} = useNotificationStore();
|
|
10952
|
-
const handleNavigate = (0,
|
|
11163
|
+
const handleNavigate = (0, import_react33.useCallback)(
|
|
10953
11164
|
(entityType, entityId, onAfterNavigate) => {
|
|
10954
11165
|
if (entityType && entityId) {
|
|
10955
11166
|
switch (entityType.toUpperCase()) {
|
|
@@ -10967,7 +11178,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
10967
11178
|
},
|
|
10968
11179
|
[]
|
|
10969
11180
|
);
|
|
10970
|
-
const getActionLabel = (0,
|
|
11181
|
+
const getActionLabel = (0, import_react33.useCallback)(
|
|
10971
11182
|
(entityType) => {
|
|
10972
11183
|
if (!entityType) return void 0;
|
|
10973
11184
|
switch (entityType.toUpperCase()) {
|
|
@@ -10981,7 +11192,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
10981
11192
|
},
|
|
10982
11193
|
[]
|
|
10983
11194
|
);
|
|
10984
|
-
const markAsReadAndNavigate = (0,
|
|
11195
|
+
const markAsReadAndNavigate = (0, import_react33.useCallback)(
|
|
10985
11196
|
async (id, entityType, entityId, onAfterNavigate) => {
|
|
10986
11197
|
await markAsRead(id);
|
|
10987
11198
|
if (entityType && entityId) {
|
|
@@ -10990,11 +11201,11 @@ var createUseNotifications = (apiClient) => {
|
|
|
10990
11201
|
},
|
|
10991
11202
|
[markAsRead, handleNavigate]
|
|
10992
11203
|
);
|
|
10993
|
-
const refreshNotifications = (0,
|
|
11204
|
+
const refreshNotifications = (0, import_react33.useCallback)(async () => {
|
|
10994
11205
|
resetError();
|
|
10995
11206
|
await fetchNotifications();
|
|
10996
11207
|
}, [resetError, fetchNotifications]);
|
|
10997
|
-
const formatNotification = (0,
|
|
11208
|
+
const formatNotification = (0, import_react33.useCallback)(
|
|
10998
11209
|
(notification) => ({
|
|
10999
11210
|
...notification,
|
|
11000
11211
|
time: formatTimeAgo(notification.createdAt),
|
|
@@ -11003,7 +11214,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
11003
11214
|
}),
|
|
11004
11215
|
[]
|
|
11005
11216
|
);
|
|
11006
|
-
const getFormattedGroupedNotifications = (0,
|
|
11217
|
+
const getFormattedGroupedNotifications = (0, import_react33.useCallback)(() => {
|
|
11007
11218
|
const groups = getGroupedNotifications();
|
|
11008
11219
|
return groups.map((group) => ({
|
|
11009
11220
|
...group,
|
|
@@ -11139,6 +11350,7 @@ var createNotificationsHook = (apiClient) => {
|
|
|
11139
11350
|
Table,
|
|
11140
11351
|
Text,
|
|
11141
11352
|
TextArea,
|
|
11353
|
+
ThemeToggle,
|
|
11142
11354
|
Toast,
|
|
11143
11355
|
Toaster,
|
|
11144
11356
|
VideoPlayer,
|