@mercurjs/vendor 2.3.5 → 2.3.6-canary.1
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/{[id]-2FLCH5U6.js → [id]-6ZGJSZKC.js} +2 -2
- package/dist/{[id]-2UKQCU5E.js → [id]-DGDRYOXA.js} +4 -4
- package/dist/{[id]-76KSXCNS.js → [id]-DMARVBSH.js} +4 -4
- package/dist/{[id]-VHDF374K.js → [id]-I77TGPCB.js} +3 -3
- package/dist/{[id]-SWYGDJKP.js → [id]-QQYIWAS5.js} +1 -1
- package/dist/{[id]-KYNJMPAZ.js → [id]-T7TRQELE.js} +1 -1
- package/dist/{[id]-YNYE4CVO.js → [id]-V3UXNOG3.js} +5 -5
- package/dist/{add-Y7TSTWSV.js → add-QIJFHIEN.js} +5 -5
- package/dist/{add-S3ETI6WN.js → add-TF35LMT6.js} +2 -2
- package/dist/{add-products-I33Z6RKH.js → add-products-SQ2GDSFZ.js} +4 -4
- package/dist/{chunk-JZMFSYIX.js → chunk-3SS2LCKQ.js} +1 -1
- package/dist/{chunk-DICDN56N.js → chunk-7MSALRUW.js} +3 -3
- package/dist/{chunk-IM4MMIAD.js → chunk-BRAZRY7I.js} +1 -1
- package/dist/{chunk-T6H4LCW2.js → chunk-CPOQJYQA.js} +1 -1
- package/dist/{chunk-BUIOUUYP.js → chunk-EZTOWRW3.js} +12 -8
- package/dist/{chunk-ZULCUYBE.js → chunk-IFDFLUKF.js} +2 -2
- package/dist/{chunk-Y5UECGBB.js → chunk-IRB6EAIZ.js} +1 -1
- package/dist/{chunk-XTO7RLNT.js → chunk-JZTJJXIE.js} +1 -1
- package/dist/{chunk-4WCI7Z2E.js → chunk-KWFSBUD6.js} +1405 -1396
- package/dist/{chunk-JA3YSGVC.js → chunk-MP7EYSQR.js} +1 -1
- package/dist/{chunk-LLEEXEN4.js → chunk-P2BPLLID.js} +1 -1
- package/dist/{chunk-HUFZZFBU.js → chunk-Q3YIXMVC.js} +2 -2
- package/dist/{chunk-CKLV4BCM.js → chunk-QORY5QKJ.js} +1 -1
- package/dist/{chunk-2ZKLPRET.js → chunk-S5XT7KIL.js} +1 -1
- package/dist/{chunk-66DJRLET.js → chunk-TD5VKPIR.js} +2 -2
- package/dist/{chunk-WQKS5KPD.js → chunk-U64VSAGN.js} +13 -12
- package/dist/chunk-ZMSRJIFD.js +65 -0
- package/dist/{collections-IHLZAAY3.js → collections-LKPOX523.js} +3 -3
- package/dist/{create-SBNJ22RV.js → create-E4BS73BX.js} +6 -6
- package/dist/{create-XVIXOQ5X.js → create-K2NJHBHH.js} +1 -1
- package/dist/{create-KXFZXIZV.js → create-N2AR6DLO.js} +2 -2
- package/dist/{create-4RQCCNN4.js → create-R4WETVZJ.js} +5 -5
- package/dist/{create-JC6E7BBR.js → create-RUABSALH.js} +4 -4
- package/dist/{edit-QRVEU4YA.js → edit-67H4MI4N.js} +1 -1
- package/dist/{edit-MMW4V266.js → edit-BRJA6WWU.js} +2 -2
- package/dist/{edit-W2MS67VC.js → edit-E2I2D4SP.js} +2 -2
- package/dist/{edit-3IBQDWUY.js → edit-FLABLGHV.js} +1 -1
- package/dist/{edit-LKAEGDF3.js → edit-K4VVN6G3.js} +2 -2
- package/dist/{edit-IYIVFW5N.js → edit-NPZARFKL.js} +6 -6
- package/dist/{fulfillment-providers-2WMGZWS3.js → fulfillment-providers-5Y3NKLTH.js} +2 -2
- package/dist/index.css +45 -0
- package/dist/index.js +562 -565
- package/dist/{invite-NHHWX4UX.js → invite-TGSHN6JL.js} +2 -2
- package/dist/{login-SLDQU7Z6.js → login-I6NQC47V.js} +2 -2
- package/dist/{media-4ZGY7YFL.js → media-UDWJKTEE.js} +1 -1
- package/dist/{media-QR2JJAD6.js → media-V26WTPNX.js} +3 -3
- package/dist/{offer-create-page-XMNW7YE3.js → offer-create-page-JV7YHF3Z.js} +3 -3
- package/dist/{offer-variant-detail-page-QAPWDXX3.js → offer-variant-detail-page-BQQHAR67.js} +2 -1
- package/dist/{offers-HOAYQB4N.js → offers-IRFEGWBD.js} +5 -5
- package/dist/{orders-BQJ27NZC.js → orders-CQMQBAV7.js} +4 -4
- package/dist/{organization-Y2ZX5IGB.js → organization-YELUM5LQ.js} +1 -1
- package/dist/pages/index.d.ts +141 -535
- package/dist/pages/index.js +13 -13
- package/dist/{pricing-FUKYBSGF.js → pricing-DKX2IPKN.js} +10 -2
- package/dist/{product-tags-BSWPOEIU.js → product-tags-RMVY5VBE.js} +5 -5
- package/dist/{product-variant-edit-VWQ5S5YR.js → product-variant-edit-ORLH3GH2.js} +2 -2
- package/dist/{products-XMTLHIXN.js → products-XXR5X5WL.js} +8 -8
- package/dist/{products-V7OVZBP7.js → products-Z7IZBB5V.js} +4 -4
- package/dist/{register-XO3DMJGR.js → register-T2XSCP6I.js} +1 -1
- package/dist/{return-reasons-5IWHFVBU.js → return-reasons-VQ7RS4DA.js} +4 -4
- package/dist/{settings-DIOXAPCL.js → settings-GX3SQTCF.js} +5 -5
- package/dist/{stock-HAKVSI3O.js → stock-SOOPTVQ3.js} +2 -2
- package/dist/{store-7UB7XIUR.js → store-GLZATKS6.js} +1 -1
- package/dist/{store-select-PVWMBQEW.js → store-select-7FVUSNIV.js} +1 -1
- package/dist/{team-MTIP2ZKI.js → team-5QN3RLLP.js} +2 -2
- package/package.json +12 -12
- package/dist/chunk-XBKWFLJG.js +0 -46
package/dist/index.js
CHANGED
|
@@ -177,52 +177,23 @@ var useTheme = () => {
|
|
|
177
177
|
return context;
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
// src/providers/sidebar-provider/
|
|
181
|
-
import {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// src/providers/sidebar-provider/sidebar-provider.tsx
|
|
189
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
190
|
-
var SidebarProvider = ({ children }) => {
|
|
191
|
-
const [desktop, setDesktop] = useState2(true);
|
|
192
|
-
const [mobile, setMobile] = useState2(false);
|
|
193
|
-
const { pathname } = useLocation();
|
|
194
|
-
const toggle = (view) => {
|
|
195
|
-
if (view === "desktop") {
|
|
196
|
-
setDesktop(!desktop);
|
|
197
|
-
} else {
|
|
198
|
-
setMobile(!mobile);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
useEffect2(() => {
|
|
202
|
-
setMobile(false);
|
|
203
|
-
}, [pathname]);
|
|
204
|
-
return /* @__PURE__ */ jsx2(SidebarContext.Provider, { value: { desktop, mobile, toggle }, children });
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// src/providers/sidebar-provider/use-sidebar.tsx
|
|
208
|
-
import { useContext as useContext2 } from "react";
|
|
209
|
-
var useSidebar = () => {
|
|
210
|
-
const context = useContext2(SidebarContext);
|
|
211
|
-
if (!context) {
|
|
212
|
-
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
213
|
-
}
|
|
214
|
-
return context;
|
|
215
|
-
};
|
|
180
|
+
// src/providers/sidebar-provider/index.ts
|
|
181
|
+
import {
|
|
182
|
+
SIDEBAR_RAIL_FADE,
|
|
183
|
+
SidebarProvider,
|
|
184
|
+
useCollapsedSidebar,
|
|
185
|
+
useSidebar
|
|
186
|
+
} from "@mercurjs/dashboard-shared";
|
|
216
187
|
|
|
217
188
|
// src/providers/keybind-provider/hooks.tsx
|
|
218
189
|
import { default as debounceFn } from "lodash.debounce";
|
|
219
|
-
import { useCallback, useContext as
|
|
190
|
+
import { useCallback, useContext as useContext2, useEffect as useEffect2, useState as useState2 } from "react";
|
|
220
191
|
import { useTranslation } from "react-i18next";
|
|
221
192
|
import { useNavigate } from "react-router-dom";
|
|
222
193
|
|
|
223
194
|
// src/providers/keybind-provider/keybind-context.tsx
|
|
224
|
-
import { createContext as
|
|
225
|
-
var KeybindContext =
|
|
195
|
+
import { createContext as createContext2 } from "react";
|
|
196
|
+
var KeybindContext = createContext2(null);
|
|
226
197
|
|
|
227
198
|
// src/providers/keybind-provider/utils.ts
|
|
228
199
|
var findFirstPlatformMatch = (keys) => {
|
|
@@ -290,7 +261,7 @@ var useShortcuts = ({
|
|
|
290
261
|
shortcuts = [],
|
|
291
262
|
debounce
|
|
292
263
|
}) => {
|
|
293
|
-
const [keys, setKeys] =
|
|
264
|
+
const [keys, setKeys] = useState2([]);
|
|
294
265
|
const navigate = useNavigate();
|
|
295
266
|
const removeKeys = useCallback(
|
|
296
267
|
debounceFn(() => setKeys([]), debounce),
|
|
@@ -311,14 +282,14 @@ var useShortcuts = ({
|
|
|
311
282
|
}, debounce / 2),
|
|
312
283
|
[]
|
|
313
284
|
);
|
|
314
|
-
|
|
285
|
+
useEffect2(() => {
|
|
315
286
|
if (keys.length > 0 && shortcuts.length > 0) {
|
|
316
287
|
const shortcut = findShortcut(shortcuts, keys);
|
|
317
288
|
invokeShortcut(shortcut);
|
|
318
289
|
}
|
|
319
290
|
return () => invokeShortcut.cancel();
|
|
320
291
|
}, [keys, shortcuts, invokeShortcut]);
|
|
321
|
-
|
|
292
|
+
useEffect2(() => {
|
|
322
293
|
const listener = (event) => {
|
|
323
294
|
const target = event.target;
|
|
324
295
|
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.contentEditable === "true") {
|
|
@@ -467,14 +438,14 @@ var useGlobalShortcuts = () => {
|
|
|
467
438
|
};
|
|
468
439
|
|
|
469
440
|
// src/providers/keybind-provider/keybind-provider.tsx
|
|
470
|
-
import { useCallback as useCallback2, useMemo, useState as
|
|
471
|
-
import { jsx as
|
|
441
|
+
import { useCallback as useCallback2, useMemo, useState as useState3 } from "react";
|
|
442
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
472
443
|
var KeybindProvider = ({
|
|
473
444
|
shortcuts,
|
|
474
445
|
debounce = 500,
|
|
475
446
|
children
|
|
476
447
|
}) => {
|
|
477
|
-
const [storeShortcuts, setStoreCommands] =
|
|
448
|
+
const [storeShortcuts, setStoreCommands] = useState3(
|
|
478
449
|
shortcuts.map((shr) => getShortcutWithDefaultValues(shr))
|
|
479
450
|
);
|
|
480
451
|
const registerShortcut = useCallback2(
|
|
@@ -503,11 +474,11 @@ var KeybindProvider = ({
|
|
|
503
474
|
}),
|
|
504
475
|
[storeShortcuts, registerShortcut, getKeysByPlatform]
|
|
505
476
|
);
|
|
506
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ jsx2(KeybindContext.Provider, { value: commandsContext, children });
|
|
507
478
|
};
|
|
508
479
|
|
|
509
480
|
// src/providers/search-provider/search-provider.tsx
|
|
510
|
-
import { useEffect as
|
|
481
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
511
482
|
|
|
512
483
|
// src/components/search/search.tsx
|
|
513
484
|
import {
|
|
@@ -526,14 +497,14 @@ import {
|
|
|
526
497
|
forwardRef,
|
|
527
498
|
Fragment,
|
|
528
499
|
useCallback as useCallback4,
|
|
529
|
-
useEffect as
|
|
500
|
+
useEffect as useEffect4,
|
|
530
501
|
useImperativeHandle,
|
|
531
502
|
useMemo as useMemo3,
|
|
532
503
|
useRef,
|
|
533
|
-
useState as
|
|
504
|
+
useState as useState5
|
|
534
505
|
} from "react";
|
|
535
506
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
536
|
-
import { useLocation
|
|
507
|
+
import { useLocation, useNavigate as useNavigate2 } from "react-router-dom";
|
|
537
508
|
import {
|
|
538
509
|
ArrowUturnLeft,
|
|
539
510
|
MagnifyingGlass,
|
|
@@ -566,7 +537,7 @@ var SEARCH_LIMIT_INCREMENT = 20;
|
|
|
566
537
|
|
|
567
538
|
// src/components/search/use-search-results.tsx
|
|
568
539
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
569
|
-
import { useCallback as useCallback3, useEffect as
|
|
540
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo2, useState as useState4 } from "react";
|
|
570
541
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
571
542
|
var useSearchResults = ({
|
|
572
543
|
q,
|
|
@@ -816,8 +787,8 @@ var useDynamicSearchResults = (currentArea, limit, q) => {
|
|
|
816
787
|
};
|
|
817
788
|
};
|
|
818
789
|
var useDebouncedSearch = (value, delay) => {
|
|
819
|
-
const [debouncedValue, setDebouncedValue] =
|
|
820
|
-
|
|
790
|
+
const [debouncedValue, setDebouncedValue] = useState4(value);
|
|
791
|
+
useEffect3(() => {
|
|
821
792
|
const handler = setTimeout(() => {
|
|
822
793
|
setDebouncedValue(value);
|
|
823
794
|
}, delay);
|
|
@@ -972,13 +943,13 @@ function transformDynamicSearchResults(type, limit, t2, response) {
|
|
|
972
943
|
}
|
|
973
944
|
|
|
974
945
|
// src/components/search/search.tsx
|
|
975
|
-
import { jsx as
|
|
946
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
976
947
|
var Search = () => {
|
|
977
|
-
const [area, setArea] =
|
|
978
|
-
const [search, setSearch] =
|
|
979
|
-
const [limit, setLimit] =
|
|
948
|
+
const [area, setArea] = useState5("all");
|
|
949
|
+
const [search, setSearch] = useState5("");
|
|
950
|
+
const [limit, setLimit] = useState5(DEFAULT_SEARCH_LIMIT);
|
|
980
951
|
const { open, onOpenChange } = useSearch();
|
|
981
|
-
const location =
|
|
952
|
+
const location = useLocation();
|
|
982
953
|
const { t: t2 } = useTranslation3();
|
|
983
954
|
const navigate = useNavigate2();
|
|
984
955
|
const inputRef = useRef(null);
|
|
@@ -1006,7 +977,7 @@ var Search = () => {
|
|
|
1006
977
|
},
|
|
1007
978
|
[onOpenChange, handleReset]
|
|
1008
979
|
);
|
|
1009
|
-
|
|
980
|
+
useEffect4(() => {
|
|
1010
981
|
handleOpenChange(false);
|
|
1011
982
|
}, [location.pathname, handleOpenChange]);
|
|
1012
983
|
const handleSelect = (item) => {
|
|
@@ -1056,7 +1027,7 @@ var Search = () => {
|
|
|
1056
1027
|
return isFetching && !dynamicResults.length && !filteredStaticResults.length;
|
|
1057
1028
|
}, [isFetching, dynamicResults, filteredStaticResults]);
|
|
1058
1029
|
return /* @__PURE__ */ jsxs(CommandDialog, { open, onOpenChange: handleOpenChange, children: [
|
|
1059
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ jsx3(
|
|
1060
1031
|
CommandInput,
|
|
1061
1032
|
{
|
|
1062
1033
|
isFetching,
|
|
@@ -1070,18 +1041,18 @@ var Search = () => {
|
|
|
1070
1041
|
}
|
|
1071
1042
|
),
|
|
1072
1043
|
/* @__PURE__ */ jsxs(CommandList, { ref: listRef, children: [
|
|
1073
|
-
showLoading && /* @__PURE__ */
|
|
1044
|
+
showLoading && /* @__PURE__ */ jsx3(CommandLoading, {}),
|
|
1074
1045
|
dynamicResults.map((group) => {
|
|
1075
1046
|
return /* @__PURE__ */ jsxs(CommandGroup, { heading: group.title, children: [
|
|
1076
1047
|
group.items.map((item) => {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ jsx3(
|
|
1078
1049
|
CommandItem,
|
|
1079
1050
|
{
|
|
1080
1051
|
onSelect: () => handleSelect(item),
|
|
1081
1052
|
value: item.value,
|
|
1082
1053
|
className: "flex items-center justify-between",
|
|
1083
1054
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1084
|
-
item.thumbnail && /* @__PURE__ */
|
|
1055
|
+
item.thumbnail && /* @__PURE__ */ jsx3(
|
|
1085
1056
|
Thumbnail,
|
|
1086
1057
|
{
|
|
1087
1058
|
alt: item.title,
|
|
@@ -1089,34 +1060,34 @@ var Search = () => {
|
|
|
1089
1060
|
size: "small"
|
|
1090
1061
|
}
|
|
1091
1062
|
),
|
|
1092
|
-
/* @__PURE__ */
|
|
1093
|
-
item.subtitle && /* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ jsx3("span", { children: item.title }),
|
|
1064
|
+
item.subtitle && /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: item.subtitle })
|
|
1094
1065
|
] })
|
|
1095
1066
|
},
|
|
1096
1067
|
item.id
|
|
1097
1068
|
);
|
|
1098
1069
|
}),
|
|
1099
|
-
group.hasMore && area === "all" && /* @__PURE__ */
|
|
1070
|
+
group.hasMore && area === "all" && /* @__PURE__ */ jsx3(
|
|
1100
1071
|
CommandItem,
|
|
1101
1072
|
{
|
|
1102
1073
|
onSelect: () => handleShowMore(group.area),
|
|
1103
1074
|
hidden: true,
|
|
1104
1075
|
value: `${group.title}:show:more`,
|
|
1105
1076
|
children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-muted flex items-center gap-x-3", children: [
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ jsx3(Plus, {}),
|
|
1078
|
+
/* @__PURE__ */ jsx3(Text, { size: "small", leading: "compact", weight: "plus", children: t2("app.search.showMore") })
|
|
1108
1079
|
] })
|
|
1109
1080
|
}
|
|
1110
1081
|
),
|
|
1111
|
-
group.hasMore && area === group.area && /* @__PURE__ */
|
|
1082
|
+
group.hasMore && area === group.area && /* @__PURE__ */ jsx3(
|
|
1112
1083
|
CommandItem,
|
|
1113
1084
|
{
|
|
1114
1085
|
onSelect: handleLoadMore,
|
|
1115
1086
|
hidden: true,
|
|
1116
1087
|
value: `${group.title}:load:more`,
|
|
1117
1088
|
children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-muted flex items-center gap-x-3", children: [
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ jsx3(Plus, {}),
|
|
1090
|
+
/* @__PURE__ */ jsx3(Text, { size: "small", leading: "compact", weight: "plus", children: t2("app.search.loadMore", {
|
|
1120
1091
|
count: Math.min(
|
|
1121
1092
|
SEARCH_LIMIT_INCREMENT,
|
|
1122
1093
|
group.count - limit
|
|
@@ -1128,7 +1099,7 @@ var Search = () => {
|
|
|
1128
1099
|
] }, group.title);
|
|
1129
1100
|
}),
|
|
1130
1101
|
filteredStaticResults.map((group) => {
|
|
1131
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ jsx3(
|
|
1132
1103
|
CommandGroup,
|
|
1133
1104
|
{
|
|
1134
1105
|
heading: t2(`app.keyboardShortcuts.${group.title}`),
|
|
@@ -1139,15 +1110,15 @@ var Search = () => {
|
|
|
1139
1110
|
onSelect: () => handleSelect(item),
|
|
1140
1111
|
className: "flex items-center justify-between",
|
|
1141
1112
|
children: [
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ jsx3("span", { children: item.label }),
|
|
1114
|
+
/* @__PURE__ */ jsx3("div", { className: "flex items-center gap-x-1.5", children: item.keys.Mac?.map((key, index) => {
|
|
1144
1115
|
return /* @__PURE__ */ jsxs(
|
|
1145
1116
|
"div",
|
|
1146
1117
|
{
|
|
1147
1118
|
className: "flex items-center gap-x-1",
|
|
1148
1119
|
children: [
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
index < (item.keys.Mac?.length || 0) - 1 && /* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx3(Kbd, { children: key }),
|
|
1121
|
+
index < (item.keys.Mac?.length || 0) - 1 && /* @__PURE__ */ jsx3("span", { className: "txt-compact-xsmall text-ui-fg-subtle", children: t2("app.keyboardShortcuts.then") })
|
|
1151
1122
|
]
|
|
1152
1123
|
},
|
|
1153
1124
|
index
|
|
@@ -1162,11 +1133,11 @@ var Search = () => {
|
|
|
1162
1133
|
group.title
|
|
1163
1134
|
);
|
|
1164
1135
|
}),
|
|
1165
|
-
!showLoading && /* @__PURE__ */
|
|
1136
|
+
!showLoading && /* @__PURE__ */ jsx3(CommandEmpty, { q: search })
|
|
1166
1137
|
] })
|
|
1167
1138
|
] });
|
|
1168
1139
|
};
|
|
1169
|
-
var CommandPalette = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1140
|
+
var CommandPalette = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
1170
1141
|
Command,
|
|
1171
1142
|
{
|
|
1172
1143
|
shouldFilter: false,
|
|
@@ -1184,8 +1155,8 @@ var CommandDialog = ({ children, ...props }) => {
|
|
|
1184
1155
|
const preserveHeight = useMemo3(() => {
|
|
1185
1156
|
return props.isLoading && Children.count(children) === 0;
|
|
1186
1157
|
}, [props.isLoading, children]);
|
|
1187
|
-
return /* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ jsx3(RadixDialog.Root, { ...props, children: /* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
|
|
1159
|
+
/* @__PURE__ */ jsx3(RadixDialog.Overlay, { className: "bg-ui-bg-overlay fixed inset-0" }),
|
|
1189
1160
|
/* @__PURE__ */ jsxs(
|
|
1190
1161
|
RadixDialog.Content,
|
|
1191
1162
|
{
|
|
@@ -1197,21 +1168,21 @@ var CommandDialog = ({ children, ...props }) => {
|
|
|
1197
1168
|
}
|
|
1198
1169
|
),
|
|
1199
1170
|
children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ jsx3(RadixDialog.Title, { className: "sr-only", children: t2("app.search.title") }),
|
|
1172
|
+
/* @__PURE__ */ jsx3(RadixDialog.Description, { className: "sr-only", children: t2("app.search.description") }),
|
|
1173
|
+
/* @__PURE__ */ jsx3(CommandPalette, { className: "[&_[cmdk-group-heading]]:text-muted-foreground flex h-full flex-col overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0", children }),
|
|
1174
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-ui-bg-field text-ui-fg-subtle flex items-center justify-end border-t px-4 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1204
1175
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1205
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ jsx3(Text, { size: "xsmall", leading: "compact", children: t2("app.search.navigation") }),
|
|
1206
1177
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsx3(Kbd, { className: "bg-ui-bg-field-component", children: "\u2193" }),
|
|
1179
|
+
/* @__PURE__ */ jsx3(Kbd, { className: "bg-ui-bg-field-component", children: "\u2191" })
|
|
1209
1180
|
] })
|
|
1210
1181
|
] }),
|
|
1211
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-ui-border-strong h-3 w-px" }),
|
|
1212
1183
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ jsx3(Text, { size: "xsmall", leading: "compact", children: t2("app.search.openResult") }),
|
|
1185
|
+
/* @__PURE__ */ jsx3(Kbd, { className: "bg-ui-bg-field-component", children: "\u21B5" })
|
|
1215
1186
|
] })
|
|
1216
1187
|
] }) })
|
|
1217
1188
|
]
|
|
@@ -1238,19 +1209,19 @@ var CommandInput = forwardRef(
|
|
|
1238
1209
|
() => innerRef.current
|
|
1239
1210
|
);
|
|
1240
1211
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col border-b", children: [
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ jsx3("div", { className: "px-4 pt-4", children: /* @__PURE__ */ jsxs(DropdownMenu, { dir: direction, children: [
|
|
1213
|
+
/* @__PURE__ */ jsx3(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1243
1214
|
Badge,
|
|
1244
1215
|
{
|
|
1245
1216
|
size: "2xsmall",
|
|
1246
1217
|
className: "hover:bg-ui-bg-base-pressed transition-fg cursor-pointer",
|
|
1247
1218
|
children: [
|
|
1248
1219
|
t2(`app.search.groups.${area}`),
|
|
1249
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ jsx3(TriangleDownMini, { className: "text-ui-fg-muted" })
|
|
1250
1221
|
]
|
|
1251
1222
|
}
|
|
1252
1223
|
) }),
|
|
1253
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ jsx3(
|
|
1254
1225
|
DropdownMenu.Content,
|
|
1255
1226
|
{
|
|
1256
1227
|
align: "start",
|
|
@@ -1259,15 +1230,15 @@ var CommandInput = forwardRef(
|
|
|
1259
1230
|
e.preventDefault();
|
|
1260
1231
|
innerRef.current?.focus();
|
|
1261
1232
|
},
|
|
1262
|
-
children: /* @__PURE__ */
|
|
1233
|
+
children: /* @__PURE__ */ jsx3(
|
|
1263
1234
|
DropdownMenu.RadioGroup,
|
|
1264
1235
|
{
|
|
1265
1236
|
value: area,
|
|
1266
1237
|
onValueChange: (v) => setArea(v),
|
|
1267
1238
|
children: SEARCH_AREAS.map((area2) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1268
|
-
area2 === "command" && /* @__PURE__ */
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
area2 === "all" && /* @__PURE__ */
|
|
1239
|
+
area2 === "command" && /* @__PURE__ */ jsx3(DropdownMenu.Separator, {}),
|
|
1240
|
+
/* @__PURE__ */ jsx3(DropdownMenu.RadioItem, { value: area2, children: t2(`app.search.groups.${area2}`) }),
|
|
1241
|
+
area2 === "all" && /* @__PURE__ */ jsx3(DropdownMenu.Separator, {})
|
|
1271
1242
|
] }, area2))
|
|
1272
1243
|
}
|
|
1273
1244
|
)
|
|
@@ -1275,17 +1246,17 @@ var CommandInput = forwardRef(
|
|
|
1275
1246
|
)
|
|
1276
1247
|
] }) }),
|
|
1277
1248
|
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center gap-x-2 px-4 py-3", children: [
|
|
1278
|
-
onBack && /* @__PURE__ */
|
|
1249
|
+
onBack && /* @__PURE__ */ jsx3(
|
|
1279
1250
|
IconButton,
|
|
1280
1251
|
{
|
|
1281
1252
|
type: "button",
|
|
1282
1253
|
size: "small",
|
|
1283
1254
|
variant: "transparent",
|
|
1284
1255
|
onClick: onBack,
|
|
1285
|
-
children: /* @__PURE__ */
|
|
1256
|
+
children: /* @__PURE__ */ jsx3(ArrowUturnLeft, { className: "text-ui-fg-muted" })
|
|
1286
1257
|
}
|
|
1287
1258
|
),
|
|
1288
|
-
/* @__PURE__ */
|
|
1259
|
+
/* @__PURE__ */ jsx3(
|
|
1289
1260
|
Command.Input,
|
|
1290
1261
|
{
|
|
1291
1262
|
ref: innerRef,
|
|
@@ -1299,8 +1270,8 @@ var CommandInput = forwardRef(
|
|
|
1299
1270
|
}
|
|
1300
1271
|
),
|
|
1301
1272
|
/* @__PURE__ */ jsxs("div", { className: "absolute end-4 top-1/2 flex -translate-y-1/2 items-center justify-end gap-x-2", children: [
|
|
1302
|
-
isFetching && /* @__PURE__ */
|
|
1303
|
-
value && /* @__PURE__ */
|
|
1273
|
+
isFetching && /* @__PURE__ */ jsx3(Spinner, { className: "text-ui-fg-muted animate-spin" }),
|
|
1274
|
+
value && /* @__PURE__ */ jsx3(
|
|
1304
1275
|
Button,
|
|
1305
1276
|
{
|
|
1306
1277
|
variant: "transparent",
|
|
@@ -1320,7 +1291,7 @@ var CommandInput = forwardRef(
|
|
|
1320
1291
|
}
|
|
1321
1292
|
);
|
|
1322
1293
|
CommandInput.displayName = Command.Input.displayName;
|
|
1323
|
-
var CommandList = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1294
|
+
var CommandList = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
1324
1295
|
Command.List,
|
|
1325
1296
|
{
|
|
1326
1297
|
ref,
|
|
@@ -1334,11 +1305,11 @@ var CommandList = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
1334
1305
|
CommandList.displayName = Command.List.displayName;
|
|
1335
1306
|
var CommandEmpty = forwardRef((props, ref) => {
|
|
1336
1307
|
const { t: t2 } = useTranslation3();
|
|
1337
|
-
return /* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ jsx3(Command.Empty, { ref, className: "py-6 text-center text-sm", ...props, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle flex min-h-[236px] flex-col items-center justify-center gap-y-3", children: [
|
|
1309
|
+
/* @__PURE__ */ jsx3(MagnifyingGlass, { className: "text-ui-fg-subtle" }),
|
|
1339
1310
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-y-1", children: [
|
|
1340
|
-
/* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ jsx3(Text, { size: "small", weight: "plus", leading: "compact", children: props.q ? t2("app.search.noResultsTitle") : t2("app.search.emptySearchTitle") }),
|
|
1312
|
+
/* @__PURE__ */ jsx3(Text, { size: "small", className: "text-ui-fg-muted", children: props.q ? t2("app.search.noResultsMessage") : t2("app.search.emptySearchMessage") })
|
|
1342
1313
|
] })
|
|
1343
1314
|
] }) });
|
|
1344
1315
|
});
|
|
@@ -1351,14 +1322,14 @@ var CommandLoading = forwardRef((props, ref) => {
|
|
|
1351
1322
|
...props,
|
|
1352
1323
|
className: "bg-ui-bg-base flex flex-col",
|
|
1353
1324
|
children: [
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
Array.from({ length: 7 }).map((_, index) => /* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ jsx3("div", { className: "w-full px-2 pb-1 pt-3", children: /* @__PURE__ */ jsx3(Skeleton, { className: "h-5 w-10" }) }),
|
|
1326
|
+
Array.from({ length: 7 }).map((_, index) => /* @__PURE__ */ jsx3("div", { className: "w-full p-2", children: /* @__PURE__ */ jsx3(Skeleton, { className: "h-5 w-full" }) }, index))
|
|
1356
1327
|
]
|
|
1357
1328
|
}
|
|
1358
1329
|
);
|
|
1359
1330
|
});
|
|
1360
1331
|
CommandLoading.displayName = Command.Loading.displayName;
|
|
1361
|
-
var CommandGroup = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1332
|
+
var CommandGroup = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
1362
1333
|
Command.Group,
|
|
1363
1334
|
{
|
|
1364
1335
|
ref,
|
|
@@ -1370,7 +1341,7 @@ var CommandGroup = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1370
1341
|
}
|
|
1371
1342
|
));
|
|
1372
1343
|
CommandGroup.displayName = Command.Group.displayName;
|
|
1373
|
-
var CommandSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1344
|
+
var CommandSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
1374
1345
|
Command.Separator,
|
|
1375
1346
|
{
|
|
1376
1347
|
ref,
|
|
@@ -1379,7 +1350,7 @@ var CommandSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1379
1350
|
}
|
|
1380
1351
|
));
|
|
1381
1352
|
CommandSeparator.displayName = Command.Separator.displayName;
|
|
1382
|
-
var CommandItem = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1353
|
+
var CommandItem = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
1383
1354
|
Command.Item,
|
|
1384
1355
|
{
|
|
1385
1356
|
ref,
|
|
@@ -1393,13 +1364,13 @@ var CommandItem = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
1393
1364
|
CommandItem.displayName = Command.Item.displayName;
|
|
1394
1365
|
|
|
1395
1366
|
// src/providers/search-provider/search-context.tsx
|
|
1396
|
-
import { createContext as
|
|
1397
|
-
var SearchContext =
|
|
1367
|
+
import { createContext as createContext3 } from "react";
|
|
1368
|
+
var SearchContext = createContext3(null);
|
|
1398
1369
|
|
|
1399
1370
|
// src/providers/search-provider/search-provider.tsx
|
|
1400
|
-
import { jsx as
|
|
1371
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1401
1372
|
var SearchProvider = ({ children }) => {
|
|
1402
|
-
const [open, setOpen] =
|
|
1373
|
+
const [open, setOpen] = useState6(false);
|
|
1403
1374
|
const { mobile, toggle } = useSidebar();
|
|
1404
1375
|
const toggleSearch = () => {
|
|
1405
1376
|
const update = !open;
|
|
@@ -1408,7 +1379,7 @@ var SearchProvider = ({ children }) => {
|
|
|
1408
1379
|
}
|
|
1409
1380
|
setOpen(update);
|
|
1410
1381
|
};
|
|
1411
|
-
|
|
1382
|
+
useEffect5(() => {
|
|
1412
1383
|
const onKeyDown = (e) => {
|
|
1413
1384
|
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
1414
1385
|
setOpen((prev) => !prev);
|
|
@@ -1429,16 +1400,16 @@ var SearchProvider = ({ children }) => {
|
|
|
1429
1400
|
},
|
|
1430
1401
|
children: [
|
|
1431
1402
|
children,
|
|
1432
|
-
/* @__PURE__ */
|
|
1403
|
+
/* @__PURE__ */ jsx4(Search, {})
|
|
1433
1404
|
]
|
|
1434
1405
|
}
|
|
1435
1406
|
);
|
|
1436
1407
|
};
|
|
1437
1408
|
|
|
1438
1409
|
// src/providers/search-provider/use-search.tsx
|
|
1439
|
-
import { useContext as
|
|
1410
|
+
import { useContext as useContext3 } from "react";
|
|
1440
1411
|
var useSearch = () => {
|
|
1441
|
-
const context =
|
|
1412
|
+
const context = useContext3(SearchContext);
|
|
1442
1413
|
if (!context) {
|
|
1443
1414
|
throw new Error("useSearch must be used within a SearchProvider");
|
|
1444
1415
|
}
|
|
@@ -1457,7 +1428,7 @@ import { Outlet as Outlet4 } from "react-router-dom";
|
|
|
1457
1428
|
import { Spinner as Spinner2 } from "@medusajs/icons";
|
|
1458
1429
|
import { PermissionsProvider } from "@mercurjs/dashboard-shared";
|
|
1459
1430
|
import { useMemo as useMemo4 } from "react";
|
|
1460
|
-
import { Navigate, Outlet, useLocation as
|
|
1431
|
+
import { Navigate, Outlet, useLocation as useLocation2 } from "react-router-dom";
|
|
1461
1432
|
|
|
1462
1433
|
// src/hooks/api/rbac.tsx
|
|
1463
1434
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -1473,10 +1444,10 @@ var useMePermissions = (options) => {
|
|
|
1473
1444
|
};
|
|
1474
1445
|
|
|
1475
1446
|
// src/components/authentication/protected-route/protected-route.tsx
|
|
1476
|
-
import { jsx as
|
|
1447
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1477
1448
|
var ProtectedRoute = () => {
|
|
1478
1449
|
const { seller_member, isLoading } = useMe();
|
|
1479
|
-
const location =
|
|
1450
|
+
const location = useLocation2();
|
|
1480
1451
|
const { feature_flags } = useFeatureFlags();
|
|
1481
1452
|
const isRbacEnabled = !!feature_flags?.rbac;
|
|
1482
1453
|
const { data: permissionsResponse, isLoading: isLoadingPermissions } = useMePermissions({
|
|
@@ -1493,18 +1464,18 @@ var ProtectedRoute = () => {
|
|
|
1493
1464
|
};
|
|
1494
1465
|
}, [permissionsResponse]);
|
|
1495
1466
|
if (isLoading) {
|
|
1496
|
-
return /* @__PURE__ */
|
|
1467
|
+
return /* @__PURE__ */ jsx5("div", { className: "flex min-h-screen items-center justify-center", children: /* @__PURE__ */ jsx5(Spinner2, { className: "text-ui-fg-interactive animate-spin" }) });
|
|
1497
1468
|
}
|
|
1498
1469
|
if (!seller_member) {
|
|
1499
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ jsx5(Navigate, { to: "/login", state: { from: location }, replace: true });
|
|
1500
1471
|
}
|
|
1501
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ jsx5(
|
|
1502
1473
|
PermissionsProvider,
|
|
1503
1474
|
{
|
|
1504
1475
|
policy,
|
|
1505
1476
|
isLoading: isLoadingPermissions,
|
|
1506
1477
|
isRbacEnabled,
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1478
|
+
children: /* @__PURE__ */ jsx5(SidebarProvider, { children: /* @__PURE__ */ jsx5(SearchProvider, { children: /* @__PURE__ */ jsx5(Outlet, {}) }) })
|
|
1508
1479
|
}
|
|
1509
1480
|
);
|
|
1510
1481
|
};
|
|
@@ -1531,20 +1502,20 @@ import { useTranslation as useTranslation8 } from "react-i18next";
|
|
|
1531
1502
|
// src/components/layout/nav-item/nav-item.tsx
|
|
1532
1503
|
import {
|
|
1533
1504
|
useCallback as useCallback5,
|
|
1534
|
-
useEffect as
|
|
1535
|
-
useState as
|
|
1505
|
+
useEffect as useEffect6,
|
|
1506
|
+
useState as useState7
|
|
1536
1507
|
} from "react";
|
|
1537
|
-
import { Kbd as Kbd2, Text as Text2, clx as clx2 } from "@medusajs/ui";
|
|
1508
|
+
import { Kbd as Kbd2, Text as Text2, Tooltip, clx as clx2 } from "@medusajs/ui";
|
|
1538
1509
|
import { Collapsible as RadixCollapsible } from "radix-ui";
|
|
1539
1510
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
1540
|
-
import { NavLink, useLocation as
|
|
1541
|
-
import { jsx as
|
|
1511
|
+
import { NavLink, useLocation as useLocation3 } from "react-router-dom";
|
|
1512
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1542
1513
|
var NestedNavLabel = ({
|
|
1543
1514
|
label,
|
|
1544
1515
|
translationNs
|
|
1545
1516
|
}) => {
|
|
1546
1517
|
const { t: t2 } = useTranslation4(translationNs);
|
|
1547
|
-
return /* @__PURE__ */
|
|
1518
|
+
return /* @__PURE__ */ jsx6(Text2, { size: "small", weight: "plus", leading: "compact", children: translationNs ? t2(label) : label });
|
|
1548
1519
|
};
|
|
1549
1520
|
var BASE_NAV_LINK_CLASSES = "text-ui-fg-subtle transition-fg hover:bg-ui-bg-subtle-hover flex items-center gap-x-2 rounded-md py-0.5 pl-0.5 pr-2 outline-none [&>svg]:text-ui-fg-subtle focus-visible:shadow-borders-focus";
|
|
1550
1521
|
var ACTIVE_NAV_LINK_CLASSES = "bg-ui-bg-base shadow-elevation-card-rest text-ui-fg-base hover:bg-ui-bg-base";
|
|
@@ -1557,26 +1528,31 @@ var getIsOpen = (to, items, pathname) => {
|
|
|
1557
1528
|
};
|
|
1558
1529
|
var NavItemTooltip = ({
|
|
1559
1530
|
to,
|
|
1531
|
+
label,
|
|
1560
1532
|
children
|
|
1561
1533
|
}) => {
|
|
1562
1534
|
const { t: t2 } = useTranslation4();
|
|
1535
|
+
const { state } = useSidebar();
|
|
1563
1536
|
const globalShortcuts = useGlobalShortcuts();
|
|
1564
1537
|
const shortcut = globalShortcuts.find((s) => s.to === to);
|
|
1565
|
-
|
|
1538
|
+
if (state === "collapsed" && label) {
|
|
1539
|
+
return /* @__PURE__ */ jsx6(Tooltip, { content: label, side: "right", delayDuration: 0, children: /* @__PURE__ */ jsx6("div", { className: "w-full", children }) });
|
|
1540
|
+
}
|
|
1541
|
+
return /* @__PURE__ */ jsx6(
|
|
1566
1542
|
ConditionalTooltip,
|
|
1567
1543
|
{
|
|
1568
1544
|
showTooltip: !!shortcut,
|
|
1569
1545
|
maxWidth: 9999,
|
|
1570
1546
|
content: /* @__PURE__ */ jsxs3("div", { className: "txt-compact-xsmall flex h-5 items-center justify-between gap-x-2 whitespace-nowrap", children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
index < (shortcut.keys.Mac?.length || 0) - 1 && /* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx6("span", { children: shortcut?.label }),
|
|
1548
|
+
/* @__PURE__ */ jsx6("div", { className: "flex items-center gap-x-1", children: shortcut?.keys.Mac?.map((key, index) => /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-1", children: [
|
|
1549
|
+
/* @__PURE__ */ jsx6(Kbd2, { children: key }, key),
|
|
1550
|
+
index < (shortcut.keys.Mac?.length || 0) - 1 && /* @__PURE__ */ jsx6("span", { className: "txt-compact-xsmall text-ui-fg-muted", children: t2("app.keyboardShortcuts.then") })
|
|
1575
1551
|
] }, index)) })
|
|
1576
1552
|
] }),
|
|
1577
1553
|
side: "right",
|
|
1578
1554
|
delayDuration: 1500,
|
|
1579
|
-
children: /* @__PURE__ */
|
|
1555
|
+
children: /* @__PURE__ */ jsx6("div", { className: "w-full", children })
|
|
1580
1556
|
}
|
|
1581
1557
|
);
|
|
1582
1558
|
};
|
|
@@ -1590,10 +1566,10 @@ var NavItem = ({
|
|
|
1590
1566
|
translationNs
|
|
1591
1567
|
}) => {
|
|
1592
1568
|
const { t: t2 } = useTranslation4(translationNs);
|
|
1593
|
-
const { pathname } =
|
|
1569
|
+
const { pathname } = useLocation3();
|
|
1594
1570
|
const displayLabel = translationNs ? t2(label) : label;
|
|
1595
|
-
const [open, setOpen] =
|
|
1596
|
-
|
|
1571
|
+
const [open, setOpen] = useState7(getIsOpen(to, items, pathname));
|
|
1572
|
+
useEffect6(() => {
|
|
1597
1573
|
setOpen(getIsOpen(to, items, pathname));
|
|
1598
1574
|
}, [pathname, to, items]);
|
|
1599
1575
|
const navLinkClassNames = useCallback5(
|
|
@@ -1629,7 +1605,7 @@ var NavItem = ({
|
|
|
1629
1605
|
className: "px-3",
|
|
1630
1606
|
"data-testid": `sidebar-nav-item-${to.replace(/\//g, "-").replace(/^-/, "")}`,
|
|
1631
1607
|
children: [
|
|
1632
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ jsx6(NavItemTooltip, { to, label: displayLabel, children: /* @__PURE__ */ jsxs3(
|
|
1633
1609
|
NavLink,
|
|
1634
1610
|
{
|
|
1635
1611
|
to,
|
|
@@ -1644,81 +1620,98 @@ var NavItem = ({
|
|
|
1644
1620
|
},
|
|
1645
1621
|
"data-testid": `sidebar-nav-link-${to.replace(/\//g, "-").replace(/^-/, "")}`,
|
|
1646
1622
|
children: [
|
|
1647
|
-
type !== "setting" && /* @__PURE__ */
|
|
1648
|
-
/* @__PURE__ */
|
|
1623
|
+
type !== "setting" && /* @__PURE__ */ jsx6("div", { className: "flex size-6 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx6(Icon, { icon, type }) }),
|
|
1624
|
+
/* @__PURE__ */ jsx6(
|
|
1625
|
+
Text2,
|
|
1626
|
+
{
|
|
1627
|
+
size: "small",
|
|
1628
|
+
weight: "plus",
|
|
1629
|
+
leading: "compact",
|
|
1630
|
+
className: clx2("shrink-0 whitespace-nowrap", SIDEBAR_RAIL_FADE),
|
|
1631
|
+
children: displayLabel
|
|
1632
|
+
}
|
|
1633
|
+
)
|
|
1649
1634
|
]
|
|
1650
1635
|
}
|
|
1651
1636
|
) }),
|
|
1652
|
-
items && items.length > 0 && /* @__PURE__ */ jsxs3(
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1637
|
+
items && items.length > 0 && /* @__PURE__ */ jsxs3(
|
|
1638
|
+
RadixCollapsible.Root,
|
|
1639
|
+
{
|
|
1640
|
+
open,
|
|
1641
|
+
onOpenChange: setOpen,
|
|
1642
|
+
className: "group-data-[state=collapsed]/sidebar:hidden",
|
|
1643
|
+
children: [
|
|
1644
|
+
/* @__PURE__ */ jsxs3(
|
|
1645
|
+
RadixCollapsible.Trigger,
|
|
1646
|
+
{
|
|
1647
|
+
className: clx2(
|
|
1648
|
+
"flex w-full items-center gap-x-2 rounded-md py-0.5 pl-0.5 pr-2 text-ui-fg-subtle outline-none transition-fg hover:bg-ui-bg-subtle-hover hover:text-ui-fg-base lg:hidden",
|
|
1649
|
+
{ "pl-2": isSetting }
|
|
1650
|
+
),
|
|
1651
|
+
children: [
|
|
1652
|
+
/* @__PURE__ */ jsx6("div", { className: "flex size-6 items-center justify-center", children: /* @__PURE__ */ jsx6(Icon, { icon, type }) }),
|
|
1653
|
+
/* @__PURE__ */ jsx6(Text2, { size: "small", weight: "plus", leading: "compact", children: displayLabel })
|
|
1654
|
+
]
|
|
1655
|
+
}
|
|
1659
1656
|
),
|
|
1660
|
-
children:
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
children: /* @__PURE__ */ jsx7(Text2, { size: "small", weight: "plus", leading: "compact", children: displayLabel })
|
|
1689
|
-
}
|
|
1690
|
-
) }) }),
|
|
1691
|
-
items.map((item) => {
|
|
1692
|
-
return /* @__PURE__ */ jsx7("li", { className: "flex h-7 items-center", children: /* @__PURE__ */ jsx7(NavItemTooltip, { to: item.to, children: /* @__PURE__ */ jsx7(
|
|
1693
|
-
NavLink,
|
|
1694
|
-
{
|
|
1695
|
-
to: item.to,
|
|
1696
|
-
end: true,
|
|
1697
|
-
className: ({ isActive }) => {
|
|
1698
|
-
return clx2(
|
|
1699
|
-
navLinkClassNames({
|
|
1700
|
-
to: item.to,
|
|
1701
|
-
isActive,
|
|
1702
|
-
isSetting,
|
|
1703
|
-
isNested: true
|
|
1704
|
-
})
|
|
1705
|
-
);
|
|
1706
|
-
},
|
|
1707
|
-
"data-testid": `sidebar-nav-link-nested-${item.to.replace(/\//g, "-").replace(/^-/, "")}`,
|
|
1708
|
-
children: /* @__PURE__ */ jsx7(
|
|
1709
|
-
NestedNavLabel,
|
|
1657
|
+
/* @__PURE__ */ jsx6(RadixCollapsible.Content, { children: /* @__PURE__ */ jsx6(
|
|
1658
|
+
"div",
|
|
1659
|
+
{
|
|
1660
|
+
className: "flex flex-col gap-y-0.5 pb-2 pt-0.5",
|
|
1661
|
+
"data-testid": `sidebar-nav-nested-items-${to.replace(/\//g, "-").replace(/^-/, "")}`,
|
|
1662
|
+
children: /* @__PURE__ */ jsxs3("ul", { className: "flex flex-col gap-y-0.5", children: [
|
|
1663
|
+
/* @__PURE__ */ jsx6("li", { className: "flex w-full items-center gap-x-1 lg:hidden", children: /* @__PURE__ */ jsx6(NavItemTooltip, { to, children: /* @__PURE__ */ jsx6(
|
|
1664
|
+
NavLink,
|
|
1665
|
+
{
|
|
1666
|
+
to,
|
|
1667
|
+
end: true,
|
|
1668
|
+
className: ({ isActive }) => {
|
|
1669
|
+
return clx2(
|
|
1670
|
+
navLinkClassNames({
|
|
1671
|
+
to,
|
|
1672
|
+
isActive,
|
|
1673
|
+
isSetting,
|
|
1674
|
+
isNested: true
|
|
1675
|
+
})
|
|
1676
|
+
);
|
|
1677
|
+
},
|
|
1678
|
+
"data-testid": `sidebar-nav-link-nested-${to.replace(/\//g, "-").replace(/^-/, "")}`,
|
|
1679
|
+
children: /* @__PURE__ */ jsx6(Text2, { size: "small", weight: "plus", leading: "compact", children: displayLabel })
|
|
1680
|
+
}
|
|
1681
|
+
) }) }),
|
|
1682
|
+
items.map((item) => {
|
|
1683
|
+
return /* @__PURE__ */ jsx6("li", { className: "flex h-7 items-center", children: /* @__PURE__ */ jsx6(NavItemTooltip, { to: item.to, children: /* @__PURE__ */ jsx6(
|
|
1684
|
+
NavLink,
|
|
1710
1685
|
{
|
|
1711
|
-
|
|
1712
|
-
|
|
1686
|
+
to: item.to,
|
|
1687
|
+
end: true,
|
|
1688
|
+
className: ({ isActive }) => {
|
|
1689
|
+
return clx2(
|
|
1690
|
+
navLinkClassNames({
|
|
1691
|
+
to: item.to,
|
|
1692
|
+
isActive,
|
|
1693
|
+
isSetting,
|
|
1694
|
+
isNested: true
|
|
1695
|
+
})
|
|
1696
|
+
);
|
|
1697
|
+
},
|
|
1698
|
+
"data-testid": `sidebar-nav-link-nested-${item.to.replace(/\//g, "-").replace(/^-/, "")}`,
|
|
1699
|
+
children: /* @__PURE__ */ jsx6(
|
|
1700
|
+
NestedNavLabel,
|
|
1701
|
+
{
|
|
1702
|
+
label: item.label,
|
|
1703
|
+
translationNs: item.translationNs
|
|
1704
|
+
}
|
|
1705
|
+
)
|
|
1713
1706
|
}
|
|
1714
|
-
)
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1707
|
+
) }) }, item.to);
|
|
1708
|
+
})
|
|
1709
|
+
] })
|
|
1710
|
+
}
|
|
1711
|
+
) })
|
|
1712
|
+
]
|
|
1713
|
+
}
|
|
1714
|
+
)
|
|
1722
1715
|
]
|
|
1723
1716
|
}
|
|
1724
1717
|
);
|
|
@@ -1727,7 +1720,7 @@ var Icon = ({ icon, type }) => {
|
|
|
1727
1720
|
if (!icon) {
|
|
1728
1721
|
return null;
|
|
1729
1722
|
}
|
|
1730
|
-
return type === "extension" ? /* @__PURE__ */
|
|
1723
|
+
return type === "extension" ? /* @__PURE__ */ jsx6("div", { className: "flex h-5 w-5 items-center justify-center rounded-[4px] bg-ui-bg-base shadow-borders-base", children: /* @__PURE__ */ jsx6("div", { className: "h-[15px] w-[15px] overflow-hidden rounded-sm", children: icon }) }) : icon;
|
|
1731
1724
|
};
|
|
1732
1725
|
|
|
1733
1726
|
// src/components/layout/shell/shell.tsx
|
|
@@ -1735,12 +1728,12 @@ import { SidebarLeft, TriangleRightMini, XMark } from "@medusajs/icons";
|
|
|
1735
1728
|
import { IconButton as IconButton2, clx as clx3 } from "@medusajs/ui";
|
|
1736
1729
|
import { AnimatePresence } from "motion/react";
|
|
1737
1730
|
import { Dialog as RadixDialog2 } from "radix-ui";
|
|
1738
|
-
import { useEffect as
|
|
1731
|
+
import { useEffect as useEffect7, useState as useState8 } from "react";
|
|
1739
1732
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
1740
1733
|
import {
|
|
1741
1734
|
Link,
|
|
1742
1735
|
Outlet as Outlet2,
|
|
1743
|
-
useLocation as
|
|
1736
|
+
useLocation as useLocation4,
|
|
1744
1737
|
useMatches,
|
|
1745
1738
|
useNavigation
|
|
1746
1739
|
} from "react-router-dom";
|
|
@@ -1748,9 +1741,9 @@ import { WidgetZone } from "@mercurjs/dashboard-shared";
|
|
|
1748
1741
|
|
|
1749
1742
|
// src/components/common/progress-bar/progress-bar.tsx
|
|
1750
1743
|
import { motion } from "motion/react";
|
|
1751
|
-
import { jsx as
|
|
1744
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1752
1745
|
var ProgressBar = ({ duration = 2 }) => {
|
|
1753
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsx7(
|
|
1754
1747
|
motion.div,
|
|
1755
1748
|
{
|
|
1756
1749
|
className: "bg-ui-fg-subtle size-full",
|
|
@@ -1774,20 +1767,20 @@ var ProgressBar = ({ duration = 2 }) => {
|
|
|
1774
1767
|
};
|
|
1775
1768
|
|
|
1776
1769
|
// src/components/layout/shell/shell.tsx
|
|
1777
|
-
import { jsx as
|
|
1770
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1778
1771
|
var Shell = ({ children }) => {
|
|
1779
1772
|
const globalShortcuts = useGlobalShortcuts();
|
|
1780
1773
|
const navigation2 = useNavigation();
|
|
1781
1774
|
const loading = navigation2.state === "loading";
|
|
1782
|
-
return /* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1775
|
+
return /* @__PURE__ */ jsx8(KeybindProvider, { shortcuts: globalShortcuts, children: /* @__PURE__ */ jsxs4("div", { className: "relative flex h-screen flex-col items-start overflow-hidden lg:flex-row", children: [
|
|
1776
|
+
/* @__PURE__ */ jsx8(NavigationBar, { loading }),
|
|
1784
1777
|
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ jsx8(MobileSidebarContainer, { children }),
|
|
1779
|
+
/* @__PURE__ */ jsx8(DesktopSidebarContainer, { children })
|
|
1787
1780
|
] }),
|
|
1788
1781
|
/* @__PURE__ */ jsxs4("div", { className: "flex h-screen w-full flex-col overflow-auto", children: [
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1782
|
+
/* @__PURE__ */ jsx8(Topbar, {}),
|
|
1783
|
+
/* @__PURE__ */ jsx8(
|
|
1791
1784
|
"main",
|
|
1792
1785
|
{
|
|
1793
1786
|
className: clx3(
|
|
@@ -1797,8 +1790,8 @@ var Shell = ({ children }) => {
|
|
|
1797
1790
|
}
|
|
1798
1791
|
),
|
|
1799
1792
|
children: /* @__PURE__ */ jsxs4(Gutter, { children: [
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ jsx8(StoreSetupWidget, {}),
|
|
1794
|
+
/* @__PURE__ */ jsx8(Outlet2, {})
|
|
1802
1795
|
] })
|
|
1803
1796
|
}
|
|
1804
1797
|
)
|
|
@@ -1806,8 +1799,8 @@ var Shell = ({ children }) => {
|
|
|
1806
1799
|
] }) });
|
|
1807
1800
|
};
|
|
1808
1801
|
var NavigationBar = ({ loading }) => {
|
|
1809
|
-
const [showBar, setShowBar] =
|
|
1810
|
-
|
|
1802
|
+
const [showBar, setShowBar] = useState8(false);
|
|
1803
|
+
useEffect7(() => {
|
|
1811
1804
|
let timeout;
|
|
1812
1805
|
if (loading) {
|
|
1813
1806
|
timeout = setTimeout(() => {
|
|
@@ -1820,10 +1813,10 @@ var NavigationBar = ({ loading }) => {
|
|
|
1820
1813
|
clearTimeout(timeout);
|
|
1821
1814
|
};
|
|
1822
1815
|
}, [loading]);
|
|
1823
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ jsx8("div", { className: "fixed inset-x-0 top-0 z-50 h-1", children: /* @__PURE__ */ jsx8(AnimatePresence, { children: showBar ? /* @__PURE__ */ jsx8(ProgressBar, {}) : null }) });
|
|
1824
1817
|
};
|
|
1825
1818
|
var Gutter = ({ children }) => {
|
|
1826
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex w-full max-w-[1600px] flex-col gap-y-2 p-3", children });
|
|
1827
1820
|
};
|
|
1828
1821
|
var Breadcrumbs = () => {
|
|
1829
1822
|
const matches = useMatches();
|
|
@@ -1842,7 +1835,7 @@ var Breadcrumbs = () => {
|
|
|
1842
1835
|
path: match.pathname
|
|
1843
1836
|
};
|
|
1844
1837
|
}).filter(Boolean);
|
|
1845
|
-
return /* @__PURE__ */
|
|
1838
|
+
return /* @__PURE__ */ jsx8(
|
|
1846
1839
|
"ol",
|
|
1847
1840
|
{
|
|
1848
1841
|
className: clx3(
|
|
@@ -1852,7 +1845,7 @@ var Breadcrumbs = () => {
|
|
|
1852
1845
|
const isLast = index === crumbs.length - 1;
|
|
1853
1846
|
const isSingle = crumbs.length === 1;
|
|
1854
1847
|
return /* @__PURE__ */ jsxs4("li", { className: clx3("flex items-center"), children: [
|
|
1855
|
-
!isLast ? /* @__PURE__ */
|
|
1848
|
+
!isLast ? /* @__PURE__ */ jsx8(
|
|
1856
1849
|
Link,
|
|
1857
1850
|
{
|
|
1858
1851
|
className: "transition-fg hover:text-ui-fg-subtle",
|
|
@@ -1860,8 +1853,8 @@ var Breadcrumbs = () => {
|
|
|
1860
1853
|
children: crumb.label
|
|
1861
1854
|
}
|
|
1862
1855
|
) : /* @__PURE__ */ jsxs4("div", { children: [
|
|
1863
|
-
!isSingle && /* @__PURE__ */
|
|
1864
|
-
/* @__PURE__ */
|
|
1856
|
+
!isSingle && /* @__PURE__ */ jsx8("span", { className: "block lg:hidden", children: "..." }),
|
|
1857
|
+
/* @__PURE__ */ jsx8(
|
|
1865
1858
|
"span",
|
|
1866
1859
|
{
|
|
1867
1860
|
className: clx3({
|
|
@@ -1872,33 +1865,34 @@ var Breadcrumbs = () => {
|
|
|
1872
1865
|
index
|
|
1873
1866
|
)
|
|
1874
1867
|
] }),
|
|
1875
|
-
!isLast && /* @__PURE__ */
|
|
1868
|
+
!isLast && /* @__PURE__ */ jsx8("span", { className: "mx-2", children: /* @__PURE__ */ jsx8(TriangleRightMini, { className: "rtl:rotate-180" }) })
|
|
1876
1869
|
] }, index);
|
|
1877
1870
|
})
|
|
1878
1871
|
}
|
|
1879
1872
|
);
|
|
1880
1873
|
};
|
|
1881
1874
|
var ToggleSidebar = () => {
|
|
1882
|
-
const { toggle } = useSidebar();
|
|
1875
|
+
const { toggle, state } = useSidebar();
|
|
1883
1876
|
return /* @__PURE__ */ jsxs4("div", { children: [
|
|
1884
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ jsx8(
|
|
1885
1878
|
IconButton2,
|
|
1886
1879
|
{
|
|
1887
1880
|
className: "hidden lg:flex",
|
|
1888
1881
|
variant: "transparent",
|
|
1889
1882
|
onClick: () => toggle("desktop"),
|
|
1890
1883
|
size: "small",
|
|
1891
|
-
|
|
1884
|
+
"aria-expanded": state === "expanded",
|
|
1885
|
+
children: /* @__PURE__ */ jsx8(SidebarLeft, { className: "text-ui-fg-muted rtl:rotate-180" })
|
|
1892
1886
|
}
|
|
1893
1887
|
),
|
|
1894
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ jsx8(
|
|
1895
1889
|
IconButton2,
|
|
1896
1890
|
{
|
|
1897
1891
|
className: "hidden max-lg:flex",
|
|
1898
1892
|
variant: "transparent",
|
|
1899
1893
|
onClick: () => toggle("mobile"),
|
|
1900
1894
|
size: "small",
|
|
1901
|
-
children: /* @__PURE__ */
|
|
1895
|
+
children: /* @__PURE__ */ jsx8(SidebarLeft, { className: "text-ui-fg-muted rtl:rotate-180" })
|
|
1902
1896
|
}
|
|
1903
1897
|
)
|
|
1904
1898
|
] });
|
|
@@ -1906,20 +1900,23 @@ var ToggleSidebar = () => {
|
|
|
1906
1900
|
var Topbar = () => {
|
|
1907
1901
|
return /* @__PURE__ */ jsxs4("div", { className: "grid w-full grid-cols-2 border-b p-3", children: [
|
|
1908
1902
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-1.5", children: [
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ jsx8(ToggleSidebar, {}),
|
|
1904
|
+
/* @__PURE__ */ jsx8(Breadcrumbs, {})
|
|
1911
1905
|
] }),
|
|
1912
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ jsx8("div", { className: "flex items-center justify-end gap-x-3" })
|
|
1913
1907
|
] });
|
|
1914
1908
|
};
|
|
1915
1909
|
var DesktopSidebarContainer = ({ children }) => {
|
|
1916
|
-
const {
|
|
1917
|
-
return /* @__PURE__ */
|
|
1910
|
+
const { state } = useSidebar();
|
|
1911
|
+
return /* @__PURE__ */ jsx8(
|
|
1918
1912
|
"div",
|
|
1919
1913
|
{
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1914
|
+
"data-state": state,
|
|
1915
|
+
className: clx3(
|
|
1916
|
+
"group/sidebar hidden h-screen w-[220px] shrink-0 overflow-x-hidden border-e lg:flex",
|
|
1917
|
+
"transition-[width] duration-200 ease-sidebar motion-reduce:transition-none",
|
|
1918
|
+
"data-[state=collapsed]:w-[52px]"
|
|
1919
|
+
),
|
|
1923
1920
|
children
|
|
1924
1921
|
}
|
|
1925
1922
|
);
|
|
@@ -1927,8 +1924,8 @@ var DesktopSidebarContainer = ({ children }) => {
|
|
|
1927
1924
|
var MobileSidebarContainer = ({ children }) => {
|
|
1928
1925
|
const { t: t2 } = useTranslation5();
|
|
1929
1926
|
const { mobile, toggle } = useSidebar();
|
|
1930
|
-
return /* @__PURE__ */
|
|
1931
|
-
/* @__PURE__ */
|
|
1927
|
+
return /* @__PURE__ */ jsx8(RadixDialog2.Root, { open: mobile, onOpenChange: () => toggle("mobile"), children: /* @__PURE__ */ jsxs4(RadixDialog2.Portal, { children: [
|
|
1928
|
+
/* @__PURE__ */ jsx8(
|
|
1932
1929
|
RadixDialog2.Overlay,
|
|
1933
1930
|
{
|
|
1934
1931
|
className: clx3(
|
|
@@ -1946,17 +1943,17 @@ var MobileSidebarContainer = ({ children }) => {
|
|
|
1946
1943
|
),
|
|
1947
1944
|
children: [
|
|
1948
1945
|
/* @__PURE__ */ jsxs4("div", { className: "p-3", children: [
|
|
1949
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ jsx8(RadixDialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx8(
|
|
1950
1947
|
IconButton2,
|
|
1951
1948
|
{
|
|
1952
1949
|
size: "small",
|
|
1953
1950
|
variant: "transparent",
|
|
1954
1951
|
className: "text-ui-fg-subtle",
|
|
1955
|
-
children: /* @__PURE__ */
|
|
1952
|
+
children: /* @__PURE__ */ jsx8(XMark, {})
|
|
1956
1953
|
}
|
|
1957
1954
|
) }),
|
|
1958
|
-
/* @__PURE__ */
|
|
1959
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ jsx8(RadixDialog2.Title, { className: "sr-only", children: t2("app.nav.accessibility.title") }),
|
|
1956
|
+
/* @__PURE__ */ jsx8(RadixDialog2.Description, { className: "sr-only", children: t2("app.nav.accessibility.description") })
|
|
1960
1957
|
] }),
|
|
1961
1958
|
children
|
|
1962
1959
|
]
|
|
@@ -1972,15 +1969,15 @@ var isTopLevelRoute = (pathname) => {
|
|
|
1972
1969
|
var StoreSetupWidget = () => {
|
|
1973
1970
|
const { seller_member } = useMe();
|
|
1974
1971
|
const seller = seller_member?.seller;
|
|
1975
|
-
const location =
|
|
1972
|
+
const location = useLocation4();
|
|
1976
1973
|
if (!seller || !isTopLevelRoute(location.pathname)) {
|
|
1977
1974
|
return null;
|
|
1978
1975
|
}
|
|
1979
|
-
return /* @__PURE__ */
|
|
1976
|
+
return /* @__PURE__ */ jsx8(WidgetZone, { id: "seller.setup", data: seller });
|
|
1980
1977
|
};
|
|
1981
1978
|
|
|
1982
1979
|
// src/components/layout/main-layout/main-layout.tsx
|
|
1983
|
-
import { useLocation as
|
|
1980
|
+
import { useLocation as useLocation7, useNavigate as useNavigate4 } from "react-router-dom";
|
|
1984
1981
|
|
|
1985
1982
|
// src/components/layout/user-menu/user-menu.tsx
|
|
1986
1983
|
import {
|
|
@@ -2006,50 +2003,50 @@ import {
|
|
|
2006
2003
|
} from "@medusajs/ui";
|
|
2007
2004
|
import { Dialog as RadixDialog3 } from "radix-ui";
|
|
2008
2005
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
2009
|
-
import { useState as
|
|
2010
|
-
import { Link as Link2, useLocation as
|
|
2011
|
-
import { jsx as
|
|
2006
|
+
import { useState as useState9 } from "react";
|
|
2007
|
+
import { Link as Link2, useLocation as useLocation5, useNavigate as useNavigate3 } from "react-router-dom";
|
|
2008
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2012
2009
|
var UserMenu = () => {
|
|
2013
2010
|
const { t: t2 } = useTranslation6();
|
|
2014
|
-
const location =
|
|
2011
|
+
const location = useLocation5();
|
|
2015
2012
|
const direction = useDocumentDirection();
|
|
2016
|
-
const [openMenu, setOpenMenu] =
|
|
2017
|
-
const [openModal, setOpenModal] =
|
|
2013
|
+
const [openMenu, setOpenMenu] = useState9(false);
|
|
2014
|
+
const [openModal, setOpenModal] = useState9(false);
|
|
2018
2015
|
const toggleModal = () => {
|
|
2019
2016
|
setOpenMenu(false);
|
|
2020
2017
|
setOpenModal(!openModal);
|
|
2021
2018
|
};
|
|
2022
2019
|
return /* @__PURE__ */ jsxs5("div", { children: [
|
|
2023
2020
|
/* @__PURE__ */ jsxs5(DropdownMenu2, { dir: direction, open: openMenu, onOpenChange: setOpenMenu, children: [
|
|
2024
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ jsx9(UserBadge, {}),
|
|
2025
2022
|
/* @__PURE__ */ jsxs5(DropdownMenu2.Content, { className: "min-w-[var(--radix-dropdown-menu-trigger-width)] max-w-[var(--radix-dropdown-menu-trigger-width)]", children: [
|
|
2026
|
-
/* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ jsx9(UserItem, {}),
|
|
2024
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Separator, {}),
|
|
2025
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Item, { asChild: true, children: /* @__PURE__ */ jsxs5(Link2, { to: "/settings/profile", state: { from: location.pathname }, children: [
|
|
2026
|
+
/* @__PURE__ */ jsx9(UserIcon, { className: "text-ui-fg-subtle me-2" }),
|
|
2030
2027
|
t2("app.menus.user.profileSettings")
|
|
2031
2028
|
] }) }),
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Separator, {}),
|
|
2030
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Item, { asChild: true, children: /* @__PURE__ */ jsxs5(Link2, { to: "https://docs.mercurjs.com/welcome", target: "_blank", children: [
|
|
2031
|
+
/* @__PURE__ */ jsx9(BookOpen, { className: "text-ui-fg-subtle me-2" }),
|
|
2035
2032
|
t2("app.menus.user.documentation")
|
|
2036
2033
|
] }) }),
|
|
2037
|
-
/* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Item, { asChild: true, children: /* @__PURE__ */ jsxs5(Link2, { to: "https://www.mercurjs.com/updates", target: "_blank", children: [
|
|
2035
|
+
/* @__PURE__ */ jsx9(TimelineVertical, { className: "text-ui-fg-subtle me-2" }),
|
|
2039
2036
|
t2("app.menus.user.changelog")
|
|
2040
2037
|
] }) }),
|
|
2041
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Separator, {}),
|
|
2042
2039
|
/* @__PURE__ */ jsxs5(DropdownMenu2.Item, { onClick: toggleModal, children: [
|
|
2043
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ jsx9(Keyboard, { className: "text-ui-fg-subtle me-2" }),
|
|
2044
2041
|
t2("app.menus.user.shortcuts")
|
|
2045
2042
|
] }),
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ jsx9(ThemeToggle, {}),
|
|
2044
|
+
/* @__PURE__ */ jsx9(LanguageToggle, {}),
|
|
2045
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.Separator, {}),
|
|
2046
|
+
/* @__PURE__ */ jsx9(Logout, {})
|
|
2050
2047
|
] })
|
|
2051
2048
|
] }),
|
|
2052
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsx9(GlobalKeybindsModal, { open: openModal, onOpenChange: setOpenModal })
|
|
2053
2050
|
] });
|
|
2054
2051
|
};
|
|
2055
2052
|
var UserBadge = () => {
|
|
@@ -2060,14 +2057,14 @@ var UserBadge = () => {
|
|
|
2060
2057
|
const fallback = displayName ? displayName[0].toUpperCase() : null;
|
|
2061
2058
|
if (isPending) {
|
|
2062
2059
|
return /* @__PURE__ */ jsxs5("button", { className: "shadow-borders-base flex max-w-[192px] select-none items-center gap-x-2 overflow-hidden text-ellipsis whitespace-nowrap rounded-full py-1 ps-1 pe-2.5", children: [
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2060
|
+
/* @__PURE__ */ jsx9(Skeleton, { className: "h-5 w-5 rounded-full" }),
|
|
2061
|
+
/* @__PURE__ */ jsx9(Skeleton, { className: "h-[9px] w-[70px]" })
|
|
2065
2062
|
] });
|
|
2066
2063
|
}
|
|
2067
2064
|
if (isError) {
|
|
2068
2065
|
throw error;
|
|
2069
2066
|
}
|
|
2070
|
-
return /* @__PURE__ */
|
|
2067
|
+
return /* @__PURE__ */ jsx9("div", { className: "p-3", children: /* @__PURE__ */ jsxs5(
|
|
2071
2068
|
DropdownMenu2.Trigger,
|
|
2072
2069
|
{
|
|
2073
2070
|
disabled: !member,
|
|
@@ -2078,8 +2075,8 @@ var UserBadge = () => {
|
|
|
2078
2075
|
"focus-visible:shadow-borders-focus"
|
|
2079
2076
|
),
|
|
2080
2077
|
children: [
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ jsx9("div", { className: "flex size-6 shrink-0 items-center justify-center", children: fallback ? /* @__PURE__ */ jsx9(Avatar, { size: "xsmall", fallback }) : /* @__PURE__ */ jsx9(Skeleton, { className: "h-6 w-6 rounded-full" }) }),
|
|
2079
|
+
/* @__PURE__ */ jsx9("div", { className: clx4("flex items-center overflow-hidden whitespace-nowrap", SIDEBAR_RAIL_FADE), children: displayName ? /* @__PURE__ */ jsx9(
|
|
2083
2080
|
Text3,
|
|
2084
2081
|
{
|
|
2085
2082
|
size: "xsmall",
|
|
@@ -2088,8 +2085,8 @@ var UserBadge = () => {
|
|
|
2088
2085
|
className: "truncate",
|
|
2089
2086
|
children: displayName
|
|
2090
2087
|
}
|
|
2091
|
-
) : /* @__PURE__ */
|
|
2092
|
-
/* @__PURE__ */
|
|
2088
|
+
) : /* @__PURE__ */ jsx9(Skeleton, { className: "h-[9px] w-[70px]" }) }),
|
|
2089
|
+
/* @__PURE__ */ jsx9(EllipsisHorizontal, { className: clx4("text-ui-fg-muted", SIDEBAR_RAIL_FADE) })
|
|
2093
2090
|
]
|
|
2094
2091
|
}
|
|
2095
2092
|
) });
|
|
@@ -2104,13 +2101,13 @@ var ThemeToggle = () => {
|
|
|
2104
2101
|
dir: "ltr",
|
|
2105
2102
|
className: "rounded-md rtl:rotate-180",
|
|
2106
2103
|
children: [
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx9(CircleHalfSolid, { className: "text-ui-fg-subtle me-2" }),
|
|
2105
|
+
/* @__PURE__ */ jsx9("span", { className: "rtl:rotate-180", children: t2("app.menus.user.theme.label") })
|
|
2109
2106
|
]
|
|
2110
2107
|
}
|
|
2111
2108
|
),
|
|
2112
|
-
/* @__PURE__ */
|
|
2113
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.SubMenuContent, { children: /* @__PURE__ */ jsxs5(DropdownMenu2.RadioGroup, { value: theme, children: [
|
|
2110
|
+
/* @__PURE__ */ jsx9(
|
|
2114
2111
|
DropdownMenu2.RadioItem,
|
|
2115
2112
|
{
|
|
2116
2113
|
value: "system",
|
|
@@ -2121,7 +2118,7 @@ var ThemeToggle = () => {
|
|
|
2121
2118
|
children: t2("app.menus.user.theme.system")
|
|
2122
2119
|
}
|
|
2123
2120
|
),
|
|
2124
|
-
/* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ jsx9(
|
|
2125
2122
|
DropdownMenu2.RadioItem,
|
|
2126
2123
|
{
|
|
2127
2124
|
value: "light",
|
|
@@ -2132,7 +2129,7 @@ var ThemeToggle = () => {
|
|
|
2132
2129
|
children: t2("app.menus.user.theme.light")
|
|
2133
2130
|
}
|
|
2134
2131
|
),
|
|
2135
|
-
/* @__PURE__ */
|
|
2132
|
+
/* @__PURE__ */ jsx9(
|
|
2136
2133
|
DropdownMenu2.RadioItem,
|
|
2137
2134
|
{
|
|
2138
2135
|
value: "dark",
|
|
@@ -2161,12 +2158,12 @@ var LanguageToggle = () => {
|
|
|
2161
2158
|
dir: "ltr",
|
|
2162
2159
|
className: "rounded-md rtl:rotate-180",
|
|
2163
2160
|
children: [
|
|
2164
|
-
/* @__PURE__ */
|
|
2165
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ jsx9(GlobeEurope, { className: "text-ui-fg-subtle me-2" }),
|
|
2162
|
+
/* @__PURE__ */ jsx9("span", { className: "rtl:rotate-180", children: currentLanguage?.display_name ?? t2("profile.fields.languageLabel") })
|
|
2166
2163
|
]
|
|
2167
2164
|
}
|
|
2168
2165
|
),
|
|
2169
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsx9(DropdownMenu2.SubMenuContent, { className: "max-h-[300px] overflow-y-auto", children: /* @__PURE__ */ jsx9(DropdownMenu2.RadioGroup, { value: i18n.language, children: sortedLanguages.map((language) => /* @__PURE__ */ jsx9(
|
|
2170
2167
|
DropdownMenu2.RadioItem,
|
|
2171
2168
|
{
|
|
2172
2169
|
value: language.code,
|
|
@@ -2192,33 +2189,33 @@ var Logout = () => {
|
|
|
2192
2189
|
}
|
|
2193
2190
|
});
|
|
2194
2191
|
};
|
|
2195
|
-
return /* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsx9(DropdownMenu2.Item, { onClick: handleLogout, children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-2", children: [
|
|
2193
|
+
/* @__PURE__ */ jsx9(OpenRectArrowOut, { className: "text-ui-fg-subtle" }),
|
|
2194
|
+
/* @__PURE__ */ jsx9("span", { children: t2("app.menus.actions.logout") })
|
|
2198
2195
|
] }) });
|
|
2199
2196
|
};
|
|
2200
2197
|
var GlobalKeybindsModal = (props) => {
|
|
2201
2198
|
const { t: t2 } = useTranslation6();
|
|
2202
2199
|
const globalShortcuts = useGlobalShortcuts();
|
|
2203
|
-
const [searchValue, onSearchValueChange] =
|
|
2200
|
+
const [searchValue, onSearchValueChange] = useState9("");
|
|
2204
2201
|
const searchResults = searchValue ? globalShortcuts.filter((shortcut) => {
|
|
2205
2202
|
return shortcut.label.toLowerCase().includes(searchValue?.toLowerCase());
|
|
2206
2203
|
}) : globalShortcuts;
|
|
2207
|
-
return /* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ jsx9(RadixDialog3.Root, { ...props, children: /* @__PURE__ */ jsxs5(RadixDialog3.Portal, { children: [
|
|
2205
|
+
/* @__PURE__ */ jsx9(RadixDialog3.Overlay, { className: "bg-ui-bg-overlay fixed inset-0" }),
|
|
2209
2206
|
/* @__PURE__ */ jsxs5(RadixDialog3.Content, { className: "bg-ui-bg-subtle shadow-elevation-modal fixed left-[50%] top-[50%] flex h-full max-h-[612px] w-full max-w-[560px] translate-x-[-50%] translate-y-[-50%] flex-col divide-y overflow-hidden rounded-lg", children: [
|
|
2210
2207
|
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-y-3 px-6 py-4", children: [
|
|
2211
2208
|
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
2212
2209
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ jsx9(RadixDialog3.Title, { asChild: true, children: /* @__PURE__ */ jsx9(Heading, { children: t2("app.menus.user.shortcuts") }) }),
|
|
2211
|
+
/* @__PURE__ */ jsx9(RadixDialog3.Description, { className: "sr-only" })
|
|
2215
2212
|
] }),
|
|
2216
2213
|
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-2", children: [
|
|
2217
|
-
/* @__PURE__ */
|
|
2218
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsx9(Kbd3, { children: "esc" }),
|
|
2215
|
+
/* @__PURE__ */ jsx9(RadixDialog3.Close, { asChild: true, children: /* @__PURE__ */ jsx9(IconButton3, { variant: "transparent", size: "small", children: /* @__PURE__ */ jsx9(XMark2, {}) }) })
|
|
2219
2216
|
] })
|
|
2220
2217
|
] }),
|
|
2221
|
-
/* @__PURE__ */
|
|
2218
|
+
/* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9(
|
|
2222
2219
|
Input,
|
|
2223
2220
|
{
|
|
2224
2221
|
type: "search",
|
|
@@ -2227,17 +2224,17 @@ var GlobalKeybindsModal = (props) => {
|
|
|
2227
2224
|
}
|
|
2228
2225
|
) })
|
|
2229
2226
|
] }),
|
|
2230
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ jsx9("div", { className: "flex flex-col divide-y overflow-y-auto", children: searchResults.map((shortcut, index) => {
|
|
2231
2228
|
return /* @__PURE__ */ jsxs5(
|
|
2232
2229
|
"div",
|
|
2233
2230
|
{
|
|
2234
2231
|
className: "text-ui-fg-subtle flex items-center justify-between px-6 py-3",
|
|
2235
2232
|
children: [
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ jsx9(Text3, { size: "small", children: shortcut.label }),
|
|
2234
|
+
/* @__PURE__ */ jsx9("div", { className: "flex items-center gap-x-1", children: shortcut.keys.Mac?.map((key, index2) => {
|
|
2238
2235
|
return /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-1", children: [
|
|
2239
|
-
/* @__PURE__ */
|
|
2240
|
-
index2 < (shortcut.keys.Mac?.length || 0) - 1 && /* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx9(Kbd3, { children: key }),
|
|
2237
|
+
index2 < (shortcut.keys.Mac?.length || 0) - 1 && /* @__PURE__ */ jsx9("span", { className: "txt-compact-xsmall text-ui-fg-subtle", children: t2("app.keyboardShortcuts.then") })
|
|
2241
2238
|
] }, index2);
|
|
2242
2239
|
}) })
|
|
2243
2240
|
]
|
|
@@ -2253,7 +2250,7 @@ var UserItem = () => {
|
|
|
2253
2250
|
const member = seller_member?.member;
|
|
2254
2251
|
const loaded = !isPending && !!member;
|
|
2255
2252
|
if (!loaded) {
|
|
2256
|
-
return /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ jsx9("div", {});
|
|
2257
2254
|
}
|
|
2258
2255
|
const fullName = [member.first_name, member.last_name].filter(Boolean).join(" ").trim();
|
|
2259
2256
|
const displayName = fullName || member.email;
|
|
@@ -2263,9 +2260,9 @@ var UserItem = () => {
|
|
|
2263
2260
|
throw error;
|
|
2264
2261
|
}
|
|
2265
2262
|
return /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-3 overflow-hidden px-2 py-1", children: [
|
|
2266
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ jsx9(Avatar, { size: "small", variant: "rounded", fallback }),
|
|
2267
2264
|
/* @__PURE__ */ jsxs5("div", { className: "block w-full min-w-0 max-w-[187px] overflow-hidden whitespace-nowrap", children: [
|
|
2268
|
-
/* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ jsx9(
|
|
2269
2266
|
Text3,
|
|
2270
2267
|
{
|
|
2271
2268
|
size: "small",
|
|
@@ -2275,7 +2272,7 @@ var UserItem = () => {
|
|
|
2275
2272
|
children: displayName
|
|
2276
2273
|
}
|
|
2277
2274
|
),
|
|
2278
|
-
!!email && displayName !== email && /* @__PURE__ */
|
|
2275
|
+
!!email && displayName !== email && /* @__PURE__ */ jsx9(
|
|
2279
2276
|
Text3,
|
|
2280
2277
|
{
|
|
2281
2278
|
size: "xsmall",
|
|
@@ -2300,16 +2297,16 @@ import {
|
|
|
2300
2297
|
import { ExclamationCircle } from "@medusajs/icons";
|
|
2301
2298
|
import { Text as Text4 } from "@medusajs/ui";
|
|
2302
2299
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
2303
|
-
import { Navigate as Navigate2, useLocation as
|
|
2304
|
-
import { jsx as
|
|
2300
|
+
import { Navigate as Navigate2, useLocation as useLocation6, useRouteError } from "react-router-dom";
|
|
2301
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2305
2302
|
var ErrorBoundary = () => {
|
|
2306
2303
|
const error = useRouteError();
|
|
2307
|
-
const location =
|
|
2304
|
+
const location = useLocation6();
|
|
2308
2305
|
const { t: t2 } = useTranslation7();
|
|
2309
2306
|
let code = null;
|
|
2310
2307
|
if (isClientError(error)) {
|
|
2311
2308
|
if (error.status === 401) {
|
|
2312
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx10(Navigate2, { to: "/login", state: { from: location }, replace: true });
|
|
2313
2310
|
}
|
|
2314
2311
|
code = error.status ?? null;
|
|
2315
2312
|
}
|
|
@@ -2336,11 +2333,11 @@ var ErrorBoundary = () => {
|
|
|
2336
2333
|
message = t2("errorBoundary.defaultMessage");
|
|
2337
2334
|
break;
|
|
2338
2335
|
}
|
|
2339
|
-
return /* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ jsx10("div", { className: "flex size-full min-h-[calc(100vh-57px-24px)] items-center justify-center", children: /* @__PURE__ */ jsx10("div", { className: "flex flex-col gap-y-6", children: /* @__PURE__ */ jsxs6("div", { className: "text-ui-fg-subtle flex flex-col items-center gap-y-3", children: [
|
|
2337
|
+
/* @__PURE__ */ jsx10(ExclamationCircle, {}),
|
|
2341
2338
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center justify-center gap-y-1", children: [
|
|
2342
|
-
/* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ jsx10(Text4, { size: "small", leading: "compact", weight: "plus", children: title }),
|
|
2340
|
+
/* @__PURE__ */ jsx10(
|
|
2344
2341
|
Text4,
|
|
2345
2342
|
{
|
|
2346
2343
|
size: "small",
|
|
@@ -2529,7 +2526,7 @@ var ROUTE_PERMISSIONS = {
|
|
|
2529
2526
|
var getRoutePermission = (path) => ROUTE_PERMISSIONS[path];
|
|
2530
2527
|
|
|
2531
2528
|
// src/components/layout/main-layout/main-layout.tsx
|
|
2532
|
-
import { Fragment as Fragment2, jsx as
|
|
2529
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2533
2530
|
var navId = (to) => to.replace(/^\//, "");
|
|
2534
2531
|
var toCoreNavItem = (route) => ({
|
|
2535
2532
|
id: navId(route.to),
|
|
@@ -2543,7 +2540,7 @@ var toCoreNavItem = (route) => ({
|
|
|
2543
2540
|
}))
|
|
2544
2541
|
});
|
|
2545
2542
|
var MainLayout = () => {
|
|
2546
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ jsx11(Shell, { children: /* @__PURE__ */ jsx11(MainSidebar, {}) });
|
|
2547
2544
|
};
|
|
2548
2545
|
var allMenuItems = menuItemsModule.menuItems ?? [];
|
|
2549
2546
|
var addNestedItems = (to, menuItems, items) => {
|
|
@@ -2588,25 +2585,25 @@ var MainSidebar = () => {
|
|
|
2588
2585
|
return {
|
|
2589
2586
|
label: item.label,
|
|
2590
2587
|
to: item.path,
|
|
2591
|
-
icon: Icon2 ? /* @__PURE__ */
|
|
2588
|
+
icon: Icon2 ? /* @__PURE__ */ jsx11(Icon2, {}) : void 0,
|
|
2592
2589
|
translationNs: item.translationNs,
|
|
2593
2590
|
items: addNestedItems(item.path, visibleMenuItems)
|
|
2594
2591
|
};
|
|
2595
2592
|
});
|
|
2596
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ jsx11("aside", { className: "flex flex-1 flex-col justify-between overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-1 flex-col", children: [
|
|
2597
2594
|
/* @__PURE__ */ jsxs7("div", { className: "bg-ui-bg-subtle sticky top-0", children: [
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
/* @__PURE__ */
|
|
2595
|
+
/* @__PURE__ */ jsx11(Header, {}),
|
|
2596
|
+
/* @__PURE__ */ jsx11("div", { className: "px-3", children: /* @__PURE__ */ jsx11(Divider, { variant: "dashed" }) })
|
|
2600
2597
|
] }),
|
|
2601
2598
|
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 flex-col justify-between", children: [
|
|
2602
|
-
/* @__PURE__ */
|
|
2603
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ jsx11("div", { className: "flex flex-1 flex-col", children: /* @__PURE__ */ jsxs7("nav", { className: "flex flex-col gap-y-1 py-3", children: [
|
|
2600
|
+
/* @__PURE__ */ jsx11(Searchbar, {}),
|
|
2604
2601
|
routesWithNested.map((route) => {
|
|
2605
|
-
return /* @__PURE__ */
|
|
2602
|
+
return /* @__PURE__ */ jsx11(NavItem, { ...route }, route.to);
|
|
2606
2603
|
}),
|
|
2607
|
-
customRoutesWithNested.map((route) => /* @__PURE__ */
|
|
2604
|
+
customRoutesWithNested.map((route) => /* @__PURE__ */ jsx11(NavItem, { ...route }, route.to))
|
|
2608
2605
|
] }) }),
|
|
2609
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx11(UtilitySection, {})
|
|
2610
2607
|
] })
|
|
2611
2608
|
] }) });
|
|
2612
2609
|
};
|
|
@@ -2622,7 +2619,7 @@ var StoreList = ({ currentSellerId }) => {
|
|
|
2622
2619
|
navigate("/", { replace: true });
|
|
2623
2620
|
};
|
|
2624
2621
|
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
2625
|
-
!!seller_members?.length && /* @__PURE__ */
|
|
2622
|
+
!!seller_members?.length && /* @__PURE__ */ jsx11(DropdownMenu3.RadioGroup, { value: currentSellerId, children: seller_members.map((member) => {
|
|
2626
2623
|
const seller = member.seller;
|
|
2627
2624
|
return /* @__PURE__ */ jsxs7(
|
|
2628
2625
|
DropdownMenu3.RadioItem,
|
|
@@ -2634,7 +2631,7 @@ var StoreList = ({ currentSellerId }) => {
|
|
|
2634
2631
|
},
|
|
2635
2632
|
className: "gap-x-2",
|
|
2636
2633
|
children: [
|
|
2637
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ jsx11(
|
|
2638
2635
|
Avatar2,
|
|
2639
2636
|
{
|
|
2640
2637
|
variant: "squared",
|
|
@@ -2642,7 +2639,7 @@ var StoreList = ({ currentSellerId }) => {
|
|
|
2642
2639
|
fallback: seller.name.charAt(0).toUpperCase()
|
|
2643
2640
|
}
|
|
2644
2641
|
),
|
|
2645
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ jsx11(
|
|
2646
2643
|
Text5,
|
|
2647
2644
|
{
|
|
2648
2645
|
size: "small",
|
|
@@ -2657,7 +2654,7 @@ var StoreList = ({ currentSellerId }) => {
|
|
|
2657
2654
|
seller.id
|
|
2658
2655
|
);
|
|
2659
2656
|
}) }),
|
|
2660
|
-
!!seller_members?.length && /* @__PURE__ */
|
|
2657
|
+
!!seller_members?.length && /* @__PURE__ */ jsx11(DropdownMenu3.Separator, {}),
|
|
2661
2658
|
/* @__PURE__ */ jsxs7(
|
|
2662
2659
|
DropdownMenu3.Item,
|
|
2663
2660
|
{
|
|
@@ -2666,8 +2663,8 @@ var StoreList = ({ currentSellerId }) => {
|
|
|
2666
2663
|
}),
|
|
2667
2664
|
className: "gap-x-2",
|
|
2668
2665
|
children: [
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsx11(Plus2, { className: "text-ui-fg-subtle" }),
|
|
2667
|
+
/* @__PURE__ */ jsx11(Text5, { size: "small", weight: "plus", leading: "compact", children: t2("storeSelect.addNewStore") })
|
|
2671
2668
|
]
|
|
2672
2669
|
}
|
|
2673
2670
|
)
|
|
@@ -2683,7 +2680,7 @@ var Header = () => {
|
|
|
2683
2680
|
if (isError) {
|
|
2684
2681
|
throw error;
|
|
2685
2682
|
}
|
|
2686
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ jsx11("div", { className: "w-full p-3", children: /* @__PURE__ */ jsxs7(DropdownMenu3, { dir: direction, children: [
|
|
2687
2684
|
/* @__PURE__ */ jsxs7(
|
|
2688
2685
|
DropdownMenu3.Trigger,
|
|
2689
2686
|
{
|
|
@@ -2695,8 +2692,8 @@ var Header = () => {
|
|
|
2695
2692
|
"focus-visible:shadow-borders-focus"
|
|
2696
2693
|
),
|
|
2697
2694
|
children: [
|
|
2698
|
-
fallback ? /* @__PURE__ */
|
|
2699
|
-
/* @__PURE__ */
|
|
2695
|
+
fallback ? /* @__PURE__ */ jsx11(Avatar2, { variant: "squared", size: "xsmall", fallback }) : /* @__PURE__ */ jsx11(Skeleton, { className: "h-6 w-6 rounded-md" }),
|
|
2696
|
+
/* @__PURE__ */ jsx11("div", { className: clx5("block overflow-hidden whitespace-nowrap text-start", SIDEBAR_RAIL_FADE), children: name ? /* @__PURE__ */ jsx11(
|
|
2700
2697
|
Text5,
|
|
2701
2698
|
{
|
|
2702
2699
|
size: "small",
|
|
@@ -2705,16 +2702,16 @@ var Header = () => {
|
|
|
2705
2702
|
className: "truncate",
|
|
2706
2703
|
children: seller_member.seller.name
|
|
2707
2704
|
}
|
|
2708
|
-
) : /* @__PURE__ */
|
|
2709
|
-
/* @__PURE__ */
|
|
2705
|
+
) : /* @__PURE__ */ jsx11(Skeleton, { className: "h-[9px] w-[120px]" }) }),
|
|
2706
|
+
/* @__PURE__ */ jsx11(EllipsisHorizontal2, { className: clx5("text-ui-fg-muted", SIDEBAR_RAIL_FADE) })
|
|
2710
2707
|
]
|
|
2711
2708
|
}
|
|
2712
2709
|
),
|
|
2713
2710
|
isLoaded && /* @__PURE__ */ jsxs7(DropdownMenu3.Content, { className: "w-[var(--radix-dropdown-menu-trigger-width)] min-w-0", children: [
|
|
2714
2711
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-3 px-2 py-1", children: [
|
|
2715
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx11(Avatar2, { variant: "squared", size: "small", fallback }),
|
|
2716
2713
|
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col overflow-hidden", children: [
|
|
2717
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsx11(
|
|
2718
2715
|
Text5,
|
|
2719
2716
|
{
|
|
2720
2717
|
size: "small",
|
|
@@ -2724,7 +2721,7 @@ var Header = () => {
|
|
|
2724
2721
|
children: name
|
|
2725
2722
|
}
|
|
2726
2723
|
),
|
|
2727
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsx11(
|
|
2728
2725
|
Text5,
|
|
2729
2726
|
{
|
|
2730
2727
|
size: "xsmall",
|
|
@@ -2735,8 +2732,8 @@ var Header = () => {
|
|
|
2735
2732
|
)
|
|
2736
2733
|
] })
|
|
2737
2734
|
] }),
|
|
2738
|
-
/* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ jsx11(DropdownMenu3.Separator, {}),
|
|
2736
|
+
/* @__PURE__ */ jsx11(StoreList, { currentSellerId: seller_member.seller.id })
|
|
2740
2737
|
] })
|
|
2741
2738
|
] }) });
|
|
2742
2739
|
};
|
|
@@ -2744,7 +2741,7 @@ var useCoreRoutes = () => {
|
|
|
2744
2741
|
const { t: t2 } = useTranslation8();
|
|
2745
2742
|
return [
|
|
2746
2743
|
{
|
|
2747
|
-
icon: /* @__PURE__ */
|
|
2744
|
+
icon: /* @__PURE__ */ jsx11(ShoppingCart, {}),
|
|
2748
2745
|
label: t2("orders.domain"),
|
|
2749
2746
|
to: "/orders",
|
|
2750
2747
|
items: [
|
|
@@ -2756,7 +2753,7 @@ var useCoreRoutes = () => {
|
|
|
2756
2753
|
]
|
|
2757
2754
|
},
|
|
2758
2755
|
{
|
|
2759
|
-
icon: /* @__PURE__ */
|
|
2756
|
+
icon: /* @__PURE__ */ jsx11(Tag, {}),
|
|
2760
2757
|
label: t2("products.domain"),
|
|
2761
2758
|
to: "/products",
|
|
2762
2759
|
items: [
|
|
@@ -2780,7 +2777,7 @@ var useCoreRoutes = () => {
|
|
|
2780
2777
|
]
|
|
2781
2778
|
},
|
|
2782
2779
|
{
|
|
2783
|
-
icon: /* @__PURE__ */
|
|
2780
|
+
icon: /* @__PURE__ */ jsx11(Buildings, {}),
|
|
2784
2781
|
label: t2("inventory.domain"),
|
|
2785
2782
|
to: "/inventory",
|
|
2786
2783
|
items: [
|
|
@@ -2791,7 +2788,7 @@ var useCoreRoutes = () => {
|
|
|
2791
2788
|
]
|
|
2792
2789
|
},
|
|
2793
2790
|
{
|
|
2794
|
-
icon: /* @__PURE__ */
|
|
2791
|
+
icon: /* @__PURE__ */ jsx11(Users, {}),
|
|
2795
2792
|
label: t2("customers.domain"),
|
|
2796
2793
|
to: "/customers",
|
|
2797
2794
|
items: [
|
|
@@ -2802,7 +2799,7 @@ var useCoreRoutes = () => {
|
|
|
2802
2799
|
]
|
|
2803
2800
|
},
|
|
2804
2801
|
{
|
|
2805
|
-
icon: /* @__PURE__ */
|
|
2802
|
+
icon: /* @__PURE__ */ jsx11(ReceiptPercent, {}),
|
|
2806
2803
|
label: t2("promotions.domain"),
|
|
2807
2804
|
to: "/promotions",
|
|
2808
2805
|
items: [
|
|
@@ -2813,17 +2810,17 @@ var useCoreRoutes = () => {
|
|
|
2813
2810
|
]
|
|
2814
2811
|
},
|
|
2815
2812
|
{
|
|
2816
|
-
icon: /* @__PURE__ */
|
|
2813
|
+
icon: /* @__PURE__ */ jsx11(CurrencyDollar, {}),
|
|
2817
2814
|
label: t2("priceLists.domain"),
|
|
2818
2815
|
to: "/price-lists"
|
|
2819
2816
|
},
|
|
2820
2817
|
{
|
|
2821
|
-
icon: /* @__PURE__ */
|
|
2818
|
+
icon: /* @__PURE__ */ jsx11(CreditCardRefresh, {}),
|
|
2822
2819
|
label: t2("payouts.domain"),
|
|
2823
2820
|
to: "/payouts"
|
|
2824
2821
|
},
|
|
2825
2822
|
{
|
|
2826
|
-
icon: /* @__PURE__ */
|
|
2823
|
+
icon: /* @__PURE__ */ jsx11(StarSolid, {}),
|
|
2827
2824
|
label: t2("reviews.domain"),
|
|
2828
2825
|
to: "/reviews"
|
|
2829
2826
|
}
|
|
@@ -2832,60 +2829,60 @@ var useCoreRoutes = () => {
|
|
|
2832
2829
|
var Searchbar = () => {
|
|
2833
2830
|
const { t: t2 } = useTranslation8();
|
|
2834
2831
|
const { toggleSearch } = useSearch();
|
|
2835
|
-
return /* @__PURE__ */
|
|
2832
|
+
return /* @__PURE__ */ jsx11("div", { className: "px-3", children: /* @__PURE__ */ jsxs7(
|
|
2836
2833
|
"button",
|
|
2837
2834
|
{
|
|
2838
2835
|
onClick: toggleSearch,
|
|
2839
2836
|
className: clx5(
|
|
2840
|
-
"bg-ui-bg-subtle text-ui-fg-subtle flex w-full items-center gap-x-2.5 rounded-md px-2 py-1 outline-none",
|
|
2837
|
+
"bg-ui-bg-subtle text-ui-fg-subtle flex w-full items-center gap-x-2.5 rounded-md px-2 py-1 outline-none transition-[padding] duration-200 ease-sidebar motion-reduce:transition-none group-data-[state=collapsed]/sidebar:px-1",
|
|
2841
2838
|
"hover:bg-ui-bg-subtle-hover",
|
|
2842
2839
|
"focus-visible:shadow-borders-focus"
|
|
2843
2840
|
),
|
|
2844
2841
|
children: [
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ jsx11(MagnifyingGlass2, { className: "shrink-0" }),
|
|
2843
|
+
/* @__PURE__ */ jsx11("div", { className: clx5("flex-1 whitespace-nowrap text-start", SIDEBAR_RAIL_FADE), children: /* @__PURE__ */ jsx11(Text5, { size: "small", leading: "compact", weight: "plus", children: t2("app.search.label") }) }),
|
|
2844
|
+
/* @__PURE__ */ jsx11(Text5, { size: "small", leading: "compact", className: clx5("text-ui-fg-muted", SIDEBAR_RAIL_FADE), children: "\u2318K" })
|
|
2848
2845
|
]
|
|
2849
2846
|
}
|
|
2850
2847
|
) });
|
|
2851
2848
|
};
|
|
2852
2849
|
var UtilitySection = () => {
|
|
2853
|
-
const location =
|
|
2850
|
+
const location = useLocation7();
|
|
2854
2851
|
const { t: t2 } = useTranslation8();
|
|
2855
2852
|
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
|
|
2856
|
-
/* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-y-0.5 py-3", children: /* @__PURE__ */ jsx11(
|
|
2857
2854
|
NavItem,
|
|
2858
2855
|
{
|
|
2859
2856
|
label: t2("app.nav.settings.header"),
|
|
2860
2857
|
to: "/settings",
|
|
2861
2858
|
from: location.pathname,
|
|
2862
|
-
icon: /* @__PURE__ */
|
|
2859
|
+
icon: /* @__PURE__ */ jsx11(CogSixTooth, {})
|
|
2863
2860
|
}
|
|
2864
2861
|
) }),
|
|
2865
|
-
/* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ jsx11("div", { className: "px-3", children: /* @__PURE__ */ jsx11(Divider, { variant: "dashed" }) }),
|
|
2863
|
+
/* @__PURE__ */ jsx11(UserMenu, {})
|
|
2867
2864
|
] });
|
|
2868
2865
|
};
|
|
2869
2866
|
|
|
2870
2867
|
// src/components/layout/public-layout/public-layout.tsx
|
|
2871
2868
|
import { Outlet as Outlet3 } from "react-router-dom";
|
|
2872
|
-
import { jsx as
|
|
2869
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2873
2870
|
var PublicLayout = () => {
|
|
2874
|
-
return /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ jsx12(Outlet3, {});
|
|
2875
2872
|
};
|
|
2876
2873
|
|
|
2877
2874
|
// src/components/layout/settings-layout/settings-layout.tsx
|
|
2878
2875
|
import { ArrowUturnLeft as ArrowUturnLeft2, MinusMini } from "@medusajs/icons";
|
|
2879
2876
|
import { clx as clx6, Divider as Divider2, IconButton as IconButton4, Text as Text6 } from "@medusajs/ui";
|
|
2880
2877
|
import { Collapsible as RadixCollapsible2 } from "radix-ui";
|
|
2881
|
-
import { useEffect as
|
|
2878
|
+
import { useEffect as useEffect8, useMemo as useMemo6, useState as useState10 } from "react";
|
|
2882
2879
|
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
2883
|
-
import { Link as Link3, useLocation as
|
|
2880
|
+
import { Link as Link3, useLocation as useLocation8 } from "react-router-dom";
|
|
2884
2881
|
import menuItemsModule2 from "virtual:mercur/menu-items";
|
|
2885
2882
|
import { usePermissions as usePermissions2 } from "@mercurjs/dashboard-shared";
|
|
2886
|
-
import { jsx as
|
|
2883
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2887
2884
|
var SettingsLayout = () => {
|
|
2888
|
-
return /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ jsx13(Shell, { children: /* @__PURE__ */ jsx13(SettingsSidebar, {}) });
|
|
2889
2886
|
};
|
|
2890
2887
|
var allMenuItems2 = menuItemsModule2.menuItems ?? [];
|
|
2891
2888
|
var useExtensionNavItems = () => {
|
|
@@ -2955,31 +2952,31 @@ var SettingsSidebar = () => {
|
|
|
2955
2952
|
const { t: t2 } = useTranslation9();
|
|
2956
2953
|
return /* @__PURE__ */ jsxs8("aside", { className: "relative flex flex-1 flex-col justify-between overflow-y-auto", children: [
|
|
2957
2954
|
/* @__PURE__ */ jsxs8("div", { className: "bg-ui-bg-subtle sticky top-0", children: [
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ jsx13(Header2, {}),
|
|
2956
|
+
/* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center px-3", children: /* @__PURE__ */ jsx13(Divider2, { variant: "dashed" }) })
|
|
2960
2957
|
] }),
|
|
2961
2958
|
/* @__PURE__ */ jsxs8("div", { className: "flex flex-1 flex-col", children: [
|
|
2962
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ jsx13("div", { className: "flex flex-1 flex-col overflow-y-auto", children: /* @__PURE__ */ jsx13(
|
|
2963
2960
|
RadixCollapsibleSection,
|
|
2964
2961
|
{
|
|
2965
2962
|
label: t2("app.nav.settings.general"),
|
|
2966
2963
|
items: generalRoutes
|
|
2967
2964
|
}
|
|
2968
2965
|
) }),
|
|
2969
|
-
/* @__PURE__ */
|
|
2966
|
+
/* @__PURE__ */ jsx13("div", { className: "bg-ui-bg-subtle sticky bottom-0", children: /* @__PURE__ */ jsx13(UserSection, {}) })
|
|
2970
2967
|
] })
|
|
2971
2968
|
] });
|
|
2972
2969
|
};
|
|
2973
2970
|
var Header2 = () => {
|
|
2974
|
-
const [from, setFrom] =
|
|
2971
|
+
const [from, setFrom] = useState10("/orders");
|
|
2975
2972
|
const { t: t2 } = useTranslation9();
|
|
2976
|
-
const location =
|
|
2977
|
-
|
|
2973
|
+
const location = useLocation8();
|
|
2974
|
+
useEffect8(() => {
|
|
2978
2975
|
if (location.state?.from) {
|
|
2979
2976
|
setFrom(getSafeFromValue(location.state.from));
|
|
2980
2977
|
}
|
|
2981
2978
|
}, [location]);
|
|
2982
|
-
return /* @__PURE__ */
|
|
2979
|
+
return /* @__PURE__ */ jsx13("div", { className: "bg-ui-bg-subtle p-3", children: /* @__PURE__ */ jsx13(
|
|
2983
2980
|
Link3,
|
|
2984
2981
|
{
|
|
2985
2982
|
to: from,
|
|
@@ -2990,8 +2987,8 @@ var Header2 = () => {
|
|
|
2990
2987
|
"focus-visible:shadow-borders-focus"
|
|
2991
2988
|
),
|
|
2992
2989
|
children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-2.5 px-2 py-1", children: [
|
|
2993
|
-
/* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
2990
|
+
/* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx13(ArrowUturnLeft2, { className: "text-ui-fg-subtle" }) }),
|
|
2991
|
+
/* @__PURE__ */ jsx13(Text6, { leading: "compact", weight: "plus", size: "small", children: t2("app.nav.settings.header") })
|
|
2995
2992
|
] })
|
|
2996
2993
|
}
|
|
2997
2994
|
) });
|
|
@@ -3001,23 +2998,23 @@ var RadixCollapsibleSection = ({
|
|
|
3001
2998
|
items
|
|
3002
2999
|
}) => {
|
|
3003
3000
|
return /* @__PURE__ */ jsxs8(RadixCollapsible2.Root, { defaultOpen: true, className: "py-3", children: [
|
|
3004
|
-
/* @__PURE__ */
|
|
3005
|
-
/* @__PURE__ */
|
|
3006
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx13("div", { className: "px-3", children: /* @__PURE__ */ jsxs8("div", { className: "text-ui-fg-muted flex h-7 items-center justify-between px-2", children: [
|
|
3002
|
+
/* @__PURE__ */ jsx13(Text6, { size: "small", leading: "compact", children: label }),
|
|
3003
|
+
/* @__PURE__ */ jsx13(RadixCollapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx13(IconButton4, { size: "2xsmall", variant: "transparent", className: "static", children: /* @__PURE__ */ jsx13(MinusMini, { className: "text-ui-fg-muted" }) }) })
|
|
3007
3004
|
] }) }),
|
|
3008
|
-
/* @__PURE__ */
|
|
3005
|
+
/* @__PURE__ */ jsx13(RadixCollapsible2.Content, { children: /* @__PURE__ */ jsx13("div", { className: "pt-0.5", children: /* @__PURE__ */ jsx13("nav", { className: "flex flex-col gap-y-0.5", children: items.map((setting) => /* @__PURE__ */ jsx13(NavItem, { type: "setting", ...setting }, setting.to)) }) }) })
|
|
3009
3006
|
] });
|
|
3010
3007
|
};
|
|
3011
3008
|
var UserSection = () => {
|
|
3012
3009
|
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx13("div", { className: "px-3", children: /* @__PURE__ */ jsx13(Divider2, { variant: "dashed" }) }),
|
|
3011
|
+
/* @__PURE__ */ jsx13(UserMenu, {})
|
|
3015
3012
|
] });
|
|
3016
3013
|
};
|
|
3017
3014
|
|
|
3018
3015
|
// src/get-route-map.tsx
|
|
3019
3016
|
import { RoutePermissionGuard } from "@mercurjs/dashboard-shared";
|
|
3020
|
-
import { jsx as
|
|
3017
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
3021
3018
|
function mergeRoutes(baseRoutes, customRoutes2) {
|
|
3022
3019
|
const result = baseRoutes.map((route) => ({ ...route }));
|
|
3023
3020
|
for (const customRoute of customRoutes2) {
|
|
@@ -3047,33 +3044,33 @@ function getRouteMap({
|
|
|
3047
3044
|
return [
|
|
3048
3045
|
// PROTECTED - MAIN LAYOUT
|
|
3049
3046
|
{
|
|
3050
|
-
element: /* @__PURE__ */
|
|
3051
|
-
errorElement: /* @__PURE__ */
|
|
3047
|
+
element: /* @__PURE__ */ jsx14(ProtectedRoute, {}),
|
|
3048
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3052
3049
|
children: [
|
|
3053
3050
|
{
|
|
3054
|
-
element: /* @__PURE__ */
|
|
3051
|
+
element: /* @__PURE__ */ jsx14(MainLayout, {}),
|
|
3055
3052
|
children: [
|
|
3056
3053
|
{
|
|
3057
3054
|
// Pathless wrapper so every route below — including extension
|
|
3058
3055
|
// routes merged in from virtual:mercur/routes — is enforced
|
|
3059
3056
|
// without each one wiring its own guard element.
|
|
3060
|
-
element: /* @__PURE__ */
|
|
3057
|
+
element: /* @__PURE__ */ jsx14(RoutePermissionGuard, {}),
|
|
3061
3058
|
children: mergeRoutes(
|
|
3062
3059
|
[
|
|
3063
3060
|
{
|
|
3064
3061
|
path: "/",
|
|
3065
|
-
errorElement: /* @__PURE__ */
|
|
3062
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3066
3063
|
lazy: () => import("./home-I3OILW5Z.js")
|
|
3067
3064
|
},
|
|
3068
3065
|
{
|
|
3069
3066
|
path: "/products",
|
|
3070
|
-
errorElement: /* @__PURE__ */
|
|
3067
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3071
3068
|
handle: { breadcrumb: () => t("products.domain"), permissions: "product:read" },
|
|
3072
3069
|
children: [
|
|
3073
3070
|
{
|
|
3074
3071
|
path: "",
|
|
3075
3072
|
lazy: async () => {
|
|
3076
|
-
const { productListLoader, ProductListPage } = await import("./products-
|
|
3073
|
+
const { productListLoader, ProductListPage } = await import("./products-XXR5X5WL.js");
|
|
3077
3074
|
return {
|
|
3078
3075
|
Component: ProductListPage,
|
|
3079
3076
|
loader: productListLoader
|
|
@@ -3083,7 +3080,7 @@ function getRouteMap({
|
|
|
3083
3080
|
{
|
|
3084
3081
|
path: "create",
|
|
3085
3082
|
lazy: async () => {
|
|
3086
|
-
const { ProductCreatePage } = await import("./create-
|
|
3083
|
+
const { ProductCreatePage } = await import("./create-RUABSALH.js");
|
|
3087
3084
|
return {
|
|
3088
3085
|
Component: ProductCreatePage
|
|
3089
3086
|
};
|
|
@@ -3094,13 +3091,13 @@ function getRouteMap({
|
|
|
3094
3091
|
{
|
|
3095
3092
|
path: ":id",
|
|
3096
3093
|
lazy: async () => {
|
|
3097
|
-
const { loader } = await import("./[id]-
|
|
3094
|
+
const { loader } = await import("./[id]-QQYIWAS5.js");
|
|
3098
3095
|
const { Breadcrumb } = await import("./breadcrumb-CX5327S5.js");
|
|
3099
3096
|
return {
|
|
3100
3097
|
Component: Outlet4,
|
|
3101
3098
|
loader,
|
|
3102
3099
|
handle: {
|
|
3103
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3100
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3104
3101
|
}
|
|
3105
3102
|
};
|
|
3106
3103
|
},
|
|
@@ -3108,7 +3105,7 @@ function getRouteMap({
|
|
|
3108
3105
|
{
|
|
3109
3106
|
path: "",
|
|
3110
3107
|
lazy: async () => {
|
|
3111
|
-
const { ProductDetailPage } = await import("./[id]-
|
|
3108
|
+
const { ProductDetailPage } = await import("./[id]-QQYIWAS5.js");
|
|
3112
3109
|
return {
|
|
3113
3110
|
Component: ProductDetailPage
|
|
3114
3111
|
};
|
|
@@ -3116,11 +3113,11 @@ function getRouteMap({
|
|
|
3116
3113
|
children: [
|
|
3117
3114
|
{
|
|
3118
3115
|
path: "edit",
|
|
3119
|
-
lazy: () => import("./edit-
|
|
3116
|
+
lazy: () => import("./edit-67H4MI4N.js")
|
|
3120
3117
|
},
|
|
3121
3118
|
{
|
|
3122
3119
|
path: "edit-variant",
|
|
3123
|
-
lazy: () => import("./product-variant-edit-
|
|
3120
|
+
lazy: () => import("./product-variant-edit-ORLH3GH2.js")
|
|
3124
3121
|
},
|
|
3125
3122
|
{
|
|
3126
3123
|
path: "sales-channels",
|
|
@@ -3128,11 +3125,11 @@ function getRouteMap({
|
|
|
3128
3125
|
},
|
|
3129
3126
|
{
|
|
3130
3127
|
path: "organization",
|
|
3131
|
-
lazy: () => import("./organization-
|
|
3128
|
+
lazy: () => import("./organization-YELUM5LQ.js")
|
|
3132
3129
|
},
|
|
3133
3130
|
{
|
|
3134
3131
|
path: "media",
|
|
3135
|
-
lazy: () => import("./media-
|
|
3132
|
+
lazy: () => import("./media-V26WTPNX.js")
|
|
3136
3133
|
},
|
|
3137
3134
|
{
|
|
3138
3135
|
path: "attributes",
|
|
@@ -3140,15 +3137,15 @@ function getRouteMap({
|
|
|
3140
3137
|
},
|
|
3141
3138
|
{
|
|
3142
3139
|
path: "attributes/create",
|
|
3143
|
-
lazy: () => import("./create-
|
|
3140
|
+
lazy: () => import("./create-K2NJHBHH.js")
|
|
3144
3141
|
},
|
|
3145
3142
|
{
|
|
3146
3143
|
path: "attributes/add",
|
|
3147
|
-
lazy: () => import("./add-
|
|
3144
|
+
lazy: () => import("./add-TF35LMT6.js")
|
|
3148
3145
|
},
|
|
3149
3146
|
{
|
|
3150
3147
|
path: "attributes/:attribute_id/edit",
|
|
3151
|
-
lazy: () => import("./edit-
|
|
3148
|
+
lazy: () => import("./edit-FLABLGHV.js")
|
|
3152
3149
|
},
|
|
3153
3150
|
{
|
|
3154
3151
|
path: "metadata",
|
|
@@ -3160,7 +3157,7 @@ function getRouteMap({
|
|
|
3160
3157
|
},
|
|
3161
3158
|
{
|
|
3162
3159
|
path: "variants/create",
|
|
3163
|
-
lazy: () => import("./create-
|
|
3160
|
+
lazy: () => import("./create-N2AR6DLO.js")
|
|
3164
3161
|
}
|
|
3165
3162
|
]
|
|
3166
3163
|
},
|
|
@@ -3172,7 +3169,7 @@ function getRouteMap({
|
|
|
3172
3169
|
Component: Outlet4,
|
|
3173
3170
|
loader,
|
|
3174
3171
|
handle: {
|
|
3175
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3172
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3176
3173
|
}
|
|
3177
3174
|
};
|
|
3178
3175
|
},
|
|
@@ -3183,11 +3180,11 @@ function getRouteMap({
|
|
|
3183
3180
|
children: [
|
|
3184
3181
|
{
|
|
3185
3182
|
path: "edit",
|
|
3186
|
-
lazy: () => import("./product-variant-edit-
|
|
3183
|
+
lazy: () => import("./product-variant-edit-ORLH3GH2.js")
|
|
3187
3184
|
},
|
|
3188
3185
|
{
|
|
3189
3186
|
path: "media",
|
|
3190
|
-
lazy: () => import("./media-
|
|
3187
|
+
lazy: () => import("./media-UDWJKTEE.js")
|
|
3191
3188
|
}
|
|
3192
3189
|
]
|
|
3193
3190
|
}
|
|
@@ -3200,13 +3197,13 @@ function getRouteMap({
|
|
|
3200
3197
|
// ORDERS
|
|
3201
3198
|
{
|
|
3202
3199
|
path: "/orders",
|
|
3203
|
-
errorElement: /* @__PURE__ */
|
|
3200
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3204
3201
|
handle: { breadcrumb: () => t("orders.domain"), permissions: "order:read" },
|
|
3205
3202
|
children: [
|
|
3206
3203
|
{
|
|
3207
3204
|
path: "",
|
|
3208
3205
|
lazy: async () => {
|
|
3209
|
-
const { OrderListPage } = await import("./orders-
|
|
3206
|
+
const { OrderListPage } = await import("./orders-CQMQBAV7.js");
|
|
3210
3207
|
return { Component: OrderListPage };
|
|
3211
3208
|
}
|
|
3212
3209
|
},
|
|
@@ -3219,7 +3216,7 @@ function getRouteMap({
|
|
|
3219
3216
|
Component: Outlet4,
|
|
3220
3217
|
loader,
|
|
3221
3218
|
handle: {
|
|
3222
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3219
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3223
3220
|
}
|
|
3224
3221
|
};
|
|
3225
3222
|
},
|
|
@@ -3276,7 +3273,7 @@ function getRouteMap({
|
|
|
3276
3273
|
// PAYOUTS
|
|
3277
3274
|
{
|
|
3278
3275
|
path: "/payouts",
|
|
3279
|
-
errorElement: /* @__PURE__ */
|
|
3276
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3280
3277
|
handle: { breadcrumb: () => "Payouts", permissions: "payout:read" },
|
|
3281
3278
|
children: [
|
|
3282
3279
|
{
|
|
@@ -3293,7 +3290,7 @@ function getRouteMap({
|
|
|
3293
3290
|
return {
|
|
3294
3291
|
Component: Outlet4,
|
|
3295
3292
|
handle: {
|
|
3296
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3293
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3297
3294
|
}
|
|
3298
3295
|
};
|
|
3299
3296
|
},
|
|
@@ -3312,7 +3309,7 @@ function getRouteMap({
|
|
|
3312
3309
|
// CATEGORIES
|
|
3313
3310
|
{
|
|
3314
3311
|
path: "/categories",
|
|
3315
|
-
errorElement: /* @__PURE__ */
|
|
3312
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3316
3313
|
handle: { breadcrumb: () => t("categories.domain"), permissions: "product_category:read" },
|
|
3317
3314
|
children: [
|
|
3318
3315
|
{
|
|
@@ -3333,13 +3330,13 @@ function getRouteMap({
|
|
|
3333
3330
|
{
|
|
3334
3331
|
path: ":id",
|
|
3335
3332
|
lazy: async () => {
|
|
3336
|
-
const { loader } = await import("./[id]-
|
|
3333
|
+
const { loader } = await import("./[id]-I77TGPCB.js");
|
|
3337
3334
|
const { Breadcrumb } = await import("./breadcrumb-VZPXSRPJ.js");
|
|
3338
3335
|
return {
|
|
3339
3336
|
Component: Outlet4,
|
|
3340
3337
|
loader,
|
|
3341
3338
|
handle: {
|
|
3342
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3339
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3343
3340
|
}
|
|
3344
3341
|
};
|
|
3345
3342
|
},
|
|
@@ -3347,7 +3344,7 @@ function getRouteMap({
|
|
|
3347
3344
|
{
|
|
3348
3345
|
path: "",
|
|
3349
3346
|
lazy: async () => {
|
|
3350
|
-
const { CategoryDetailPage } = await import("./[id]-
|
|
3347
|
+
const { CategoryDetailPage } = await import("./[id]-I77TGPCB.js");
|
|
3351
3348
|
return {
|
|
3352
3349
|
Component: CategoryDetailPage
|
|
3353
3350
|
};
|
|
@@ -3355,7 +3352,7 @@ function getRouteMap({
|
|
|
3355
3352
|
children: [
|
|
3356
3353
|
{
|
|
3357
3354
|
path: "products",
|
|
3358
|
-
lazy: () => import("./products-
|
|
3355
|
+
lazy: () => import("./products-Z7IZBB5V.js")
|
|
3359
3356
|
},
|
|
3360
3357
|
{
|
|
3361
3358
|
path: "organize",
|
|
@@ -3374,13 +3371,13 @@ function getRouteMap({
|
|
|
3374
3371
|
// COLLECTIONS
|
|
3375
3372
|
{
|
|
3376
3373
|
path: "/collections",
|
|
3377
|
-
errorElement: /* @__PURE__ */
|
|
3374
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3378
3375
|
handle: { breadcrumb: () => t("collections.domain"), permissions: "product_collection:read" },
|
|
3379
3376
|
children: [
|
|
3380
3377
|
{
|
|
3381
3378
|
path: "",
|
|
3382
3379
|
lazy: async () => {
|
|
3383
|
-
const { CollectionListPage } = await import("./collections-
|
|
3380
|
+
const { CollectionListPage } = await import("./collections-LKPOX523.js");
|
|
3384
3381
|
return {
|
|
3385
3382
|
Component: CollectionListPage
|
|
3386
3383
|
};
|
|
@@ -3389,13 +3386,13 @@ function getRouteMap({
|
|
|
3389
3386
|
{
|
|
3390
3387
|
path: ":id",
|
|
3391
3388
|
lazy: async () => {
|
|
3392
|
-
const { loader } = await import("./[id]-
|
|
3389
|
+
const { loader } = await import("./[id]-DMARVBSH.js");
|
|
3393
3390
|
const { Breadcrumb } = await import("./breadcrumb-NBO7UIBV.js");
|
|
3394
3391
|
return {
|
|
3395
3392
|
Component: Outlet4,
|
|
3396
3393
|
loader,
|
|
3397
3394
|
handle: {
|
|
3398
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3395
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3399
3396
|
}
|
|
3400
3397
|
};
|
|
3401
3398
|
},
|
|
@@ -3403,7 +3400,7 @@ function getRouteMap({
|
|
|
3403
3400
|
{
|
|
3404
3401
|
path: "",
|
|
3405
3402
|
lazy: async () => {
|
|
3406
|
-
const { CollectionDetailPage } = await import("./[id]-
|
|
3403
|
+
const { CollectionDetailPage } = await import("./[id]-DMARVBSH.js");
|
|
3407
3404
|
return {
|
|
3408
3405
|
Component: CollectionDetailPage
|
|
3409
3406
|
};
|
|
@@ -3411,7 +3408,7 @@ function getRouteMap({
|
|
|
3411
3408
|
children: [
|
|
3412
3409
|
{
|
|
3413
3410
|
path: "add-products",
|
|
3414
|
-
lazy: () => import("./add-products-
|
|
3411
|
+
lazy: () => import("./add-products-SQ2GDSFZ.js")
|
|
3415
3412
|
},
|
|
3416
3413
|
{
|
|
3417
3414
|
path: "metadata",
|
|
@@ -3426,7 +3423,7 @@ function getRouteMap({
|
|
|
3426
3423
|
// CUSTOMERS
|
|
3427
3424
|
{
|
|
3428
3425
|
path: "/customers",
|
|
3429
|
-
errorElement: /* @__PURE__ */
|
|
3426
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3430
3427
|
handle: { breadcrumb: () => t("customers.domain"), permissions: "customer:read" },
|
|
3431
3428
|
children: [
|
|
3432
3429
|
{
|
|
@@ -3441,13 +3438,13 @@ function getRouteMap({
|
|
|
3441
3438
|
{
|
|
3442
3439
|
path: ":id",
|
|
3443
3440
|
lazy: async () => {
|
|
3444
|
-
const { loader } = await import("./[id]-
|
|
3441
|
+
const { loader } = await import("./[id]-T7TRQELE.js");
|
|
3445
3442
|
const { Breadcrumb } = await import("./breadcrumb-GLBWFHKW.js");
|
|
3446
3443
|
return {
|
|
3447
3444
|
Component: Outlet4,
|
|
3448
3445
|
loader,
|
|
3449
3446
|
handle: {
|
|
3450
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3447
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3451
3448
|
}
|
|
3452
3449
|
};
|
|
3453
3450
|
},
|
|
@@ -3455,7 +3452,7 @@ function getRouteMap({
|
|
|
3455
3452
|
{
|
|
3456
3453
|
path: "",
|
|
3457
3454
|
lazy: async () => {
|
|
3458
|
-
const { CustomerDetailPage } = await import("./[id]-
|
|
3455
|
+
const { CustomerDetailPage } = await import("./[id]-T7TRQELE.js");
|
|
3459
3456
|
return {
|
|
3460
3457
|
Component: CustomerDetailPage
|
|
3461
3458
|
};
|
|
@@ -3474,7 +3471,7 @@ function getRouteMap({
|
|
|
3474
3471
|
// CUSTOMER GROUPS
|
|
3475
3472
|
{
|
|
3476
3473
|
path: "/customer-groups",
|
|
3477
|
-
errorElement: /* @__PURE__ */
|
|
3474
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3478
3475
|
handle: { breadcrumb: () => t("customerGroups.domain"), permissions: "customer_group:read" },
|
|
3479
3476
|
children: [
|
|
3480
3477
|
{
|
|
@@ -3501,7 +3498,7 @@ function getRouteMap({
|
|
|
3501
3498
|
Component: Outlet4,
|
|
3502
3499
|
loader,
|
|
3503
3500
|
handle: {
|
|
3504
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3501
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3505
3502
|
}
|
|
3506
3503
|
};
|
|
3507
3504
|
},
|
|
@@ -3532,19 +3529,19 @@ function getRouteMap({
|
|
|
3532
3529
|
// OFFERS
|
|
3533
3530
|
{
|
|
3534
3531
|
path: "/offers",
|
|
3535
|
-
errorElement: /* @__PURE__ */
|
|
3532
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3536
3533
|
handle: { breadcrumb: () => t("offers.domain"), permissions: "offer:read" },
|
|
3537
3534
|
children: [
|
|
3538
3535
|
{
|
|
3539
3536
|
path: "",
|
|
3540
3537
|
lazy: async () => {
|
|
3541
|
-
const { OfferListPage } = await import("./offers-
|
|
3538
|
+
const { OfferListPage } = await import("./offers-IRFEGWBD.js");
|
|
3542
3539
|
return { Component: OfferListPage };
|
|
3543
3540
|
},
|
|
3544
3541
|
children: [
|
|
3545
3542
|
{
|
|
3546
3543
|
path: "create",
|
|
3547
|
-
lazy: () => import("./offer-create-page-
|
|
3544
|
+
lazy: () => import("./offer-create-page-JV7YHF3Z.js")
|
|
3548
3545
|
}
|
|
3549
3546
|
]
|
|
3550
3547
|
},
|
|
@@ -3557,7 +3554,7 @@ function getRouteMap({
|
|
|
3557
3554
|
Component: Outlet4,
|
|
3558
3555
|
loader,
|
|
3559
3556
|
handle: {
|
|
3560
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3557
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3561
3558
|
}
|
|
3562
3559
|
};
|
|
3563
3560
|
},
|
|
@@ -3588,7 +3585,7 @@ function getRouteMap({
|
|
|
3588
3585
|
Component: Outlet4,
|
|
3589
3586
|
loader,
|
|
3590
3587
|
handle: {
|
|
3591
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3588
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3592
3589
|
}
|
|
3593
3590
|
};
|
|
3594
3591
|
},
|
|
@@ -3596,7 +3593,7 @@ function getRouteMap({
|
|
|
3596
3593
|
{
|
|
3597
3594
|
path: "",
|
|
3598
3595
|
lazy: async () => {
|
|
3599
|
-
const { OfferVariantDetailPage } = await import("./offer-variant-detail-page-
|
|
3596
|
+
const { OfferVariantDetailPage } = await import("./offer-variant-detail-page-BQQHAR67.js");
|
|
3600
3597
|
return { Component: OfferVariantDetailPage };
|
|
3601
3598
|
},
|
|
3602
3599
|
children: [
|
|
@@ -3610,7 +3607,7 @@ function getRouteMap({
|
|
|
3610
3607
|
},
|
|
3611
3608
|
{
|
|
3612
3609
|
path: "pricing",
|
|
3613
|
-
lazy: () => import("./pricing-
|
|
3610
|
+
lazy: () => import("./pricing-DKX2IPKN.js")
|
|
3614
3611
|
},
|
|
3615
3612
|
{
|
|
3616
3613
|
path: "inventory",
|
|
@@ -3631,7 +3628,7 @@ function getRouteMap({
|
|
|
3631
3628
|
// INVENTORY
|
|
3632
3629
|
{
|
|
3633
3630
|
path: "/inventory",
|
|
3634
|
-
errorElement: /* @__PURE__ */
|
|
3631
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3635
3632
|
handle: { breadcrumb: () => t("inventory.domain"), permissions: "inventory_item:read" },
|
|
3636
3633
|
children: [
|
|
3637
3634
|
{
|
|
@@ -3649,7 +3646,7 @@ function getRouteMap({
|
|
|
3649
3646
|
},
|
|
3650
3647
|
{
|
|
3651
3648
|
path: "stock",
|
|
3652
|
-
lazy: () => import("./stock-
|
|
3649
|
+
lazy: () => import("./stock-SOOPTVQ3.js")
|
|
3653
3650
|
}
|
|
3654
3651
|
]
|
|
3655
3652
|
},
|
|
@@ -3662,7 +3659,7 @@ function getRouteMap({
|
|
|
3662
3659
|
Component: Outlet4,
|
|
3663
3660
|
loader,
|
|
3664
3661
|
handle: {
|
|
3665
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3662
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3666
3663
|
}
|
|
3667
3664
|
};
|
|
3668
3665
|
},
|
|
@@ -3705,7 +3702,7 @@ function getRouteMap({
|
|
|
3705
3702
|
// PROMOTIONS
|
|
3706
3703
|
{
|
|
3707
3704
|
path: "/promotions",
|
|
3708
|
-
errorElement: /* @__PURE__ */
|
|
3705
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3709
3706
|
handle: { breadcrumb: () => t("promotions.domain"), permissions: "promotion:read" },
|
|
3710
3707
|
children: [
|
|
3711
3708
|
{
|
|
@@ -3732,7 +3729,7 @@ function getRouteMap({
|
|
|
3732
3729
|
Component: Outlet4,
|
|
3733
3730
|
loader,
|
|
3734
3731
|
handle: {
|
|
3735
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3732
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3736
3733
|
}
|
|
3737
3734
|
};
|
|
3738
3735
|
},
|
|
@@ -3767,7 +3764,7 @@ function getRouteMap({
|
|
|
3767
3764
|
// CAMPAIGNS
|
|
3768
3765
|
{
|
|
3769
3766
|
path: "/campaigns",
|
|
3770
|
-
errorElement: /* @__PURE__ */
|
|
3767
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3771
3768
|
handle: { breadcrumb: () => t("campaigns.domain"), permissions: "campaign:read" },
|
|
3772
3769
|
children: [
|
|
3773
3770
|
{
|
|
@@ -3794,7 +3791,7 @@ function getRouteMap({
|
|
|
3794
3791
|
Component: Outlet4,
|
|
3795
3792
|
loader,
|
|
3796
3793
|
handle: {
|
|
3797
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3794
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3798
3795
|
}
|
|
3799
3796
|
};
|
|
3800
3797
|
},
|
|
@@ -3838,7 +3835,7 @@ function getRouteMap({
|
|
|
3838
3835
|
// PRICE LISTS
|
|
3839
3836
|
{
|
|
3840
3837
|
path: "/price-lists",
|
|
3841
|
-
errorElement: /* @__PURE__ */
|
|
3838
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3842
3839
|
handle: { breadcrumb: () => t("priceLists.domain"), permissions: "price_list:read" },
|
|
3843
3840
|
children: [
|
|
3844
3841
|
{
|
|
@@ -3850,20 +3847,20 @@ function getRouteMap({
|
|
|
3850
3847
|
children: [
|
|
3851
3848
|
{
|
|
3852
3849
|
path: "create",
|
|
3853
|
-
lazy: () => import("./create-
|
|
3850
|
+
lazy: () => import("./create-R4WETVZJ.js")
|
|
3854
3851
|
}
|
|
3855
3852
|
]
|
|
3856
3853
|
},
|
|
3857
3854
|
{
|
|
3858
3855
|
path: ":id",
|
|
3859
3856
|
lazy: async () => {
|
|
3860
|
-
const { loader } = await import("./[id]-
|
|
3857
|
+
const { loader } = await import("./[id]-6ZGJSZKC.js");
|
|
3861
3858
|
const { Breadcrumb } = await import("./breadcrumb-4I7MU2QY.js");
|
|
3862
3859
|
return {
|
|
3863
3860
|
Component: Outlet4,
|
|
3864
3861
|
loader,
|
|
3865
3862
|
handle: {
|
|
3866
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3863
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3867
3864
|
}
|
|
3868
3865
|
};
|
|
3869
3866
|
},
|
|
@@ -3871,7 +3868,7 @@ function getRouteMap({
|
|
|
3871
3868
|
{
|
|
3872
3869
|
path: "",
|
|
3873
3870
|
lazy: async () => {
|
|
3874
|
-
const { PriceListDetailPage } = await import("./[id]-
|
|
3871
|
+
const { PriceListDetailPage } = await import("./[id]-6ZGJSZKC.js");
|
|
3875
3872
|
return { Component: PriceListDetailPage };
|
|
3876
3873
|
},
|
|
3877
3874
|
children: [
|
|
@@ -3889,15 +3886,15 @@ function getRouteMap({
|
|
|
3889
3886
|
},
|
|
3890
3887
|
{
|
|
3891
3888
|
path: "products/add",
|
|
3892
|
-
lazy: () => import("./add-
|
|
3889
|
+
lazy: () => import("./add-QIJFHIEN.js")
|
|
3893
3890
|
},
|
|
3894
3891
|
{
|
|
3895
3892
|
path: "products/edit",
|
|
3896
|
-
lazy: () => import("./edit-
|
|
3893
|
+
lazy: () => import("./edit-K4VVN6G3.js")
|
|
3897
3894
|
},
|
|
3898
3895
|
{
|
|
3899
3896
|
path: "products/:variant_id/edit",
|
|
3900
|
-
lazy: () => import("./edit-
|
|
3897
|
+
lazy: () => import("./edit-BRJA6WWU.js")
|
|
3901
3898
|
}
|
|
3902
3899
|
]
|
|
3903
3900
|
}
|
|
@@ -3908,7 +3905,7 @@ function getRouteMap({
|
|
|
3908
3905
|
// REVIEWS
|
|
3909
3906
|
{
|
|
3910
3907
|
path: "/reviews",
|
|
3911
|
-
errorElement: /* @__PURE__ */
|
|
3908
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3912
3909
|
handle: { breadcrumb: () => t("reviews.domain"), permissions: "review:read" },
|
|
3913
3910
|
children: [
|
|
3914
3911
|
{
|
|
@@ -3929,7 +3926,7 @@ function getRouteMap({
|
|
|
3929
3926
|
Component: Outlet4,
|
|
3930
3927
|
loader,
|
|
3931
3928
|
handle: {
|
|
3932
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3929
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3933
3930
|
}
|
|
3934
3931
|
};
|
|
3935
3932
|
},
|
|
@@ -3956,7 +3953,7 @@ function getRouteMap({
|
|
|
3956
3953
|
// RESERVATIONS
|
|
3957
3954
|
{
|
|
3958
3955
|
path: "/reservations",
|
|
3959
|
-
errorElement: /* @__PURE__ */
|
|
3956
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
3960
3957
|
handle: { breadcrumb: () => t("reservations.domain"), permissions: "reservation_item:read" },
|
|
3961
3958
|
children: [
|
|
3962
3959
|
{
|
|
@@ -3976,7 +3973,7 @@ function getRouteMap({
|
|
|
3976
3973
|
return {
|
|
3977
3974
|
Component: Outlet4,
|
|
3978
3975
|
handle: {
|
|
3979
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
3976
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
3980
3977
|
}
|
|
3981
3978
|
};
|
|
3982
3979
|
},
|
|
@@ -4009,26 +4006,26 @@ function getRouteMap({
|
|
|
4009
4006
|
},
|
|
4010
4007
|
// PROTECTED - SETTINGS LAYOUT
|
|
4011
4008
|
{
|
|
4012
|
-
element: /* @__PURE__ */
|
|
4013
|
-
errorElement: /* @__PURE__ */
|
|
4009
|
+
element: /* @__PURE__ */ jsx14(ProtectedRoute, {}),
|
|
4010
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4014
4011
|
children: [
|
|
4015
4012
|
{
|
|
4016
4013
|
path: "/settings",
|
|
4017
|
-
element: /* @__PURE__ */
|
|
4014
|
+
element: /* @__PURE__ */ jsx14(SettingsLayout, {}),
|
|
4018
4015
|
children: [
|
|
4019
4016
|
{
|
|
4020
|
-
element: /* @__PURE__ */
|
|
4017
|
+
element: /* @__PURE__ */ jsx14(RoutePermissionGuard, {}),
|
|
4021
4018
|
children: mergeRoutes(
|
|
4022
4019
|
[
|
|
4023
4020
|
{
|
|
4024
4021
|
index: true,
|
|
4025
|
-
errorElement: /* @__PURE__ */
|
|
4026
|
-
lazy: () => import("./settings-
|
|
4022
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4023
|
+
lazy: () => import("./settings-GX3SQTCF.js")
|
|
4027
4024
|
},
|
|
4028
4025
|
// PROFILE
|
|
4029
4026
|
{
|
|
4030
4027
|
path: "profile",
|
|
4031
|
-
errorElement: /* @__PURE__ */
|
|
4028
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4032
4029
|
handle: {
|
|
4033
4030
|
breadcrumb: () => t("profile.domain")
|
|
4034
4031
|
},
|
|
@@ -4054,7 +4051,7 @@ function getRouteMap({
|
|
|
4054
4051
|
// STORE
|
|
4055
4052
|
{
|
|
4056
4053
|
path: "store",
|
|
4057
|
-
errorElement: /* @__PURE__ */
|
|
4054
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4058
4055
|
handle: {
|
|
4059
4056
|
breadcrumb: () => t("app.menus.store.label"),
|
|
4060
4057
|
permissions: "seller:read"
|
|
@@ -4063,13 +4060,13 @@ function getRouteMap({
|
|
|
4063
4060
|
{
|
|
4064
4061
|
path: "",
|
|
4065
4062
|
lazy: async () => {
|
|
4066
|
-
const { StoreDetailPage } = await import("./store-
|
|
4063
|
+
const { StoreDetailPage } = await import("./store-GLZATKS6.js");
|
|
4067
4064
|
return { Component: StoreDetailPage };
|
|
4068
4065
|
},
|
|
4069
4066
|
children: [
|
|
4070
4067
|
{
|
|
4071
4068
|
path: "edit",
|
|
4072
|
-
lazy: () => import("./edit-
|
|
4069
|
+
lazy: () => import("./edit-E2I2D4SP.js")
|
|
4073
4070
|
},
|
|
4074
4071
|
{
|
|
4075
4072
|
path: "address",
|
|
@@ -4094,8 +4091,8 @@ function getRouteMap({
|
|
|
4094
4091
|
// LOCATIONS
|
|
4095
4092
|
{
|
|
4096
4093
|
path: "locations",
|
|
4097
|
-
errorElement: /* @__PURE__ */
|
|
4098
|
-
element: /* @__PURE__ */
|
|
4094
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4095
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4099
4096
|
handle: { breadcrumb: () => t("locations.domain"), permissions: "stock_location:read" },
|
|
4100
4097
|
children: [
|
|
4101
4098
|
{
|
|
@@ -4113,7 +4110,7 @@ function getRouteMap({
|
|
|
4113
4110
|
},
|
|
4114
4111
|
{
|
|
4115
4112
|
path: "shipping-profiles",
|
|
4116
|
-
element: /* @__PURE__ */
|
|
4113
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4117
4114
|
handle: {
|
|
4118
4115
|
breadcrumb: () => t("shippingProfile.domain"),
|
|
4119
4116
|
permissions: "shipping_profile:read"
|
|
@@ -4137,7 +4134,7 @@ function getRouteMap({
|
|
|
4137
4134
|
Component: Outlet4,
|
|
4138
4135
|
loader,
|
|
4139
4136
|
handle: {
|
|
4140
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
4137
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
4141
4138
|
}
|
|
4142
4139
|
};
|
|
4143
4140
|
},
|
|
@@ -4164,7 +4161,7 @@ function getRouteMap({
|
|
|
4164
4161
|
Component: Outlet4,
|
|
4165
4162
|
loader,
|
|
4166
4163
|
handle: {
|
|
4167
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
4164
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
4168
4165
|
}
|
|
4169
4166
|
};
|
|
4170
4167
|
},
|
|
@@ -4187,7 +4184,7 @@ function getRouteMap({
|
|
|
4187
4184
|
{
|
|
4188
4185
|
path: "fulfillment-providers",
|
|
4189
4186
|
handle: { permissions: "fulfillment_provider:read" },
|
|
4190
|
-
lazy: () => import("./fulfillment-providers-
|
|
4187
|
+
lazy: () => import("./fulfillment-providers-5Y3NKLTH.js")
|
|
4191
4188
|
},
|
|
4192
4189
|
{
|
|
4193
4190
|
path: "fulfillment-set/:fset_id/service-zones/create",
|
|
@@ -4222,8 +4219,8 @@ function getRouteMap({
|
|
|
4222
4219
|
// TAX REGIONS
|
|
4223
4220
|
{
|
|
4224
4221
|
path: "tax-regions",
|
|
4225
|
-
errorElement: /* @__PURE__ */
|
|
4226
|
-
element: /* @__PURE__ */
|
|
4222
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4223
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4227
4224
|
handle: { breadcrumb: () => t("taxRegions.domain"), permissions: "tax_region:read" },
|
|
4228
4225
|
children: [
|
|
4229
4226
|
{
|
|
@@ -4244,7 +4241,7 @@ function getRouteMap({
|
|
|
4244
4241
|
Component,
|
|
4245
4242
|
loader,
|
|
4246
4243
|
handle: {
|
|
4247
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
4244
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
4248
4245
|
}
|
|
4249
4246
|
};
|
|
4250
4247
|
},
|
|
@@ -4259,11 +4256,11 @@ function getRouteMap({
|
|
|
4259
4256
|
},
|
|
4260
4257
|
{
|
|
4261
4258
|
path: "tax-overrides/create",
|
|
4262
|
-
lazy: () => import("./create-
|
|
4259
|
+
lazy: () => import("./create-E4BS73BX.js")
|
|
4263
4260
|
},
|
|
4264
4261
|
{
|
|
4265
4262
|
path: "tax-overrides/:tax_rate_id/edit",
|
|
4266
|
-
lazy: () => import("./edit-
|
|
4263
|
+
lazy: () => import("./edit-NPZARFKL.js")
|
|
4267
4264
|
},
|
|
4268
4265
|
{
|
|
4269
4266
|
path: "provinces/create",
|
|
@@ -4277,7 +4274,7 @@ function getRouteMap({
|
|
|
4277
4274
|
Component,
|
|
4278
4275
|
loader,
|
|
4279
4276
|
handle: {
|
|
4280
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
4277
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
4281
4278
|
}
|
|
4282
4279
|
};
|
|
4283
4280
|
},
|
|
@@ -4292,11 +4289,11 @@ function getRouteMap({
|
|
|
4292
4289
|
},
|
|
4293
4290
|
{
|
|
4294
4291
|
path: "tax-overrides/create",
|
|
4295
|
-
lazy: () => import("./create-
|
|
4292
|
+
lazy: () => import("./create-E4BS73BX.js")
|
|
4296
4293
|
},
|
|
4297
4294
|
{
|
|
4298
4295
|
path: "tax-overrides/:tax_rate_id/edit",
|
|
4299
|
-
lazy: () => import("./edit-
|
|
4296
|
+
lazy: () => import("./edit-NPZARFKL.js")
|
|
4300
4297
|
}
|
|
4301
4298
|
]
|
|
4302
4299
|
}
|
|
@@ -4307,27 +4304,27 @@ function getRouteMap({
|
|
|
4307
4304
|
// PRODUCT TAGS
|
|
4308
4305
|
{
|
|
4309
4306
|
path: "product-tags",
|
|
4310
|
-
errorElement: /* @__PURE__ */
|
|
4311
|
-
element: /* @__PURE__ */
|
|
4307
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4308
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4312
4309
|
handle: { breadcrumb: () => t("productTags.domain"), permissions: "product_tag:read" },
|
|
4313
4310
|
children: [
|
|
4314
4311
|
{
|
|
4315
4312
|
path: "",
|
|
4316
4313
|
lazy: async () => {
|
|
4317
|
-
const { ProductTagListPage } = await import("./product-tags-
|
|
4314
|
+
const { ProductTagListPage } = await import("./product-tags-RMVY5VBE.js");
|
|
4318
4315
|
return { Component: ProductTagListPage };
|
|
4319
4316
|
}
|
|
4320
4317
|
},
|
|
4321
4318
|
{
|
|
4322
4319
|
path: ":id",
|
|
4323
4320
|
lazy: async () => {
|
|
4324
|
-
const { loader } = await import("./[id]-
|
|
4321
|
+
const { loader } = await import("./[id]-V3UXNOG3.js");
|
|
4325
4322
|
const { ProductTagDetailBreadcrumb: Breadcrumb } = await import("./breadcrumb-MXYBRR6Y.js");
|
|
4326
4323
|
return {
|
|
4327
4324
|
Component: Outlet4,
|
|
4328
4325
|
loader,
|
|
4329
4326
|
handle: {
|
|
4330
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
4327
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
4331
4328
|
}
|
|
4332
4329
|
};
|
|
4333
4330
|
},
|
|
@@ -4335,7 +4332,7 @@ function getRouteMap({
|
|
|
4335
4332
|
{
|
|
4336
4333
|
path: "",
|
|
4337
4334
|
lazy: async () => {
|
|
4338
|
-
const { ProductTagDetailPage } = await import("./[id]-
|
|
4335
|
+
const { ProductTagDetailPage } = await import("./[id]-V3UXNOG3.js");
|
|
4339
4336
|
return { Component: ProductTagDetailPage };
|
|
4340
4337
|
},
|
|
4341
4338
|
children: [
|
|
@@ -4352,21 +4349,21 @@ function getRouteMap({
|
|
|
4352
4349
|
// USERS
|
|
4353
4350
|
{
|
|
4354
4351
|
path: "users",
|
|
4355
|
-
errorElement: /* @__PURE__ */
|
|
4356
|
-
element: /* @__PURE__ */
|
|
4352
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4353
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4357
4354
|
handle: { breadcrumb: () => t("users.domain"), permissions: "seller_member:read" },
|
|
4358
4355
|
children: [
|
|
4359
4356
|
{
|
|
4360
4357
|
path: "",
|
|
4361
4358
|
lazy: async () => {
|
|
4362
|
-
const { TeamListPage } = await import("./team-
|
|
4359
|
+
const { TeamListPage } = await import("./team-5QN3RLLP.js");
|
|
4363
4360
|
return { Component: TeamListPage };
|
|
4364
4361
|
},
|
|
4365
4362
|
children: [
|
|
4366
4363
|
{
|
|
4367
4364
|
path: "invite",
|
|
4368
4365
|
lazy: async () => {
|
|
4369
|
-
const { TeamInvite } = await import("./invite-
|
|
4366
|
+
const { TeamInvite } = await import("./invite-TGSHN6JL.js");
|
|
4370
4367
|
return { Component: TeamInvite };
|
|
4371
4368
|
}
|
|
4372
4369
|
}
|
|
@@ -4377,8 +4374,8 @@ function getRouteMap({
|
|
|
4377
4374
|
// PRODUCT TYPES
|
|
4378
4375
|
{
|
|
4379
4376
|
path: "product-types",
|
|
4380
|
-
errorElement: /* @__PURE__ */
|
|
4381
|
-
element: /* @__PURE__ */
|
|
4377
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4378
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4382
4379
|
handle: { breadcrumb: () => t("productTypes.domain"), permissions: "product_type:read" },
|
|
4383
4380
|
children: [
|
|
4384
4381
|
{
|
|
@@ -4399,13 +4396,13 @@ function getRouteMap({
|
|
|
4399
4396
|
{
|
|
4400
4397
|
path: ":id",
|
|
4401
4398
|
lazy: async () => {
|
|
4402
|
-
const { productTypeLoader: loader } = await import("./[id]-
|
|
4399
|
+
const { productTypeLoader: loader } = await import("./[id]-DGDRYOXA.js");
|
|
4403
4400
|
const { ProductTypeDetailBreadcrumb: Breadcrumb } = await import("./breadcrumb-BJ4ACJY6.js");
|
|
4404
4401
|
return {
|
|
4405
4402
|
Component: Outlet4,
|
|
4406
4403
|
loader,
|
|
4407
4404
|
handle: {
|
|
4408
|
-
breadcrumb: (match) => /* @__PURE__ */
|
|
4405
|
+
breadcrumb: (match) => /* @__PURE__ */ jsx14(Breadcrumb, { ...match })
|
|
4409
4406
|
}
|
|
4410
4407
|
};
|
|
4411
4408
|
},
|
|
@@ -4413,7 +4410,7 @@ function getRouteMap({
|
|
|
4413
4410
|
{
|
|
4414
4411
|
path: "",
|
|
4415
4412
|
lazy: async () => {
|
|
4416
|
-
const { ProductTypeDetailPage } = await import("./[id]-
|
|
4413
|
+
const { ProductTypeDetailPage } = await import("./[id]-DGDRYOXA.js");
|
|
4417
4414
|
return { Component: ProductTypeDetailPage };
|
|
4418
4415
|
},
|
|
4419
4416
|
children: [
|
|
@@ -4430,13 +4427,13 @@ function getRouteMap({
|
|
|
4430
4427
|
// RETURN REASONS
|
|
4431
4428
|
{
|
|
4432
4429
|
path: "return-reasons",
|
|
4433
|
-
errorElement: /* @__PURE__ */
|
|
4434
|
-
element: /* @__PURE__ */
|
|
4430
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4431
|
+
element: /* @__PURE__ */ jsx14(Outlet4, {}),
|
|
4435
4432
|
handle: { breadcrumb: () => t("returnReasons.domain"), permissions: "return_reason:read" },
|
|
4436
4433
|
children: [
|
|
4437
4434
|
{
|
|
4438
4435
|
path: "",
|
|
4439
|
-
lazy: () => import("./return-reasons-
|
|
4436
|
+
lazy: () => import("./return-reasons-VQ7RS4DA.js"),
|
|
4440
4437
|
children: [
|
|
4441
4438
|
{
|
|
4442
4439
|
path: "create",
|
|
@@ -4460,15 +4457,15 @@ function getRouteMap({
|
|
|
4460
4457
|
},
|
|
4461
4458
|
// PUBLIC LAYOUT
|
|
4462
4459
|
{
|
|
4463
|
-
element: /* @__PURE__ */
|
|
4460
|
+
element: /* @__PURE__ */ jsx14(PublicLayout, {}),
|
|
4464
4461
|
children: [
|
|
4465
4462
|
{
|
|
4466
|
-
errorElement: /* @__PURE__ */
|
|
4463
|
+
errorElement: /* @__PURE__ */ jsx14(ErrorBoundary, {}),
|
|
4467
4464
|
children: [
|
|
4468
4465
|
{
|
|
4469
4466
|
path: "/login",
|
|
4470
4467
|
lazy: async () => {
|
|
4471
|
-
const { LoginPage } = await import("./login-
|
|
4468
|
+
const { LoginPage } = await import("./login-I6NQC47V.js");
|
|
4472
4469
|
return { Component: LoginPage };
|
|
4473
4470
|
}
|
|
4474
4471
|
},
|
|
@@ -4479,7 +4476,7 @@ function getRouteMap({
|
|
|
4479
4476
|
{
|
|
4480
4477
|
path: "/register",
|
|
4481
4478
|
lazy: async () => {
|
|
4482
|
-
const { RegisterPage } = await import("./register-
|
|
4479
|
+
const { RegisterPage } = await import("./register-T2XSCP6I.js");
|
|
4483
4480
|
return { Component: RegisterPage };
|
|
4484
4481
|
}
|
|
4485
4482
|
},
|
|
@@ -4494,7 +4491,7 @@ function getRouteMap({
|
|
|
4494
4491
|
{
|
|
4495
4492
|
path: "/store-select",
|
|
4496
4493
|
lazy: async () => {
|
|
4497
|
-
const { StoreSelectPage } = await import("./store-select-
|
|
4494
|
+
const { StoreSelectPage } = await import("./store-select-7FVUSNIV.js");
|
|
4498
4495
|
return { Component: StoreSelectPage };
|
|
4499
4496
|
}
|
|
4500
4497
|
},
|
|
@@ -4512,7 +4509,7 @@ function getRouteMap({
|
|
|
4512
4509
|
|
|
4513
4510
|
// src/app.tsx
|
|
4514
4511
|
import { useMemo as useMemo7 } from "react";
|
|
4515
|
-
import { jsx as
|
|
4512
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
4516
4513
|
function App() {
|
|
4517
4514
|
const routes = useMemo7(() => {
|
|
4518
4515
|
return {
|
|
@@ -4521,15 +4518,15 @@ function App() {
|
|
|
4521
4518
|
publicRoutes: createRouteMap(getRoutesByType(customRoutes, "public"))
|
|
4522
4519
|
};
|
|
4523
4520
|
}, []);
|
|
4524
|
-
return /* @__PURE__ */
|
|
4521
|
+
return /* @__PURE__ */ jsx15(TooltipProvider, { children: /* @__PURE__ */ jsx15(HelmetProvider, { children: /* @__PURE__ */ jsx15(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx15(ThemeProvider, { children: /* @__PURE__ */ jsxs9(
|
|
4525
4522
|
ExtensionProvider,
|
|
4526
4523
|
{
|
|
4527
4524
|
widgets,
|
|
4528
4525
|
navigation,
|
|
4529
4526
|
customFields,
|
|
4530
4527
|
children: [
|
|
4531
|
-
/* @__PURE__ */
|
|
4532
|
-
/* @__PURE__ */
|
|
4528
|
+
/* @__PURE__ */ jsx15(I18n, {}),
|
|
4529
|
+
/* @__PURE__ */ jsx15(I18nProvider, { children: /* @__PURE__ */ jsx15(
|
|
4533
4530
|
RouterProvider,
|
|
4534
4531
|
{
|
|
4535
4532
|
router: createBrowserRouter(getRouteMap(routes), {
|
|
@@ -4537,7 +4534,7 @@ function App() {
|
|
|
4537
4534
|
})
|
|
4538
4535
|
}
|
|
4539
4536
|
) }),
|
|
4540
|
-
/* @__PURE__ */
|
|
4537
|
+
/* @__PURE__ */ jsx15(Toaster, {})
|
|
4541
4538
|
]
|
|
4542
4539
|
}
|
|
4543
4540
|
) }) }) }) });
|
|
@@ -4551,13 +4548,13 @@ import {
|
|
|
4551
4548
|
} from "@medusajs/icons";
|
|
4552
4549
|
import { clx as clx7, Drawer, Heading as Heading2, IconButton as IconButton6, Text as Text8 } from "@medusajs/ui";
|
|
4553
4550
|
import { formatDistance } from "date-fns";
|
|
4554
|
-
import { useEffect as
|
|
4551
|
+
import { useEffect as useEffect10, useState as useState11 } from "react";
|
|
4555
4552
|
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
4556
4553
|
|
|
4557
4554
|
// src/components/common/file-preview/file-preview.tsx
|
|
4558
4555
|
import { ArrowDownTray, Spinner as Spinner3 } from "@medusajs/icons";
|
|
4559
4556
|
import { IconButton as IconButton5, Text as Text7 } from "@medusajs/ui";
|
|
4560
|
-
import { jsx as
|
|
4557
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4561
4558
|
var FilePreview = ({
|
|
4562
4559
|
filename,
|
|
4563
4560
|
url,
|
|
@@ -4566,11 +4563,11 @@ var FilePreview = ({
|
|
|
4566
4563
|
actions,
|
|
4567
4564
|
hideThumbnail
|
|
4568
4565
|
}) => {
|
|
4569
|
-
return /* @__PURE__ */
|
|
4566
|
+
return /* @__PURE__ */ jsx16("div", { className: "shadow-elevation-card-rest bg-ui-bg-component transition-fg rounded-md px-3 py-2", children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
4570
4567
|
/* @__PURE__ */ jsxs10("div", { className: "flex flex-row items-center gap-3", children: [
|
|
4571
|
-
!hideThumbnail && /* @__PURE__ */
|
|
4568
|
+
!hideThumbnail && /* @__PURE__ */ jsx16(FileThumbnail, {}),
|
|
4572
4569
|
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col justify-center", children: [
|
|
4573
|
-
/* @__PURE__ */
|
|
4570
|
+
/* @__PURE__ */ jsx16(
|
|
4574
4571
|
Text7,
|
|
4575
4572
|
{
|
|
4576
4573
|
size: "small",
|
|
@@ -4579,7 +4576,7 @@ var FilePreview = ({
|
|
|
4579
4576
|
children: filename
|
|
4580
4577
|
}
|
|
4581
4578
|
),
|
|
4582
|
-
loading && !!activity && /* @__PURE__ */
|
|
4579
|
+
loading && !!activity && /* @__PURE__ */ jsx16(
|
|
4583
4580
|
Text7,
|
|
4584
4581
|
{
|
|
4585
4582
|
leading: "compact",
|
|
@@ -4590,9 +4587,9 @@ var FilePreview = ({
|
|
|
4590
4587
|
)
|
|
4591
4588
|
] })
|
|
4592
4589
|
] }),
|
|
4593
|
-
loading && /* @__PURE__ */
|
|
4594
|
-
!loading && actions && /* @__PURE__ */
|
|
4595
|
-
!loading && url && /* @__PURE__ */
|
|
4590
|
+
loading && /* @__PURE__ */ jsx16(Spinner3, { className: "animate-spin" }),
|
|
4591
|
+
!loading && actions && /* @__PURE__ */ jsx16(ActionMenu, { groups: actions }),
|
|
4592
|
+
!loading && url && /* @__PURE__ */ jsx16(IconButton5, { variant: "transparent", asChild: true, children: /* @__PURE__ */ jsx16("a", { href: url, download: filename ?? `${Date.now()}`, children: /* @__PURE__ */ jsx16(ArrowDownTray, {}) }) })
|
|
4596
4593
|
] }) });
|
|
4597
4594
|
};
|
|
4598
4595
|
var FileThumbnail = () => {
|
|
@@ -4605,7 +4602,7 @@ var FileThumbnail = () => {
|
|
|
4605
4602
|
fill: "none",
|
|
4606
4603
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4607
4604
|
children: [
|
|
4608
|
-
/* @__PURE__ */
|
|
4605
|
+
/* @__PURE__ */ jsx16(
|
|
4609
4606
|
"path",
|
|
4610
4607
|
{
|
|
4611
4608
|
d: "M20 31.75H4C1.92893 31.75 0.25 30.0711 0.25 28V4C0.25 1.92893 1.92893 0.25 4 0.25H15.9431C16.9377 0.25 17.8915 0.645088 18.5948 1.34835L22.6516 5.4052C23.3549 6.10847 23.75 7.06229 23.75 8.05685V28C23.75 30.0711 22.0711 31.75 20 31.75Z",
|
|
@@ -4614,7 +4611,7 @@ var FileThumbnail = () => {
|
|
|
4614
4611
|
"stroke-width": "0.5"
|
|
4615
4612
|
}
|
|
4616
4613
|
),
|
|
4617
|
-
/* @__PURE__ */
|
|
4614
|
+
/* @__PURE__ */ jsx16(
|
|
4618
4615
|
"path",
|
|
4619
4616
|
{
|
|
4620
4617
|
opacity: "0.4",
|
|
@@ -4635,8 +4632,8 @@ var FileThumbnail = () => {
|
|
|
4635
4632
|
y2: "32",
|
|
4636
4633
|
gradientUnits: "userSpaceOnUse",
|
|
4637
4634
|
children: [
|
|
4638
|
-
/* @__PURE__ */
|
|
4639
|
-
/* @__PURE__ */
|
|
4635
|
+
/* @__PURE__ */ jsx16("stop", { "stop-color": "#F4F4F5" }),
|
|
4636
|
+
/* @__PURE__ */ jsx16("stop", { offset: "1", "stop-color": "#E4E4E7" })
|
|
4640
4637
|
]
|
|
4641
4638
|
}
|
|
4642
4639
|
),
|
|
@@ -4650,8 +4647,8 @@ var FileThumbnail = () => {
|
|
|
4650
4647
|
y2: "32",
|
|
4651
4648
|
gradientUnits: "userSpaceOnUse",
|
|
4652
4649
|
children: [
|
|
4653
|
-
/* @__PURE__ */
|
|
4654
|
-
/* @__PURE__ */
|
|
4650
|
+
/* @__PURE__ */ jsx16("stop", { "stop-color": "#E4E4E7" }),
|
|
4651
|
+
/* @__PURE__ */ jsx16("stop", { offset: "1", "stop-color": "#D4D4D8" })
|
|
4655
4652
|
]
|
|
4656
4653
|
}
|
|
4657
4654
|
),
|
|
@@ -4665,8 +4662,8 @@ var FileThumbnail = () => {
|
|
|
4665
4662
|
y2: "21.25",
|
|
4666
4663
|
gradientUnits: "userSpaceOnUse",
|
|
4667
4664
|
children: [
|
|
4668
|
-
/* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4665
|
+
/* @__PURE__ */ jsx16("stop", { "stop-color": "#52525B" }),
|
|
4666
|
+
/* @__PURE__ */ jsx16("stop", { offset: "1", "stop-color": "#A1A1AA" })
|
|
4670
4667
|
]
|
|
4671
4668
|
}
|
|
4672
4669
|
),
|
|
@@ -4680,8 +4677,8 @@ var FileThumbnail = () => {
|
|
|
4680
4677
|
y2: "21.25",
|
|
4681
4678
|
gradientUnits: "userSpaceOnUse",
|
|
4682
4679
|
children: [
|
|
4683
|
-
/* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
4680
|
+
/* @__PURE__ */ jsx16("stop", { "stop-color": "#18181B" }),
|
|
4681
|
+
/* @__PURE__ */ jsx16("stop", { offset: "1", "stop-color": "#52525B" })
|
|
4685
4682
|
]
|
|
4686
4683
|
}
|
|
4687
4684
|
)
|
|
@@ -4693,10 +4690,10 @@ var FileThumbnail = () => {
|
|
|
4693
4690
|
|
|
4694
4691
|
// src/components/common/infinite-list/infinite-list.tsx
|
|
4695
4692
|
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
4696
|
-
import { useEffect as
|
|
4693
|
+
import { useEffect as useEffect9, useMemo as useMemo8, useRef as useRef2 } from "react";
|
|
4697
4694
|
import { toast } from "@medusajs/ui";
|
|
4698
4695
|
import { Spinner as Spinner4 } from "@medusajs/icons";
|
|
4699
|
-
import { jsx as
|
|
4696
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4700
4697
|
var InfiniteList = ({
|
|
4701
4698
|
queryKey,
|
|
4702
4699
|
queryFn,
|
|
@@ -4743,11 +4740,11 @@ var InfiniteList = ({
|
|
|
4743
4740
|
const endObserver = useRef2();
|
|
4744
4741
|
const fetchNextPageRef = useRef2(fetchNextPage);
|
|
4745
4742
|
const fetchPreviousPageRef = useRef2(fetchPreviousPage);
|
|
4746
|
-
|
|
4743
|
+
useEffect9(() => {
|
|
4747
4744
|
fetchNextPageRef.current = fetchNextPage;
|
|
4748
4745
|
fetchPreviousPageRef.current = fetchPreviousPage;
|
|
4749
4746
|
}, [fetchNextPage, fetchPreviousPage]);
|
|
4750
|
-
|
|
4747
|
+
useEffect9(() => {
|
|
4751
4748
|
if (isPending) {
|
|
4752
4749
|
return;
|
|
4753
4750
|
}
|
|
@@ -4791,31 +4788,31 @@ var InfiniteList = ({
|
|
|
4791
4788
|
isFetching,
|
|
4792
4789
|
isPending
|
|
4793
4790
|
]);
|
|
4794
|
-
|
|
4791
|
+
useEffect9(() => {
|
|
4795
4792
|
if (error) {
|
|
4796
4793
|
toast.error(error.message);
|
|
4797
4794
|
}
|
|
4798
4795
|
}, [error]);
|
|
4799
4796
|
if (isPending) {
|
|
4800
|
-
return /* @__PURE__ */
|
|
4797
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex h-full flex-col items-center justify-center", children: /* @__PURE__ */ jsx17(Spinner4, { className: "animate-spin" }) });
|
|
4801
4798
|
}
|
|
4802
4799
|
return /* @__PURE__ */ jsxs11("div", { ref: parentRef, className: "h-full", children: [
|
|
4803
|
-
items?.length ? items.map((item) => /* @__PURE__ */
|
|
4804
|
-
isFetching && /* @__PURE__ */
|
|
4800
|
+
items?.length ? items.map((item) => /* @__PURE__ */ jsx17("div", { children: renderItem(item) }, item.id)) : renderEmpty(),
|
|
4801
|
+
isFetching && /* @__PURE__ */ jsx17("div", { className: "flex flex-col items-center justify-center py-4", children: /* @__PURE__ */ jsx17(Spinner4, { className: "animate-spin" }) })
|
|
4805
4802
|
] });
|
|
4806
4803
|
};
|
|
4807
4804
|
|
|
4808
4805
|
// src/components/layout/notifications/notifications.tsx
|
|
4809
|
-
import { Fragment as Fragment3, jsx as
|
|
4806
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4810
4807
|
var LAST_READ_NOTIFICATION_KEY = "notificationsLastReadAt";
|
|
4811
4808
|
var Notifications = () => {
|
|
4812
4809
|
const { t: t2 } = useTranslation10();
|
|
4813
|
-
const [open, setOpen] =
|
|
4810
|
+
const [open, setOpen] = useState11(false);
|
|
4814
4811
|
const [hasUnread, setHasUnread] = useUnreadNotifications();
|
|
4815
|
-
const [lastReadAt, setLastReadAt] =
|
|
4812
|
+
const [lastReadAt, setLastReadAt] = useState11(
|
|
4816
4813
|
localStorage.getItem(LAST_READ_NOTIFICATION_KEY)
|
|
4817
4814
|
);
|
|
4818
|
-
|
|
4815
|
+
useEffect10(() => {
|
|
4819
4816
|
const onKeyDown = (e) => {
|
|
4820
4817
|
if (e.key === "n" && (e.metaKey || e.ctrlKey)) {
|
|
4821
4818
|
setOpen((prev) => !prev);
|
|
@@ -4837,21 +4834,21 @@ var Notifications = () => {
|
|
|
4837
4834
|
}
|
|
4838
4835
|
};
|
|
4839
4836
|
return /* @__PURE__ */ jsxs12(Drawer, { open, onOpenChange: handleOnOpen, children: [
|
|
4840
|
-
/* @__PURE__ */
|
|
4837
|
+
/* @__PURE__ */ jsx18(Drawer.Trigger, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
4841
4838
|
IconButton6,
|
|
4842
4839
|
{
|
|
4843
4840
|
variant: "transparent",
|
|
4844
4841
|
size: "small",
|
|
4845
4842
|
className: "text-ui-fg-muted hover:text-ui-fg-subtle",
|
|
4846
|
-
children: hasUnread ? /* @__PURE__ */
|
|
4843
|
+
children: hasUnread ? /* @__PURE__ */ jsx18(BellAlertDone, {}) : /* @__PURE__ */ jsx18(BellAlert, {})
|
|
4847
4844
|
}
|
|
4848
4845
|
) }),
|
|
4849
4846
|
/* @__PURE__ */ jsxs12(Drawer.Content, { children: [
|
|
4850
4847
|
/* @__PURE__ */ jsxs12(Drawer.Header, { children: [
|
|
4851
|
-
/* @__PURE__ */
|
|
4852
|
-
/* @__PURE__ */
|
|
4848
|
+
/* @__PURE__ */ jsx18(Drawer.Title, { asChild: true, children: /* @__PURE__ */ jsx18(Heading2, { children: t2("notifications.domain") }) }),
|
|
4849
|
+
/* @__PURE__ */ jsx18(Drawer.Description, { className: "sr-only", children: t2("notifications.accessibility.description") })
|
|
4853
4850
|
] }),
|
|
4854
|
-
/* @__PURE__ */
|
|
4851
|
+
/* @__PURE__ */ jsx18(Drawer.Body, { className: "overflow-y-auto px-0", children: /* @__PURE__ */ jsx18(
|
|
4855
4852
|
InfiniteList,
|
|
4856
4853
|
{
|
|
4857
4854
|
responseKey: "notifications",
|
|
@@ -4861,9 +4858,9 @@ var Notifications = () => {
|
|
|
4861
4858
|
query: { ...params }
|
|
4862
4859
|
}),
|
|
4863
4860
|
queryOptions: { enabled: open },
|
|
4864
|
-
renderEmpty: () => /* @__PURE__ */
|
|
4861
|
+
renderEmpty: () => /* @__PURE__ */ jsx18(NotificationsEmptyState, { t: t2 }),
|
|
4865
4862
|
renderItem: (notification) => {
|
|
4866
|
-
return /* @__PURE__ */
|
|
4863
|
+
return /* @__PURE__ */ jsx18(
|
|
4867
4864
|
Notification,
|
|
4868
4865
|
{
|
|
4869
4866
|
notification,
|
|
@@ -4885,14 +4882,14 @@ var Notification = ({
|
|
|
4885
4882
|
if (!data?.title) {
|
|
4886
4883
|
return null;
|
|
4887
4884
|
}
|
|
4888
|
-
return /* @__PURE__ */
|
|
4889
|
-
/* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ jsx18(Fragment3, { children: /* @__PURE__ */ jsxs12("div", { className: "relative flex items-start justify-center gap-3 border-b p-6", children: [
|
|
4886
|
+
/* @__PURE__ */ jsx18("div", { className: "text-ui-fg-muted flex size-5 items-center justify-center", children: /* @__PURE__ */ jsx18(InformationCircleSolid, {}) }),
|
|
4890
4887
|
/* @__PURE__ */ jsxs12("div", { className: "flex w-full flex-col gap-y-3", children: [
|
|
4891
4888
|
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col", children: [
|
|
4892
4889
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
|
|
4893
|
-
/* @__PURE__ */
|
|
4890
|
+
/* @__PURE__ */ jsx18(Text8, { size: "small", leading: "compact", weight: "plus", children: data.title }),
|
|
4894
4891
|
/* @__PURE__ */ jsxs12("div", { className: "align-center flex items-center justify-center gap-2", children: [
|
|
4895
|
-
/* @__PURE__ */
|
|
4892
|
+
/* @__PURE__ */ jsx18(
|
|
4896
4893
|
Text8,
|
|
4897
4894
|
{
|
|
4898
4895
|
as: "span",
|
|
@@ -4907,7 +4904,7 @@ var Notification = ({
|
|
|
4907
4904
|
})
|
|
4908
4905
|
}
|
|
4909
4906
|
),
|
|
4910
|
-
unread && /* @__PURE__ */
|
|
4907
|
+
unread && /* @__PURE__ */ jsx18(
|
|
4911
4908
|
"div",
|
|
4912
4909
|
{
|
|
4913
4910
|
className: "bg-ui-bg-interactive h-2 w-2 rounded",
|
|
@@ -4916,7 +4913,7 @@ var Notification = ({
|
|
|
4916
4913
|
)
|
|
4917
4914
|
] })
|
|
4918
4915
|
] }),
|
|
4919
|
-
!!data.description && /* @__PURE__ */
|
|
4916
|
+
!!data.description && /* @__PURE__ */ jsx18(
|
|
4920
4917
|
Text8,
|
|
4921
4918
|
{
|
|
4922
4919
|
className: "text-ui-fg-subtle whitespace-pre-line",
|
|
@@ -4925,7 +4922,7 @@ var Notification = ({
|
|
|
4925
4922
|
}
|
|
4926
4923
|
)
|
|
4927
4924
|
] }),
|
|
4928
|
-
!!data?.file?.url && /* @__PURE__ */
|
|
4925
|
+
!!data?.file?.url && /* @__PURE__ */ jsx18(
|
|
4929
4926
|
FilePreview,
|
|
4930
4927
|
{
|
|
4931
4928
|
filename: data.file.filename ?? "",
|
|
@@ -4938,9 +4935,9 @@ var Notification = ({
|
|
|
4938
4935
|
};
|
|
4939
4936
|
var NotificationsEmptyState = ({ t: t2 }) => {
|
|
4940
4937
|
return /* @__PURE__ */ jsxs12("div", { className: "flex h-full flex-col items-center justify-center", children: [
|
|
4941
|
-
/* @__PURE__ */
|
|
4942
|
-
/* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
4938
|
+
/* @__PURE__ */ jsx18(BellAlertDone, {}),
|
|
4939
|
+
/* @__PURE__ */ jsx18(Text8, { size: "small", leading: "compact", weight: "plus", className: "mt-3", children: t2("notifications.emptyState.title") }),
|
|
4940
|
+
/* @__PURE__ */ jsx18(
|
|
4944
4941
|
Text8,
|
|
4945
4942
|
{
|
|
4946
4943
|
size: "small",
|
|
@@ -4951,13 +4948,13 @@ var NotificationsEmptyState = ({ t: t2 }) => {
|
|
|
4951
4948
|
] });
|
|
4952
4949
|
};
|
|
4953
4950
|
var useUnreadNotifications = () => {
|
|
4954
|
-
const [hasUnread, setHasUnread] =
|
|
4951
|
+
const [hasUnread, setHasUnread] = useState11(false);
|
|
4955
4952
|
const { notifications } = useNotifications(
|
|
4956
4953
|
{ limit: 1, offset: 0, fields: "created_at" },
|
|
4957
4954
|
{ refetchInterval: 6e4 }
|
|
4958
4955
|
);
|
|
4959
4956
|
const lastNotification = notifications?.[0];
|
|
4960
|
-
|
|
4957
|
+
useEffect10(() => {
|
|
4961
4958
|
if (!lastNotification) {
|
|
4962
4959
|
return;
|
|
4963
4960
|
}
|