@questpie/admin 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/components/blocks/block-editor-layout.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +89 -61
- package/dist/client/components/media/media-grid.mjs +95 -78
- package/dist/client/components/primitives/select-multi.mjs +388 -368
- package/dist/client/components/primitives/select-single.mjs +344 -331
- package/dist/client/components/widgets/chart-widget.mjs +78 -62
- package/dist/client/components/widgets/progress-widget.mjs +39 -37
- package/dist/client/components/widgets/quick-actions-widget.mjs +111 -90
- package/dist/client/components/widgets/recent-items-widget.mjs +40 -38
- package/dist/client/components/widgets/table-widget.mjs +4 -3
- package/dist/client/components/widgets/timeline-widget.mjs +92 -74
- package/dist/client/components/widgets/value-widget.mjs +164 -144
- package/dist/client/hooks/use-server-actions.mjs +21 -16
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-banner.mjs +75 -46
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/table-view.mjs +26 -26
- package/dist/client/views/layout/admin-layout.mjs +151 -131
- package/dist/client/views/layout/admin-router.mjs +297 -180
- package/dist/client/views/layout/admin-sidebar.mjs +126 -116
- package/dist/client/views/pages/login-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +67 -51
- package/dist/server/i18n/index.mjs +13 -7
- package/dist/server/i18n/messages/cs.mjs +391 -1
- package/dist/server/i18n/messages/de.mjs +389 -1
- package/dist/server/i18n/messages/en.mjs +102 -0
- package/dist/server/i18n/messages/es.mjs +389 -1
- package/dist/server/i18n/messages/fr.mjs +389 -1
- package/dist/server/i18n/messages/pl.mjs +393 -1
- package/dist/server/i18n/messages/pt.mjs +386 -1
- package/dist/server/i18n/messages/sk.mjs +133 -1
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +41 -41
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +32 -32
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +34 -28
- package/dist/server/modules/admin/routes/i18n-helpers.mjs +34 -0
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/preview.mjs +25 -17
- package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
- package/dist/server/modules/admin/routes/setup.mjs +10 -7
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/package.json +3 -3
|
@@ -1199,7 +1199,7 @@ function _temp5(e) {
|
|
|
1199
1199
|
e.currentTarget.style.display = "none";
|
|
1200
1200
|
}
|
|
1201
1201
|
function AdminSidebar(t0) {
|
|
1202
|
-
const $ = c(
|
|
1202
|
+
const $ = c(98);
|
|
1203
1203
|
const { LinkComponent, activeRoute, basePath: t1, brandName: brandNameProp, className, renderBrand, renderNavItem, footer, onSearchOpen, afterBrand, beforeFooter, theme, setTheme, showThemeToggle, useActiveProps: t2 } = t0;
|
|
1204
1204
|
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
1205
1205
|
const useActiveProps = t2 === void 0 ? true : t2;
|
|
@@ -1210,6 +1210,7 @@ function AdminSidebar(t0) {
|
|
|
1210
1210
|
$[1] = t3;
|
|
1211
1211
|
} else t3 = $[1];
|
|
1212
1212
|
const { navigation, brandName } = useSidebarProps(t3);
|
|
1213
|
+
const { t } = useTranslation();
|
|
1213
1214
|
const { state, isMobile, setOpenMobile, toggleSidebar } = useSidebar();
|
|
1214
1215
|
const collapsed = state === "collapsed";
|
|
1215
1216
|
const currentActiveRoute = activeRoute ?? (typeof window !== "undefined" ? window.location.pathname : void 0);
|
|
@@ -1315,43 +1316,44 @@ function AdminSidebar(t0) {
|
|
|
1315
1316
|
} else t14 = $[28];
|
|
1316
1317
|
const brandLink = t14;
|
|
1317
1318
|
let t15;
|
|
1318
|
-
if ($[29] !== onSearchOpen) {
|
|
1319
|
+
if ($[29] !== onSearchOpen || $[30] !== t) {
|
|
1319
1320
|
t15 = onSearchOpen && /* @__PURE__ */ jsx(Button, {
|
|
1320
1321
|
type: "button",
|
|
1321
1322
|
variant: "ghost",
|
|
1322
1323
|
size: "icon-xs",
|
|
1323
1324
|
className: "text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",
|
|
1324
1325
|
onClick: onSearchOpen,
|
|
1325
|
-
title: "
|
|
1326
|
-
"aria-label": "
|
|
1326
|
+
title: t("common.search"),
|
|
1327
|
+
"aria-label": t("common.search"),
|
|
1327
1328
|
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
|
|
1328
1329
|
});
|
|
1329
1330
|
$[29] = onSearchOpen;
|
|
1330
|
-
$[30] =
|
|
1331
|
-
|
|
1331
|
+
$[30] = t;
|
|
1332
|
+
$[31] = t15;
|
|
1333
|
+
} else t15 = $[31];
|
|
1332
1334
|
let t16;
|
|
1333
|
-
if ($[
|
|
1335
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1334
1336
|
t16 = /* @__PURE__ */ jsx(SidebarTrigger, { className: "text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground" });
|
|
1335
|
-
$[
|
|
1336
|
-
} else t16 = $[
|
|
1337
|
+
$[32] = t16;
|
|
1338
|
+
} else t16 = $[32];
|
|
1337
1339
|
let t17;
|
|
1338
|
-
if ($[
|
|
1340
|
+
if ($[33] !== t15) {
|
|
1339
1341
|
t17 = /* @__PURE__ */ jsxs("div", {
|
|
1340
1342
|
className: "qa-sidebar__header-actions flex shrink-0 items-center gap-1",
|
|
1341
1343
|
children: [t15, t16]
|
|
1342
1344
|
});
|
|
1343
|
-
$[
|
|
1344
|
-
$[
|
|
1345
|
-
} else t17 = $[
|
|
1345
|
+
$[33] = t15;
|
|
1346
|
+
$[34] = t17;
|
|
1347
|
+
} else t17 = $[34];
|
|
1346
1348
|
const sidebarActions = t17;
|
|
1347
1349
|
let t18;
|
|
1348
|
-
if ($[
|
|
1350
|
+
if ($[35] !== className) {
|
|
1349
1351
|
t18 = cn("qa-sidebar bg-sidebar relative border-none", className);
|
|
1350
|
-
$[
|
|
1351
|
-
$[
|
|
1352
|
-
} else t18 = $[
|
|
1352
|
+
$[35] = className;
|
|
1353
|
+
$[36] = t18;
|
|
1354
|
+
} else t18 = $[36];
|
|
1353
1355
|
let t19;
|
|
1354
|
-
if ($[
|
|
1356
|
+
if ($[37] !== LinkComponent || $[38] !== basePath || $[39] !== brandLink || $[40] !== brandName || $[41] !== collapsed || $[42] !== isMobile || $[43] !== renderBrandContent) {
|
|
1355
1357
|
t19 = collapsed && !isMobile ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(LinkComponent, {
|
|
1356
1358
|
to: basePath,
|
|
1357
1359
|
className: cn("flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", "justify-center"),
|
|
@@ -1360,17 +1362,17 @@ function AdminSidebar(t0) {
|
|
|
1360
1362
|
side: "right",
|
|
1361
1363
|
children: brandName
|
|
1362
1364
|
})] }) : brandLink;
|
|
1363
|
-
$[
|
|
1364
|
-
$[
|
|
1365
|
-
$[
|
|
1366
|
-
$[
|
|
1367
|
-
$[
|
|
1368
|
-
$[
|
|
1369
|
-
$[
|
|
1370
|
-
$[
|
|
1371
|
-
} else t19 = $[
|
|
1365
|
+
$[37] = LinkComponent;
|
|
1366
|
+
$[38] = basePath;
|
|
1367
|
+
$[39] = brandLink;
|
|
1368
|
+
$[40] = brandName;
|
|
1369
|
+
$[41] = collapsed;
|
|
1370
|
+
$[42] = isMobile;
|
|
1371
|
+
$[43] = renderBrandContent;
|
|
1372
|
+
$[44] = t19;
|
|
1373
|
+
} else t19 = $[44];
|
|
1372
1374
|
let t20;
|
|
1373
|
-
if ($[
|
|
1375
|
+
if ($[45] !== handleBrandClick || $[46] !== t19) {
|
|
1374
1376
|
t20 = /* @__PURE__ */ jsx(SidebarMenu, {
|
|
1375
1377
|
className: "min-w-0 flex-1",
|
|
1376
1378
|
children: /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
@@ -1378,23 +1380,23 @@ function AdminSidebar(t0) {
|
|
|
1378
1380
|
children: t19
|
|
1379
1381
|
})
|
|
1380
1382
|
});
|
|
1381
|
-
$[
|
|
1382
|
-
$[
|
|
1383
|
-
$[
|
|
1384
|
-
} else t20 = $[
|
|
1383
|
+
$[45] = handleBrandClick;
|
|
1384
|
+
$[46] = t19;
|
|
1385
|
+
$[47] = t20;
|
|
1386
|
+
} else t20 = $[47];
|
|
1385
1387
|
const t21 = !collapsed && sidebarActions;
|
|
1386
1388
|
let t22;
|
|
1387
|
-
if ($[
|
|
1389
|
+
if ($[48] !== t20 || $[49] !== t21) {
|
|
1388
1390
|
t22 = /* @__PURE__ */ jsxs(SidebarHeader, {
|
|
1389
1391
|
className: "qa-sidebar__header h-auto flex-row items-center gap-2 border-none px-3 pt-3 pb-1",
|
|
1390
1392
|
children: [t20, t21]
|
|
1391
1393
|
});
|
|
1392
|
-
$[
|
|
1393
|
-
$[
|
|
1394
|
-
$[
|
|
1395
|
-
} else t22 = $[
|
|
1394
|
+
$[48] = t20;
|
|
1395
|
+
$[49] = t21;
|
|
1396
|
+
$[50] = t22;
|
|
1397
|
+
} else t22 = $[50];
|
|
1396
1398
|
let t23;
|
|
1397
|
-
if ($[
|
|
1399
|
+
if ($[51] !== collapsed || $[52] !== isMobile || $[53] !== onSearchOpen || $[54] !== t || $[55] !== toggleSidebar) {
|
|
1398
1400
|
t23 = collapsed && !isMobile && /* @__PURE__ */ jsxs("div", {
|
|
1399
1401
|
className: "qa-sidebar__collapsed-peek group/peek absolute top-4 -right-3 z-50 flex items-center",
|
|
1400
1402
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
@@ -1403,46 +1405,53 @@ function AdminSidebar(t0) {
|
|
|
1403
1405
|
size: "icon-xs",
|
|
1404
1406
|
className: "border-sidebar-border/70 bg-sidebar text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground h-8 w-3 rounded-l-none rounded-r-md border border-l-0 p-0 shadow-[var(--floating-shadow)]",
|
|
1405
1407
|
onClick: toggleSidebar,
|
|
1406
|
-
"aria-label": "
|
|
1408
|
+
"aria-label": t("ui.expandSidebar"),
|
|
1407
1409
|
children: /* @__PURE__ */ jsx("span", { className: "h-3 w-0.5 rounded-full bg-current opacity-55" })
|
|
1408
1410
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1409
1411
|
className: "floating-surface ml-1 flex scale-95 items-center gap-1 p-1 opacity-0 transition-[opacity,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-enter)] group-focus-within/peek:scale-100 group-focus-within/peek:opacity-100 group-hover/peek:scale-100 group-hover/peek:opacity-100 motion-reduce:scale-100 motion-reduce:transition-none",
|
|
1410
1412
|
children: [/* @__PURE__ */ jsx(SidebarTrigger, {
|
|
1411
1413
|
className: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
1412
|
-
"aria-label": "
|
|
1414
|
+
"aria-label": t("ui.expandSidebar")
|
|
1413
1415
|
}), onSearchOpen && /* @__PURE__ */ jsx(Button, {
|
|
1414
1416
|
type: "button",
|
|
1415
1417
|
variant: "ghost",
|
|
1416
1418
|
size: "icon-sm",
|
|
1417
1419
|
className: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
1418
1420
|
onClick: onSearchOpen,
|
|
1419
|
-
title: "
|
|
1420
|
-
"aria-label": "
|
|
1421
|
+
title: t("common.search"),
|
|
1422
|
+
"aria-label": t("common.search"),
|
|
1421
1423
|
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
|
|
1422
1424
|
})]
|
|
1423
1425
|
})]
|
|
1424
1426
|
});
|
|
1425
|
-
$[
|
|
1426
|
-
$[
|
|
1427
|
-
$[
|
|
1428
|
-
$[
|
|
1429
|
-
$[
|
|
1430
|
-
|
|
1427
|
+
$[51] = collapsed;
|
|
1428
|
+
$[52] = isMobile;
|
|
1429
|
+
$[53] = onSearchOpen;
|
|
1430
|
+
$[54] = t;
|
|
1431
|
+
$[55] = toggleSidebar;
|
|
1432
|
+
$[56] = t23;
|
|
1433
|
+
} else t23 = $[56];
|
|
1431
1434
|
let t24;
|
|
1432
|
-
if ($[
|
|
1435
|
+
if ($[57] !== afterBrand || $[58] !== collapsed) {
|
|
1433
1436
|
t24 = afterBrand && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
1434
1437
|
className: "qa-sidebar__after-brand border-sidebar-border/70 border-b px-3 py-2",
|
|
1435
1438
|
children: afterBrand
|
|
1436
1439
|
});
|
|
1437
|
-
$[
|
|
1438
|
-
$[
|
|
1439
|
-
$[
|
|
1440
|
-
} else t24 = $[
|
|
1440
|
+
$[57] = afterBrand;
|
|
1441
|
+
$[58] = collapsed;
|
|
1442
|
+
$[59] = t24;
|
|
1443
|
+
} else t24 = $[59];
|
|
1441
1444
|
let t25;
|
|
1442
|
-
if ($[
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1445
|
+
if ($[60] !== t) {
|
|
1446
|
+
t25 = t("nav.adminNavigation");
|
|
1447
|
+
$[60] = t;
|
|
1448
|
+
$[61] = t25;
|
|
1449
|
+
} else t25 = $[61];
|
|
1450
|
+
let t26;
|
|
1451
|
+
if ($[62] !== LinkComponent || $[63] !== basePath || $[64] !== currentActiveRoute || $[65] !== effectiveRenderNavItem || $[66] !== isSectionCollapsed || $[67] !== navigation || $[68] !== toggleSection || $[69] !== useActiveProps) {
|
|
1452
|
+
let t27$1;
|
|
1453
|
+
if ($[71] !== LinkComponent || $[72] !== basePath || $[73] !== currentActiveRoute || $[74] !== effectiveRenderNavItem || $[75] !== isSectionCollapsed || $[76] !== toggleSection || $[77] !== useActiveProps) {
|
|
1454
|
+
t27$1 = (group, index) => /* @__PURE__ */ jsx(NavGroup, {
|
|
1446
1455
|
group,
|
|
1447
1456
|
activeRoute: currentActiveRoute,
|
|
1448
1457
|
LinkComponent,
|
|
@@ -1452,65 +1461,66 @@ function AdminSidebar(t0) {
|
|
|
1452
1461
|
isSectionCollapsed,
|
|
1453
1462
|
toggleSection
|
|
1454
1463
|
}, group.id ?? `group-${index}`);
|
|
1455
|
-
$[
|
|
1456
|
-
$[
|
|
1457
|
-
$[
|
|
1458
|
-
$[
|
|
1459
|
-
$[
|
|
1460
|
-
$[
|
|
1461
|
-
$[
|
|
1462
|
-
$[
|
|
1463
|
-
} else
|
|
1464
|
-
|
|
1465
|
-
$[
|
|
1466
|
-
$[
|
|
1467
|
-
$[
|
|
1468
|
-
$[
|
|
1469
|
-
$[
|
|
1470
|
-
$[
|
|
1471
|
-
$[
|
|
1472
|
-
$[
|
|
1473
|
-
$[
|
|
1474
|
-
} else
|
|
1475
|
-
let
|
|
1476
|
-
if ($[
|
|
1477
|
-
|
|
1464
|
+
$[71] = LinkComponent;
|
|
1465
|
+
$[72] = basePath;
|
|
1466
|
+
$[73] = currentActiveRoute;
|
|
1467
|
+
$[74] = effectiveRenderNavItem;
|
|
1468
|
+
$[75] = isSectionCollapsed;
|
|
1469
|
+
$[76] = toggleSection;
|
|
1470
|
+
$[77] = useActiveProps;
|
|
1471
|
+
$[78] = t27$1;
|
|
1472
|
+
} else t27$1 = $[78];
|
|
1473
|
+
t26 = navigation.map(t27$1);
|
|
1474
|
+
$[62] = LinkComponent;
|
|
1475
|
+
$[63] = basePath;
|
|
1476
|
+
$[64] = currentActiveRoute;
|
|
1477
|
+
$[65] = effectiveRenderNavItem;
|
|
1478
|
+
$[66] = isSectionCollapsed;
|
|
1479
|
+
$[67] = navigation;
|
|
1480
|
+
$[68] = toggleSection;
|
|
1481
|
+
$[69] = useActiveProps;
|
|
1482
|
+
$[70] = t26;
|
|
1483
|
+
} else t26 = $[70];
|
|
1484
|
+
let t27;
|
|
1485
|
+
if ($[79] !== t25 || $[80] !== t26) {
|
|
1486
|
+
t27 = /* @__PURE__ */ jsx(SidebarContent, {
|
|
1478
1487
|
className: "qa-sidebar__content gap-3 px-2 py-3 group-data-[collapsible=icon]:gap-2",
|
|
1479
1488
|
children: /* @__PURE__ */ jsx("nav", {
|
|
1480
|
-
"aria-label":
|
|
1489
|
+
"aria-label": t25,
|
|
1481
1490
|
className: "qa-sidebar__nav",
|
|
1482
|
-
children:
|
|
1491
|
+
children: t26
|
|
1483
1492
|
})
|
|
1484
1493
|
});
|
|
1485
|
-
$[
|
|
1486
|
-
$[
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1494
|
+
$[79] = t25;
|
|
1495
|
+
$[80] = t26;
|
|
1496
|
+
$[81] = t27;
|
|
1497
|
+
} else t27 = $[81];
|
|
1498
|
+
let t28;
|
|
1499
|
+
if ($[82] !== beforeFooter || $[83] !== collapsed) {
|
|
1500
|
+
t28 = beforeFooter && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
1491
1501
|
className: "qa-sidebar__before-footer border-sidebar-border/70 border-t px-3 py-2",
|
|
1492
1502
|
children: beforeFooter
|
|
1493
1503
|
});
|
|
1494
|
-
$[
|
|
1495
|
-
$[
|
|
1496
|
-
$[
|
|
1497
|
-
} else
|
|
1498
|
-
let
|
|
1499
|
-
if ($[
|
|
1500
|
-
|
|
1504
|
+
$[82] = beforeFooter;
|
|
1505
|
+
$[83] = collapsed;
|
|
1506
|
+
$[84] = t28;
|
|
1507
|
+
} else t28 = $[84];
|
|
1508
|
+
let t29;
|
|
1509
|
+
if ($[85] !== footer || $[86] !== setTheme || $[87] !== showThemeToggle || $[88] !== theme) {
|
|
1510
|
+
t29 = footer ?? /* @__PURE__ */ jsx(UserFooter, {
|
|
1501
1511
|
theme,
|
|
1502
1512
|
setTheme,
|
|
1503
1513
|
showThemeToggle
|
|
1504
1514
|
});
|
|
1505
|
-
$[
|
|
1506
|
-
$[
|
|
1507
|
-
$[
|
|
1508
|
-
$[
|
|
1509
|
-
$[
|
|
1510
|
-
} else
|
|
1511
|
-
let
|
|
1512
|
-
if ($[
|
|
1513
|
-
|
|
1515
|
+
$[85] = footer;
|
|
1516
|
+
$[86] = setTheme;
|
|
1517
|
+
$[87] = showThemeToggle;
|
|
1518
|
+
$[88] = theme;
|
|
1519
|
+
$[89] = t29;
|
|
1520
|
+
} else t29 = $[89];
|
|
1521
|
+
let t30;
|
|
1522
|
+
if ($[90] !== t18 || $[91] !== t22 || $[92] !== t23 || $[93] !== t24 || $[94] !== t27 || $[95] !== t28 || $[96] !== t29) {
|
|
1523
|
+
t30 = /* @__PURE__ */ jsxs(Sidebar, {
|
|
1514
1524
|
collapsible: "icon",
|
|
1515
1525
|
variant: "inset",
|
|
1516
1526
|
className: t18,
|
|
@@ -1518,21 +1528,21 @@ function AdminSidebar(t0) {
|
|
|
1518
1528
|
t22,
|
|
1519
1529
|
t23,
|
|
1520
1530
|
t24,
|
|
1521
|
-
t26,
|
|
1522
1531
|
t27,
|
|
1523
|
-
t28
|
|
1532
|
+
t28,
|
|
1533
|
+
t29
|
|
1524
1534
|
]
|
|
1525
1535
|
});
|
|
1526
|
-
$[
|
|
1527
|
-
$[
|
|
1528
|
-
$[
|
|
1529
|
-
$[
|
|
1530
|
-
$[
|
|
1531
|
-
$[
|
|
1532
|
-
$[
|
|
1533
|
-
$[
|
|
1534
|
-
} else
|
|
1535
|
-
return
|
|
1536
|
+
$[90] = t18;
|
|
1537
|
+
$[91] = t22;
|
|
1538
|
+
$[92] = t23;
|
|
1539
|
+
$[93] = t24;
|
|
1540
|
+
$[94] = t27;
|
|
1541
|
+
$[95] = t28;
|
|
1542
|
+
$[96] = t29;
|
|
1543
|
+
$[97] = t30;
|
|
1544
|
+
} else t30 = $[97];
|
|
1545
|
+
return t30;
|
|
1536
1546
|
}
|
|
1537
1547
|
|
|
1538
1548
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/login-page.d.ts
|
|
5
5
|
|
|
@@ -64,6 +64,6 @@ declare function LoginPage({
|
|
|
64
64
|
signUpPath,
|
|
65
65
|
showForgotPassword,
|
|
66
66
|
showSignUp
|
|
67
|
-
}: LoginPageProps):
|
|
67
|
+
}: LoginPageProps): react_jsx_runtime12.JSX.Element;
|
|
68
68
|
//#endregion
|
|
69
69
|
export { LoginPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/reset-password-page.d.ts
|
|
5
5
|
|
|
@@ -58,6 +58,6 @@ declare function ResetPasswordPage({
|
|
|
58
58
|
loginPath,
|
|
59
59
|
minPasswordLength,
|
|
60
60
|
getToken
|
|
61
|
-
}: ResetPasswordPageProps):
|
|
61
|
+
}: ResetPasswordPageProps): react_jsx_runtime11.JSX.Element;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { ResetPasswordPage };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useTranslation } from "../../i18n/hooks.mjs";
|
|
1
2
|
import { selectBasePath, selectBrandName, selectClient, selectNavigate, useAdminStore } from "../../runtime/provider.mjs";
|
|
2
3
|
import { AuthDefaultLogo, AuthLayout } from "../auth/auth-layout.mjs";
|
|
3
4
|
import { SetupForm } from "../auth/setup-form.mjs";
|
|
@@ -28,19 +29,18 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
function SetupPage(t0) {
|
|
31
|
-
const $ = c(
|
|
32
|
-
const { title
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const showLoginLink = t3 === void 0 ? true : t3;
|
|
32
|
+
const $ = c(32);
|
|
33
|
+
const { title, description, logo, redirectTo, loginPath, showLoginLink: t1 } = t0;
|
|
34
|
+
const showLoginLink = t1 === void 0 ? true : t1;
|
|
35
|
+
const { t } = useTranslation();
|
|
36
36
|
const client = useAdminStore(selectClient);
|
|
37
37
|
const navigate = useAdminStore(selectNavigate);
|
|
38
38
|
const basePath = useAdminStore(selectBasePath);
|
|
39
39
|
const brandName = useAdminStore(selectBrandName);
|
|
40
40
|
const [error, setError] = React.useState(null);
|
|
41
|
-
let
|
|
42
|
-
if ($[0] !== basePath || $[1] !== client || $[2] !== navigate || $[3] !== redirectTo) {
|
|
43
|
-
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[0] !== basePath || $[1] !== client || $[2] !== navigate || $[3] !== redirectTo || $[4] !== t) {
|
|
43
|
+
t2 = async (values) => {
|
|
44
44
|
setError(null);
|
|
45
45
|
const successRedirect = redirectTo !== void 0 ? redirectTo : `${basePath}/login`;
|
|
46
46
|
try {
|
|
@@ -51,87 +51,103 @@ function SetupPage(t0) {
|
|
|
51
51
|
});
|
|
52
52
|
if (!result.success) {
|
|
53
53
|
if (result.error) setError(result.error);
|
|
54
|
-
else setError("
|
|
54
|
+
else setError(t("error.failedToCreateAdminAccount"));
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
navigate(successRedirect);
|
|
58
|
-
} catch (
|
|
59
|
-
const err =
|
|
58
|
+
} catch (t3$1) {
|
|
59
|
+
const err = t3$1;
|
|
60
60
|
if (err instanceof Error) setError(err.message);
|
|
61
|
-
else setError("
|
|
61
|
+
else setError(t("error.anErrorOccurred"));
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
$[0] = basePath;
|
|
65
65
|
$[1] = client;
|
|
66
66
|
$[2] = navigate;
|
|
67
67
|
$[3] = redirectTo;
|
|
68
|
-
$[4] =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
$[4] = t;
|
|
69
|
+
$[5] = t2;
|
|
70
|
+
} else t2 = $[5];
|
|
71
|
+
const handleSubmit = t2;
|
|
72
|
+
let t3;
|
|
73
|
+
if ($[6] !== basePath || $[7] !== loginPath || $[8] !== navigate) {
|
|
74
|
+
t3 = () => {
|
|
74
75
|
navigate(loginPath ?? `${basePath}/login`);
|
|
75
76
|
};
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
} else
|
|
81
|
-
const handleLoginClick =
|
|
77
|
+
$[6] = basePath;
|
|
78
|
+
$[7] = loginPath;
|
|
79
|
+
$[8] = navigate;
|
|
80
|
+
$[9] = t3;
|
|
81
|
+
} else t3 = $[9];
|
|
82
|
+
const handleLoginClick = t3;
|
|
83
|
+
let t4;
|
|
84
|
+
if ($[10] !== t || $[11] !== title) {
|
|
85
|
+
t4 = title ?? t("auth.createFirstAdmin");
|
|
86
|
+
$[10] = t;
|
|
87
|
+
$[11] = title;
|
|
88
|
+
$[12] = t4;
|
|
89
|
+
} else t4 = $[12];
|
|
90
|
+
let t5;
|
|
91
|
+
if ($[13] !== description || $[14] !== t) {
|
|
92
|
+
t5 = description ?? t("auth.createAccountDescription");
|
|
93
|
+
$[13] = description;
|
|
94
|
+
$[14] = t;
|
|
95
|
+
$[15] = t5;
|
|
96
|
+
} else t5 = $[15];
|
|
82
97
|
let t6;
|
|
83
|
-
if ($[
|
|
98
|
+
if ($[16] !== brandName || $[17] !== logo) {
|
|
84
99
|
t6 = logo ?? /* @__PURE__ */ jsx(AuthDefaultLogo, { brandName });
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
} else t6 = $[
|
|
100
|
+
$[16] = brandName;
|
|
101
|
+
$[17] = logo;
|
|
102
|
+
$[18] = t6;
|
|
103
|
+
} else t6 = $[18];
|
|
89
104
|
let t7;
|
|
90
|
-
if ($[
|
|
105
|
+
if ($[19] !== handleLoginClick || $[20] !== showLoginLink || $[21] !== t) {
|
|
91
106
|
t7 = showLoginLink && /* @__PURE__ */ jsxs("p", {
|
|
92
107
|
className: "text-muted-foreground text-center text-xs",
|
|
93
108
|
children: [
|
|
94
|
-
"
|
|
109
|
+
t("auth.alreadyHaveAccount"),
|
|
95
110
|
" ",
|
|
96
111
|
/* @__PURE__ */ jsx("button", {
|
|
97
112
|
type: "button",
|
|
98
113
|
onClick: handleLoginClick,
|
|
99
114
|
className: "text-foreground underline-offset-4 hover:underline",
|
|
100
|
-
children: "
|
|
115
|
+
children: t("auth.signIn")
|
|
101
116
|
})
|
|
102
117
|
]
|
|
103
118
|
});
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
|
|
119
|
+
$[19] = handleLoginClick;
|
|
120
|
+
$[20] = showLoginLink;
|
|
121
|
+
$[21] = t;
|
|
122
|
+
$[22] = t7;
|
|
123
|
+
} else t7 = $[22];
|
|
108
124
|
let t8;
|
|
109
|
-
if ($[
|
|
125
|
+
if ($[23] !== error || $[24] !== handleSubmit) {
|
|
110
126
|
t8 = /* @__PURE__ */ jsx(SetupForm, {
|
|
111
127
|
onSubmit: handleSubmit,
|
|
112
128
|
error
|
|
113
129
|
});
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
} else t8 = $[
|
|
130
|
+
$[23] = error;
|
|
131
|
+
$[24] = handleSubmit;
|
|
132
|
+
$[25] = t8;
|
|
133
|
+
} else t8 = $[25];
|
|
118
134
|
let t9;
|
|
119
|
-
if ($[
|
|
135
|
+
if ($[26] !== t4 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 || $[30] !== t8) {
|
|
120
136
|
t9 = /* @__PURE__ */ jsx(AuthLayout, {
|
|
121
|
-
title,
|
|
122
|
-
description,
|
|
137
|
+
title: t4,
|
|
138
|
+
description: t5,
|
|
123
139
|
logo: t6,
|
|
124
140
|
className: "qa-setup-page",
|
|
125
141
|
footer: t7,
|
|
126
142
|
children: t8
|
|
127
143
|
});
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
} else t9 = $[
|
|
144
|
+
$[26] = t4;
|
|
145
|
+
$[27] = t5;
|
|
146
|
+
$[28] = t6;
|
|
147
|
+
$[29] = t7;
|
|
148
|
+
$[30] = t8;
|
|
149
|
+
$[31] = t9;
|
|
150
|
+
} else t9 = $[31];
|
|
135
151
|
return t9;
|
|
136
152
|
}
|
|
137
153
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { messages } from "./messages/index.mjs";
|
|
2
|
-
import { validationMessagesEN, validationMessagesSK } from "questpie/shared";
|
|
2
|
+
import { validationMessagesCS, validationMessagesDE, validationMessagesEN, validationMessagesES, validationMessagesFR, validationMessagesPL, validationMessagesPT, validationMessagesSK } from "questpie/shared";
|
|
3
3
|
|
|
4
4
|
//#region src/server/i18n/index.ts
|
|
5
5
|
/**
|
|
@@ -16,14 +16,20 @@ import { validationMessagesEN, validationMessagesSK } from "questpie/shared";
|
|
|
16
16
|
*/
|
|
17
17
|
const adminMessagesEN = messages.en;
|
|
18
18
|
const adminMessagesSK = messages.sk;
|
|
19
|
-
messages.cs;
|
|
20
|
-
messages.de;
|
|
21
|
-
messages.fr;
|
|
22
|
-
messages.es;
|
|
23
|
-
messages.pt;
|
|
24
|
-
messages.pl;
|
|
19
|
+
const adminMessagesCS = messages.cs;
|
|
20
|
+
const adminMessagesDE = messages.de;
|
|
21
|
+
const adminMessagesFR = messages.fr;
|
|
22
|
+
const adminMessagesES = messages.es;
|
|
23
|
+
const adminMessagesPT = messages.pt;
|
|
24
|
+
const adminMessagesPL = messages.pl;
|
|
25
25
|
const validationMessagesByLocale = {
|
|
26
|
+
cs: validationMessagesCS,
|
|
27
|
+
de: validationMessagesDE,
|
|
26
28
|
en: validationMessagesEN,
|
|
29
|
+
es: validationMessagesES,
|
|
30
|
+
fr: validationMessagesFR,
|
|
31
|
+
pl: validationMessagesPL,
|
|
32
|
+
pt: validationMessagesPT,
|
|
27
33
|
sk: validationMessagesSK
|
|
28
34
|
};
|
|
29
35
|
function getValidationMessagesForLocale(locale) {
|