@mantajs/dashboard 0.1.8 → 0.1.10
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/app.js +2 -13
- package/dist/app.mjs +1 -1
- package/dist/{chunk-ZQVS3F3X.mjs → chunk-6AOXP3RP.mjs} +7 -18
- package/dist/{product-attributes-DZZZDS2K.mjs → product-attributes-WOKHQSU3.mjs} +1 -1
- package/dist/{product-create-P26FHFTZ.mjs → product-create-T4PVLEL7.mjs} +1 -1
- package/dist/{product-detail-6VCLGLEL.mjs → product-detail-77R3VVI5.mjs} +1 -1
- package/dist/{product-edit-D75EWPGG.mjs → product-edit-CPKK4QSD.mjs} +1 -1
- package/dist/{product-organization-FESACGNN.mjs → product-organization-BH5TZRYS.mjs} +1 -1
- package/dist/vite-plugin/index.js +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/layout/main-layout/main-layout.tsx +16 -13
- package/src/vite-plugin/index.ts +1 -1
- package/src/vite-plugin/types.ts +1 -1
- package/dist/en.json +0 -3311
- package/dist/index.d.ts +0 -10
- package/dist/vite-plugin/index.d.mts +0 -21
- package/dist/vite-plugin/index.d.ts +0 -21
package/dist/app.js
CHANGED
|
@@ -100375,7 +100375,7 @@ var init_user_menu2 = __esm({
|
|
|
100375
100375
|
});
|
|
100376
100376
|
|
|
100377
100377
|
// src/components/layout/main-layout/main-layout.tsx
|
|
100378
|
-
var import_icons10, import_ui14, import_radix_ui5, import_react_i18next10, import_react_router_dom9, import_menu_config, import_jsx_runtime22,
|
|
100378
|
+
var import_icons10, import_ui14, import_radix_ui5, import_react_i18next10, import_react_router_dom9, import_menu_config, import_jsx_runtime22, MainLayout, MainSidebar, Logout2, Header, getDefaultMedusaRoutes, useCoreRoutes, Searchbar, CoreRouteSection, getMainMenuPaths, MAIN_MENU_PATHS, ExtensionRouteSection, UtilitySection, UserSection;
|
|
100379
100379
|
var init_main_layout = __esm({
|
|
100380
100380
|
"src/components/layout/main-layout/main-layout.tsx"() {
|
|
100381
100381
|
"use strict";
|
|
@@ -100396,17 +100396,6 @@ var init_main_layout = __esm({
|
|
|
100396
100396
|
init_use_document_direction();
|
|
100397
100397
|
import_menu_config = __toESM(require("virtual:dashboard/menu-config"));
|
|
100398
100398
|
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
100399
|
-
ICON_MAP = {
|
|
100400
|
-
ShoppingCart: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.ShoppingCart, {}),
|
|
100401
|
-
Tag: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Tag, {}),
|
|
100402
|
-
Buildings: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Buildings, {}),
|
|
100403
|
-
Users: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Users, {}),
|
|
100404
|
-
ReceiptPercent: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.ReceiptPercent, {}),
|
|
100405
|
-
CurrencyDollar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.CurrencyDollar, {}),
|
|
100406
|
-
BuildingStorefront: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.BuildingStorefront, {}),
|
|
100407
|
-
CogSixTooth: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.CogSixTooth, {}),
|
|
100408
|
-
SquaresPlus: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.SquaresPlus, {})
|
|
100409
|
-
};
|
|
100410
100399
|
MainLayout = () => {
|
|
100411
100400
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MainSidebar, {}) });
|
|
100412
100401
|
};
|
|
@@ -100544,7 +100533,7 @@ var init_main_layout = __esm({
|
|
|
100544
100533
|
return getDefaultMedusaRoutes(t5);
|
|
100545
100534
|
}
|
|
100546
100535
|
return import_menu_config.default.items.map((item) => ({
|
|
100547
|
-
icon:
|
|
100536
|
+
icon: item.icon,
|
|
100548
100537
|
label: item.useTranslation ? t5(item.label) : item.label,
|
|
100549
100538
|
to: item.to,
|
|
100550
100539
|
items: item.items?.map((sub2) => ({
|
package/dist/app.mjs
CHANGED
|
@@ -95394,17 +95394,6 @@ var UserItem = () => {
|
|
|
95394
95394
|
// src/components/layout/main-layout/main-layout.tsx
|
|
95395
95395
|
import menuConfig from "virtual:dashboard/menu-config";
|
|
95396
95396
|
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
95397
|
-
var ICON_MAP = {
|
|
95398
|
-
ShoppingCart: /* @__PURE__ */ jsx13(ShoppingCart, {}),
|
|
95399
|
-
Tag: /* @__PURE__ */ jsx13(Tag, {}),
|
|
95400
|
-
Buildings: /* @__PURE__ */ jsx13(Buildings, {}),
|
|
95401
|
-
Users: /* @__PURE__ */ jsx13(Users, {}),
|
|
95402
|
-
ReceiptPercent: /* @__PURE__ */ jsx13(ReceiptPercent, {}),
|
|
95403
|
-
CurrencyDollar: /* @__PURE__ */ jsx13(CurrencyDollar, {}),
|
|
95404
|
-
BuildingStorefront: /* @__PURE__ */ jsx13(BuildingStorefront, {}),
|
|
95405
|
-
CogSixTooth: /* @__PURE__ */ jsx13(CogSixTooth, {}),
|
|
95406
|
-
SquaresPlus: /* @__PURE__ */ jsx13(SquaresPlus, {})
|
|
95407
|
-
};
|
|
95408
95397
|
var MainLayout = () => {
|
|
95409
95398
|
return /* @__PURE__ */ jsx13(Shell, { children: /* @__PURE__ */ jsx13(MainSidebar, {}) });
|
|
95410
95399
|
};
|
|
@@ -95542,7 +95531,7 @@ var useCoreRoutes = () => {
|
|
|
95542
95531
|
return getDefaultMedusaRoutes(t2);
|
|
95543
95532
|
}
|
|
95544
95533
|
return menuConfig.items.map((item) => ({
|
|
95545
|
-
icon:
|
|
95534
|
+
icon: item.icon,
|
|
95546
95535
|
label: item.useTranslation ? t2(item.label) : item.label,
|
|
95547
95536
|
to: item.to,
|
|
95548
95537
|
items: item.items?.map((sub) => ({
|
|
@@ -95961,7 +95950,7 @@ function getRouteMap({
|
|
|
95961
95950
|
children: [
|
|
95962
95951
|
{
|
|
95963
95952
|
path: "create",
|
|
95964
|
-
lazy: () => import("./product-create-
|
|
95953
|
+
lazy: () => import("./product-create-T4PVLEL7.mjs")
|
|
95965
95954
|
},
|
|
95966
95955
|
{
|
|
95967
95956
|
path: "import",
|
|
@@ -95977,7 +95966,7 @@ function getRouteMap({
|
|
|
95977
95966
|
path: ":id",
|
|
95978
95967
|
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
|
95979
95968
|
lazy: async () => {
|
|
95980
|
-
const { Breadcrumb, loader } = await import("./product-detail-
|
|
95969
|
+
const { Breadcrumb, loader } = await import("./product-detail-77R3VVI5.mjs");
|
|
95981
95970
|
return {
|
|
95982
95971
|
Component: Outlet4,
|
|
95983
95972
|
loader,
|
|
@@ -95989,11 +95978,11 @@ function getRouteMap({
|
|
|
95989
95978
|
children: [
|
|
95990
95979
|
{
|
|
95991
95980
|
path: "",
|
|
95992
|
-
lazy: () => import("./product-detail-
|
|
95981
|
+
lazy: () => import("./product-detail-77R3VVI5.mjs"),
|
|
95993
95982
|
children: [
|
|
95994
95983
|
{
|
|
95995
95984
|
path: "edit",
|
|
95996
|
-
lazy: () => import("./product-edit-
|
|
95985
|
+
lazy: () => import("./product-edit-CPKK4QSD.mjs")
|
|
95997
95986
|
},
|
|
95998
95987
|
{
|
|
95999
95988
|
path: "edit-variant",
|
|
@@ -96005,11 +95994,11 @@ function getRouteMap({
|
|
|
96005
95994
|
},
|
|
96006
95995
|
{
|
|
96007
95996
|
path: "attributes",
|
|
96008
|
-
lazy: () => import("./product-attributes-
|
|
95997
|
+
lazy: () => import("./product-attributes-WOKHQSU3.mjs")
|
|
96009
95998
|
},
|
|
96010
95999
|
{
|
|
96011
96000
|
path: "organization",
|
|
96012
|
-
lazy: () => import("./product-organization-
|
|
96001
|
+
lazy: () => import("./product-organization-BH5TZRYS.mjs")
|
|
96013
96002
|
},
|
|
96014
96003
|
{
|
|
96015
96004
|
path: "shipping-profile",
|
|
@@ -53,7 +53,7 @@ function menuConfigPlugin() {
|
|
|
53
53
|
load(id) {
|
|
54
54
|
if (id !== RESOLVED_ID) return;
|
|
55
55
|
const basePath = import_path.default.resolve(process.cwd(), "src/admin/menu.config");
|
|
56
|
-
for (const ext of [".ts", ".js", ".mts", ".mjs"]) {
|
|
56
|
+
for (const ext of [".tsx", ".ts", ".jsx", ".js", ".mts", ".mjs"]) {
|
|
57
57
|
if (import_fs.default.existsSync(basePath + ext)) {
|
|
58
58
|
return `export { default } from "${basePath + ext}"`;
|
|
59
59
|
}
|
|
@@ -19,7 +19,7 @@ function menuConfigPlugin() {
|
|
|
19
19
|
load(id) {
|
|
20
20
|
if (id !== RESOLVED_ID) return;
|
|
21
21
|
const basePath = path.resolve(process.cwd(), "src/admin/menu.config");
|
|
22
|
-
for (const ext of [".ts", ".js", ".mts", ".mjs"]) {
|
|
22
|
+
for (const ext of [".tsx", ".ts", ".jsx", ".js", ".mts", ".mjs"]) {
|
|
23
23
|
if (fs.existsSync(basePath + ext)) {
|
|
24
24
|
return `export { default } from "${basePath + ext}"`;
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import * as MedusaIcons from "@medusajs/icons"
|
|
2
1
|
import {
|
|
2
|
+
BuildingStorefront,
|
|
3
|
+
Buildings,
|
|
3
4
|
ChevronDownMini,
|
|
5
|
+
CogSixTooth,
|
|
6
|
+
CurrencyDollar,
|
|
4
7
|
EllipsisHorizontal,
|
|
5
8
|
MagnifyingGlass,
|
|
6
9
|
MinusMini,
|
|
7
10
|
OpenRectArrowOut,
|
|
11
|
+
ReceiptPercent,
|
|
12
|
+
ShoppingCart,
|
|
13
|
+
SquaresPlus,
|
|
14
|
+
Tag,
|
|
15
|
+
Users,
|
|
8
16
|
} from "@medusajs/icons"
|
|
9
17
|
import { Avatar, Divider, DropdownMenu, Text, clx } from "@medusajs/ui"
|
|
10
18
|
import { Collapsible as RadixCollapsible } from "radix-ui"
|
|
@@ -25,11 +33,6 @@ import { useDocumentDirection } from "../../../hooks/use-document-direction"
|
|
|
25
33
|
import menuConfig from "virtual:dashboard/menu-config"
|
|
26
34
|
import type { MenuConfig } from "../../../vite-plugin/types"
|
|
27
35
|
|
|
28
|
-
const getIcon = (name: string): React.ReactNode => {
|
|
29
|
-
const IconComponent = (MedusaIcons as any)[name] || MedusaIcons.SquaresPlus
|
|
30
|
-
return <IconComponent />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
36
|
export const MainLayout = () => {
|
|
34
37
|
return (
|
|
35
38
|
<Shell>
|
|
@@ -177,21 +180,21 @@ const Header = () => {
|
|
|
177
180
|
}
|
|
178
181
|
|
|
179
182
|
const getDefaultMedusaRoutes = (t: (key: string) => string): Omit<INavItem, "pathname">[] => [
|
|
180
|
-
{ icon:
|
|
181
|
-
{ icon:
|
|
183
|
+
{ icon: <ShoppingCart />, label: t("orders.domain"), to: "/orders", items: [] },
|
|
184
|
+
{ icon: <Tag />, label: t("products.domain"), to: "/products", items: [
|
|
182
185
|
{ label: t("collections.domain"), to: "/collections" },
|
|
183
186
|
{ label: t("categories.domain"), to: "/categories" },
|
|
184
187
|
]},
|
|
185
|
-
{ icon:
|
|
188
|
+
{ icon: <Buildings />, label: t("inventory.domain"), to: "/inventory", items: [
|
|
186
189
|
{ label: t("reservations.domain"), to: "/reservations" },
|
|
187
190
|
]},
|
|
188
|
-
{ icon:
|
|
191
|
+
{ icon: <Users />, label: t("customers.domain"), to: "/customers", items: [
|
|
189
192
|
{ label: t("customerGroups.domain"), to: "/customer-groups" },
|
|
190
193
|
]},
|
|
191
|
-
{ icon:
|
|
194
|
+
{ icon: <ReceiptPercent />, label: t("promotions.domain"), to: "/promotions", items: [
|
|
192
195
|
{ label: t("campaigns.domain"), to: "/campaigns" },
|
|
193
196
|
]},
|
|
194
|
-
{ icon:
|
|
197
|
+
{ icon: <CurrencyDollar />, label: t("priceLists.domain"), to: "/price-lists" },
|
|
195
198
|
]
|
|
196
199
|
|
|
197
200
|
const useCoreRoutes = (): Omit<INavItem, "pathname">[] => {
|
|
@@ -202,7 +205,7 @@ const useCoreRoutes = (): Omit<INavItem, "pathname">[] => {
|
|
|
202
205
|
}
|
|
203
206
|
|
|
204
207
|
return (menuConfig as MenuConfig).items.map((item) => ({
|
|
205
|
-
icon:
|
|
208
|
+
icon: item.icon,
|
|
206
209
|
label: item.useTranslation ? t(item.label) : item.label,
|
|
207
210
|
to: item.to,
|
|
208
211
|
items: item.items?.map((sub) => ({
|
package/src/vite-plugin/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ export function menuConfigPlugin(): Plugin {
|
|
|
21
21
|
load(id) {
|
|
22
22
|
if (id !== RESOLVED_ID) return
|
|
23
23
|
const basePath = path.resolve(process.cwd(), "src/admin/menu.config")
|
|
24
|
-
for (const ext of [".ts", ".js", ".mts", ".mjs"]) {
|
|
24
|
+
for (const ext of [".tsx", ".ts", ".jsx", ".js", ".mts", ".mjs"]) {
|
|
25
25
|
if (fs.existsSync(basePath + ext)) {
|
|
26
26
|
return `export { default } from "${basePath + ext}"`
|
|
27
27
|
}
|