@burdenoff/microfe-product 2026.830.1 → 2026.830.2
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/index.js +2 -1
- package/dist/product/ProductUserRoot.js +27 -21
- package/dist/product/ProductUserRoot.js.map +1 -1
- package/dist/product/pages/ProductCatalogPage.js +96 -94
- package/dist/product/pages/ProductCatalogPage.js.map +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js +33 -32
- package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
- package/dist/product-management/shared/components/feedback/ErrorState.js +19 -18
- package/dist/product-management/shared/components/feedback/ErrorState.js.map +1 -1
- package/dist/product-management/shared/components/feedback/LoadingState.js +10 -8
- package/dist/product-management/shared/components/feedback/LoadingState.js.map +1 -1
- package/dist/product-management/shared/components/input/ProductCombobox.js +49 -48
- package/dist/product-management/shared/components/input/ProductCombobox.js.map +1 -1
- package/dist/product-management/shared/components/input/SearchInput.js +17 -15
- package/dist/product-management/shared/components/input/SearchInput.js.map +1 -1
- package/dist/product-management/shared/components/input/TagInput.js +25 -24
- package/dist/product-management/shared/components/input/TagInput.js.map +1 -1
- package/dist/product-management/shared/hooks/useConfirmDialog.js +24 -23
- package/dist/product-management/shared/hooks/useConfirmDialog.js.map +1 -1
- package/dist/product-management/shared/hooks/useTr.js +3 -3
- package/dist/product-management/shared/hooks/useTr.js.map +1 -1
- package/dist/shared/components/MarkdownEditor.js +102 -80
- package/dist/shared/components/MarkdownEditor.js.map +1 -1
- package/dist/shared/hooks/useTr.js +1 -0
- package/dist/translations/en.js +653 -0
- package/dist/translations/en.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ProductManagementRoot as e } from "./product-management/ProductManagementRoot.js";
|
|
2
2
|
import { ProductUserRoot as t } from "./product/ProductUserRoot.js";
|
|
3
|
-
|
|
3
|
+
import { enTranslations as n } from "./translations/en.js";
|
|
4
|
+
export { e as ProductManagementRoot, t as ProductUserRoot, n as enTranslations };
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { useTr as e } from "../product-management/shared/hooks/useTr.js";
|
|
2
|
+
import { ProductUserProvider as t } from "./providers/ProductUserProvider.js";
|
|
3
|
+
import "../shared/hooks/useTr.js";
|
|
4
|
+
import { ProductUserRoutes as n } from "./ProductUserRoutes.js";
|
|
5
|
+
import { useEffect as r } from "react";
|
|
6
|
+
import { Package as i } from "lucide-react";
|
|
7
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
+
import { FeatureFlagProvider as o } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
7
9
|
//#region src/product/ProductUserRoot.tsx
|
|
8
|
-
var
|
|
9
|
-
let { registerNavItems:
|
|
10
|
-
return
|
|
11
|
-
if (
|
|
10
|
+
var s = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`), c = (c) => {
|
|
11
|
+
let { registerNavItems: l, registerFooterItems: u, basePath: d = "/products" } = c, f = e();
|
|
12
|
+
return r(() => {
|
|
13
|
+
if (l) return l([{
|
|
12
14
|
id: "products-catalog",
|
|
13
|
-
label: "Products",
|
|
14
|
-
path:
|
|
15
|
-
icon: /* @__PURE__ */ i
|
|
15
|
+
label: f("productUser.navProducts", "Products"),
|
|
16
|
+
path: s(d, "/"),
|
|
17
|
+
icon: /* @__PURE__ */ a(i, { size: 20 }),
|
|
16
18
|
order: 50,
|
|
17
19
|
group: "global"
|
|
18
20
|
}]);
|
|
19
|
-
}, [
|
|
20
|
-
|
|
21
|
+
}, [
|
|
22
|
+
l,
|
|
23
|
+
d,
|
|
24
|
+
f
|
|
25
|
+
]), r(() => {
|
|
26
|
+
if (u) return u([{
|
|
21
27
|
id: "product-user-version",
|
|
22
|
-
label: "Products v0.1.0",
|
|
28
|
+
label: f("productUser.footerVersion", "Products v0.1.0"),
|
|
23
29
|
type: "status",
|
|
24
30
|
order: 50,
|
|
25
31
|
section: "left"
|
|
26
32
|
}]);
|
|
27
|
-
}, [
|
|
33
|
+
}, [u, f]), /* @__PURE__ */ a(o, {
|
|
28
34
|
workspaceId: null,
|
|
29
35
|
gateway: "global",
|
|
30
36
|
defaultEnabled: !0,
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
...
|
|
33
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ a(t, {
|
|
38
|
+
...c,
|
|
39
|
+
children: /* @__PURE__ */ a(n, {})
|
|
34
40
|
})
|
|
35
41
|
});
|
|
36
42
|
};
|
|
37
43
|
//#endregion
|
|
38
|
-
export {
|
|
44
|
+
export { c as ProductUserRoot };
|
|
39
45
|
|
|
40
46
|
//# sourceMappingURL=ProductUserRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductUserRoot.js","names":[],"sources":["../../src/product/ProductUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { Package } from 'lucide-react';\nimport { ProductUserProvider } from './providers/ProductUserProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, ProductUserRootProps } from './types';\nimport { ProductUserRoutes } from './ProductUserRoutes';\n\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\nexport const ProductUserRoot: FC<ProductUserRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/products' } = props;\n\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'products-catalog',\n label: 'Products',\n path: joinPath(basePath, '/'),\n icon: <Package size={20} />,\n order: 50,\n group: 'global',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'product-user-version',\n label: 'Products v0.1.0',\n type: 'status' as const,\n order: 50,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <ProductUserProvider {...props}>\n <ProductUserRoutes />\n </ProductUserProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductUserRoot.js","names":[],"sources":["../../src/product/ProductUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { Package } from 'lucide-react';\nimport { ProductUserProvider } from './providers/ProductUserProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, ProductUserRootProps } from './types';\nimport { ProductUserRoutes } from './ProductUserRoutes';\nimport { useTr } from '../shared/hooks/useTr';\n\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\nexport const ProductUserRoot: FC<ProductUserRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/products' } = props;\n const tr = useTr();\n\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'products-catalog',\n label: tr('productUser.navProducts', 'Products'),\n path: joinPath(basePath, '/'),\n icon: <Package size={20} />,\n order: 50,\n group: 'global',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'product-user-version',\n label: tr('productUser.footerVersion', 'Products v0.1.0'),\n type: 'status' as const,\n order: 50,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <ProductUserProvider {...props}>\n <ProductUserRoutes />\n </ProductUserProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;AASA,IAAM,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI,MAIzC,KAA6C,MAAU;CAClE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,gBAAgB,GACpE,IAAK,GAAO;AAqClB,QAnCA,QAAgB;AACT,QAcL,QADgB,EAAiB,CAV/B;GACE,IAAI;GACJ,OAAO,EAAG,2BAA2B,WAAW;GAChD,MAAM,EAAS,GAAU,IAAI;GAC7B,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;GAC3B,OAAO;GACP,OAAO;GACR,CAG8B,CAC1B;IACN;EAAC;EAAkB;EAAU;EAAG,CAAC,EAEpC,QAAgB;AACT,QAaL,QADgB,EAAoB,CATlC;GACE,IAAI;GACJ,OAAO,EAAG,6BAA6B,kBAAkB;GACzD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CAGiC,CAC7B;IACN,CAAC,GAAqB,EAAG,CAAC,EAG3B,kBAAC,GAAD;EAAqB,aAAa;EAAM,SAAQ;EAAS,gBAAgB;YACvE,kBAAC,GAAD;GAAqB,GAAI;aACvB,kBAAC,GAAD,EAAqB,CAAA;GACD,CAAA;EACF,CAAA"}
|
|
@@ -1,186 +1,188 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../product-management/shared/hooks/useTr.js";
|
|
2
|
+
import { LoadingState as t } from "../../product-management/shared/components/feedback/LoadingState.js";
|
|
3
|
+
import { ErrorState as n } from "../../product-management/shared/components/feedback/ErrorState.js";
|
|
4
|
+
import { ProductStatusBadge as r } from "../../product-management/modules/products/components/ProductStatusBadge.js";
|
|
5
|
+
import { SearchInput as i } from "../../product-management/shared/components/input/SearchInput.js";
|
|
6
|
+
import { useProductUser as a } from "../providers/ProductUserProvider.js";
|
|
7
|
+
import "../../shared/hooks/useTr.js";
|
|
6
8
|
import "../../shared/components/index.js";
|
|
7
|
-
import { usePublicProducts as
|
|
8
|
-
import { isSafeUrl as
|
|
9
|
-
import { PlatformProductStatus as
|
|
10
|
-
import { useState as
|
|
11
|
-
import { Eye as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { AuroraBackground as
|
|
9
|
+
import { usePublicProducts as o } from "../hooks/usePublicProducts.js";
|
|
10
|
+
import { isSafeUrl as s } from "../../shared/utils/isSafeUrl.js";
|
|
11
|
+
import { PlatformProductStatus as c } from "../../generated/global-types.js";
|
|
12
|
+
import { useState as l } from "react";
|
|
13
|
+
import { Eye as u, RefreshCw as d } from "lucide-react";
|
|
14
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
|
+
import { AuroraBackground as m, CTAOverflowMenu as h, GlassCard as g, GradientText as _, IllustratedEmptyState as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
14
16
|
//#region src/product/pages/ProductCatalogPage.tsx
|
|
15
|
-
function
|
|
16
|
-
let { navigate:
|
|
17
|
-
...
|
|
18
|
-
search:
|
|
17
|
+
function b() {
|
|
18
|
+
let { navigate: b, basePath: x = "/products" } = a(), S = e(), [C, w] = l(""), [T, E] = l({}), { products: D, loading: O, error: k, refetch: A } = o({
|
|
19
|
+
...T,
|
|
20
|
+
search: C || void 0
|
|
19
21
|
}, { limit: 20 });
|
|
20
|
-
return
|
|
22
|
+
return O && !D.length ? /* @__PURE__ */ f("div", {
|
|
21
23
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
}) :
|
|
24
|
+
children: /* @__PURE__ */ f(t, { message: S("productCatalog.loading", "Loading products...") })
|
|
25
|
+
}) : k ? /* @__PURE__ */ f("div", {
|
|
24
26
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
message:
|
|
27
|
+
children: /* @__PURE__ */ f(n, {
|
|
28
|
+
message: k.message,
|
|
27
29
|
action: {
|
|
28
|
-
label: "Retry",
|
|
29
|
-
onClick: () =>
|
|
30
|
+
label: S("productCatalog.retry", "Retry"),
|
|
31
|
+
onClick: () => A()
|
|
30
32
|
}
|
|
31
33
|
})
|
|
32
|
-
}) : /* @__PURE__ */
|
|
34
|
+
}) : /* @__PURE__ */ p("div", {
|
|
33
35
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ p("div", {
|
|
35
37
|
className: "mb-6",
|
|
36
38
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ p("div", {
|
|
38
40
|
className: "relative overflow-hidden rounded-card mb-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",
|
|
39
41
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ f(m, { intensity: "subtle" }),
|
|
43
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
|
|
42
44
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2",
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ f(_, { children: S("productCatalog.title", "Products") })
|
|
46
|
+
}), /* @__PURE__ */ f("p", {
|
|
45
47
|
className: "text-text-secondary",
|
|
46
|
-
children: "Browse available platform products"
|
|
48
|
+
children: S("productCatalog.subtitle", "Browse available platform products")
|
|
47
49
|
})] }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
label: "Refresh",
|
|
50
|
+
/* @__PURE__ */ f(h, { actions: [{
|
|
51
|
+
label: S("productCatalog.refresh", "Refresh"),
|
|
50
52
|
onSelect: () => {
|
|
51
|
-
|
|
53
|
+
A();
|
|
52
54
|
},
|
|
53
|
-
icon: /* @__PURE__ */ d
|
|
55
|
+
icon: /* @__PURE__ */ f(d, { className: `size-4 ${O ? "animate-spin" : ""}` })
|
|
54
56
|
}] })
|
|
55
57
|
]
|
|
56
58
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ f(y, {
|
|
58
60
|
className: "mb-4",
|
|
59
|
-
children: "This is the public product catalog — explore every platform product available to you, see whether each is live or coming soon, and open one to view its full details and shortcuts."
|
|
61
|
+
children: S("productCatalog.purpose", "This is the public product catalog — explore every platform product available to you, see whether each is live or coming soon, and open one to view its full details and shortcuts.")
|
|
60
62
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ p("div", {
|
|
62
64
|
className: "flex gap-4",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
-
value:
|
|
65
|
-
onChange:
|
|
66
|
-
placeholder: "Search products...",
|
|
65
|
+
children: [/* @__PURE__ */ f(i, {
|
|
66
|
+
value: C,
|
|
67
|
+
onChange: w,
|
|
68
|
+
placeholder: S("productCatalog.searchPlaceholder", "Search products..."),
|
|
67
69
|
className: "flex-1"
|
|
68
|
-
}), /* @__PURE__ */
|
|
69
|
-
value:
|
|
70
|
-
onChange: (e) =>
|
|
71
|
-
...
|
|
70
|
+
}), /* @__PURE__ */ p("select", {
|
|
71
|
+
value: T.status || "",
|
|
72
|
+
onChange: (e) => E({
|
|
73
|
+
...T,
|
|
72
74
|
status: e.target.value ? e.target.value : void 0
|
|
73
75
|
}),
|
|
74
76
|
className: "\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n ",
|
|
75
77
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ f("option", {
|
|
77
79
|
value: "",
|
|
78
|
-
children: "All Statuses"
|
|
80
|
+
children: S("productCatalog.statusAll", "All Statuses")
|
|
79
81
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
value:
|
|
82
|
-
children: "Active"
|
|
82
|
+
/* @__PURE__ */ f("option", {
|
|
83
|
+
value: c.Active,
|
|
84
|
+
children: S("productCatalog.statusActive", "Active")
|
|
83
85
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
value:
|
|
86
|
-
children: "Coming Soon"
|
|
86
|
+
/* @__PURE__ */ f("option", {
|
|
87
|
+
value: c.ComingSoon,
|
|
88
|
+
children: S("productCatalog.statusComingSoon", "Coming Soon")
|
|
87
89
|
})
|
|
88
90
|
]
|
|
89
91
|
})]
|
|
90
92
|
})
|
|
91
93
|
]
|
|
92
|
-
}),
|
|
94
|
+
}), D.length === 0 ? /* @__PURE__ */ f(g, {
|
|
93
95
|
treatment: "insight",
|
|
94
96
|
className: "animate-in fade-in duration-200",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
illustration:
|
|
97
|
-
title: "No products found",
|
|
98
|
-
description:
|
|
97
|
+
children: /* @__PURE__ */ f(v, {
|
|
98
|
+
illustration: C || T.status ? "empty-search" : "empty-data",
|
|
99
|
+
title: S("productCatalog.emptyTitle", "No products found"),
|
|
100
|
+
description: C || T.status ? S("productCatalog.emptyDescriptionFiltered", "Try adjusting your search or filters.") : S("productCatalog.emptyDescription", "Check back soon for available platform products.")
|
|
99
101
|
})
|
|
100
|
-
}) : /* @__PURE__ */
|
|
102
|
+
}) : /* @__PURE__ */ f(g, {
|
|
101
103
|
treatment: "glass",
|
|
102
104
|
glow: !0,
|
|
103
105
|
className: "overflow-hidden p-0",
|
|
104
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ p("table", {
|
|
105
107
|
className: "w-full",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ f("thead", {
|
|
107
109
|
className: "bg-bg-sunken/60 border-b border-border-seam",
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ p("tr", { children: [
|
|
111
|
+
/* @__PURE__ */ f("th", {
|
|
110
112
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
111
|
-
children: "Product"
|
|
113
|
+
children: S("productCatalog.columnProduct", "Product")
|
|
112
114
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ f("th", {
|
|
114
116
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
115
|
-
children: "Status"
|
|
117
|
+
children: S("productCatalog.columnStatus", "Status")
|
|
116
118
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ f("th", {
|
|
118
120
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
119
|
-
children: "Website"
|
|
121
|
+
children: S("productCatalog.columnWebsite", "Website")
|
|
120
122
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ f("th", {
|
|
122
124
|
className: "text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
123
|
-
children: "Actions"
|
|
125
|
+
children: S("productCatalog.columnActions", "Actions")
|
|
124
126
|
})
|
|
125
127
|
] })
|
|
126
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ f("tbody", {
|
|
127
129
|
className: "divide-y divide-border-seam",
|
|
128
|
-
children:
|
|
130
|
+
children: D.map((e) => /* @__PURE__ */ p("tr", {
|
|
129
131
|
className: "hover:bg-bg-sunken/70 transition-colors duration-200",
|
|
130
132
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ f("td", {
|
|
132
134
|
className: "px-6 py-4",
|
|
133
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ p("div", {
|
|
134
136
|
className: "flex items-center gap-3",
|
|
135
|
-
children: [e.logoUrl ? /* @__PURE__ */
|
|
137
|
+
children: [e.logoUrl ? /* @__PURE__ */ f("img", {
|
|
136
138
|
src: e.logoUrl,
|
|
137
139
|
alt: e.name,
|
|
138
140
|
className: "size-10 rounded-lg object-cover"
|
|
139
|
-
}) : /* @__PURE__ */
|
|
141
|
+
}) : /* @__PURE__ */ f("div", {
|
|
140
142
|
className: "size-10 rounded-lg bg-[var(--color-status-warning-subtle)] flex items-center justify-center",
|
|
141
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ f("span", {
|
|
142
144
|
className: "text-[var(--color-status-warning)] font-semibold",
|
|
143
145
|
children: e.name[0]
|
|
144
146
|
})
|
|
145
|
-
}), /* @__PURE__ */
|
|
147
|
+
}), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
146
148
|
className: "font-medium text-text-primary",
|
|
147
149
|
children: e.name
|
|
148
|
-
}), e.description && /* @__PURE__ */
|
|
150
|
+
}), e.description && /* @__PURE__ */ f("p", {
|
|
149
151
|
className: "text-sm text-text-tertiary line-clamp-1",
|
|
150
152
|
children: e.description
|
|
151
153
|
})] })]
|
|
152
154
|
})
|
|
153
155
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ f("td", {
|
|
155
157
|
className: "px-6 py-4",
|
|
156
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ f(r, { status: e.status })
|
|
157
159
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ f("td", {
|
|
159
161
|
className: "px-6 py-4",
|
|
160
|
-
children: e.website ?
|
|
162
|
+
children: e.website ? s(e.website) ? /* @__PURE__ */ f("a", {
|
|
161
163
|
href: e.website,
|
|
162
164
|
target: "_blank",
|
|
163
165
|
rel: "noopener noreferrer",
|
|
164
166
|
className: "text-sm text-[var(--color-text-link)] hover:underline",
|
|
165
167
|
children: e.website
|
|
166
|
-
}) : /* @__PURE__ */
|
|
168
|
+
}) : /* @__PURE__ */ f("span", {
|
|
167
169
|
className: "text-sm text-text-primary",
|
|
168
170
|
children: e.website
|
|
169
|
-
}) : /* @__PURE__ */
|
|
171
|
+
}) : /* @__PURE__ */ f("span", {
|
|
170
172
|
className: "text-sm text-text-tertiary",
|
|
171
|
-
children: "-"
|
|
173
|
+
children: S("productCatalog.websiteEmpty", "-")
|
|
172
174
|
})
|
|
173
175
|
}),
|
|
174
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ f("td", {
|
|
175
177
|
className: "px-6 py-4",
|
|
176
|
-
children: /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ f("div", {
|
|
177
179
|
className: "flex items-center justify-end",
|
|
178
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ f("button", {
|
|
179
181
|
type: "button",
|
|
180
|
-
onClick: () =>
|
|
182
|
+
onClick: () => b(`${x}/${e.slug}`),
|
|
181
183
|
className: "p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200",
|
|
182
|
-
title: "View details",
|
|
183
|
-
children: /* @__PURE__ */
|
|
184
|
+
title: S("productCatalog.viewDetails", "View details"),
|
|
185
|
+
children: /* @__PURE__ */ f(u, { size: 18 })
|
|
184
186
|
})
|
|
185
187
|
})
|
|
186
188
|
})
|
|
@@ -192,6 +194,6 @@ function y() {
|
|
|
192
194
|
});
|
|
193
195
|
}
|
|
194
196
|
//#endregion
|
|
195
|
-
export {
|
|
197
|
+
export { b as ProductCatalogPage };
|
|
196
198
|
|
|
197
199
|
//# sourceMappingURL=ProductCatalogPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCatalogPage.js","names":[],"sources":["../../../src/product/pages/ProductCatalogPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { RefreshCw, Eye } from 'lucide-react';\nimport {\n AuroraBackground,\n CTAOverflowMenu,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useProductUser } from '../providers/ProductUserProvider';\nimport { usePublicProducts } from '../hooks/usePublicProducts';\nimport { ProductStatusBadge, SearchInput, LoadingState, ErrorState } from '../../shared/components';\nimport { isSafeUrl } from '../../shared/utils';\nimport {\n PlatformProductStatus,\n type PlatformProductFilterInput,\n} from '../../generated/global-types';\n\nexport function ProductCatalogPage() {\n const { navigate, basePath = '/products' } = useProductUser();\n const [searchQuery, setSearchQuery] = useState('');\n const [filter, setFilter] = useState<PlatformProductFilterInput>({});\n\n const { products, loading, error, refetch } = usePublicProducts(\n { ...filter, search: searchQuery || undefined },\n { limit: 20 }\n );\n\n if (loading && !products.length) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message=\"Loading products...\" />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState message={error.message} action={{ label: 'Retry', onClick: () => refetch() }} />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n <div className=\"mb-6\">\n <div className=\"relative overflow-hidden rounded-card mb-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4\">\n <AuroraBackground intensity=\"subtle\" />\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n <GradientText>Products</GradientText>\n </h1>\n <p className=\"text-text-secondary\">Browse available platform products</p>\n </div>\n <CTAOverflowMenu\n actions={[\n {\n label: 'Refresh',\n onSelect: () => {\n void refetch();\n },\n icon: <RefreshCw className={`size-4 ${loading ? 'animate-spin' : ''}`} />,\n },\n ]}\n />\n </div>\n\n <PagePurpose className=\"mb-4\">\n This is the public product catalog — explore every platform product available to you, see\n whether each is live or coming soon, and open one to view its full details and shortcuts.\n </PagePurpose>\n\n <div className=\"flex gap-4\">\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder=\"Search products...\"\n className=\"flex-1\"\n />\n\n <select\n value={filter.status || ''}\n onChange={(e) =>\n setFilter({\n ...filter,\n status: e.target.value ? (e.target.value as PlatformProductStatus) : undefined,\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">All Statuses</option>\n <option value={PlatformProductStatus.Active}>Active</option>\n <option value={PlatformProductStatus.ComingSoon}>Coming Soon</option>\n </select>\n </div>\n </div>\n\n {products.length === 0 ? (\n <GlassCard treatment=\"insight\" className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={searchQuery || filter.status ? 'empty-search' : 'empty-data'}\n title=\"No products found\"\n description={\n searchQuery || filter.status\n ? 'Try adjusting your search or filters.'\n : 'Check back soon for available platform products.'\n }\n />\n </GlassCard>\n ) : (\n <GlassCard treatment=\"glass\" glow className=\"overflow-hidden p-0\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken/60 border-b border-border-seam\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n Product\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n Status\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n Website\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n Actions\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-seam\">\n {products.map((product) => (\n <tr\n key={product.id}\n className=\"hover:bg-bg-sunken/70 transition-colors duration-200\"\n >\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n {product.logoUrl ? (\n <img\n src={product.logoUrl}\n alt={product.name}\n className=\"size-10 rounded-lg object-cover\"\n />\n ) : (\n <div className=\"size-10 rounded-lg bg-[var(--color-status-warning-subtle)] flex items-center justify-center\">\n <span className=\"text-[var(--color-status-warning)] font-semibold\">\n {product.name[0]}\n </span>\n </div>\n )}\n <div>\n <p className=\"font-medium text-text-primary\">{product.name}</p>\n {product.description && (\n <p className=\"text-sm text-text-tertiary line-clamp-1\">\n {product.description}\n </p>\n )}\n </div>\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <ProductStatusBadge status={product.status} />\n </td>\n <td className=\"px-6 py-4\">\n {product.website ? (\n isSafeUrl(product.website) ? (\n <a\n href={product.website}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-[var(--color-text-link)] hover:underline\"\n >\n {product.website}\n </a>\n ) : (\n <span className=\"text-sm text-text-primary\">{product.website}</span>\n )\n ) : (\n <span className=\"text-sm text-text-tertiary\">-</span>\n )}\n </td>\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center justify-end\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/${product.slug}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title=\"View details\"\n >\n <Eye size={18} />\n </button>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </GlassCard>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,IAAqB;CACnC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAgB,EACvD,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAQ,KAAa,EAAqC,EAAE,CAAC,EAE9D,EAAE,aAAU,YAAS,UAAO,eAAY,EAC5C;EAAE,GAAG;EAAQ,QAAQ,KAAe,KAAA;EAAW,EAC/C,EAAE,OAAO,IAAI,CACd;AAkBD,QAhBI,KAAW,CAAC,EAAS,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U,CAAA;QAC3C,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAQ,UACP,EAAU,EAAQ,QAAQ,GACxB,kBAAC,KAAD;SACE,MAAM,EAAQ;SACd,QAAO;SACP,KAAI;SACJ,WAAU;mBAET,EAAQ;SACP,CAAA,GAEJ,kBAAC,QAAD;SAAM,WAAU;mBAA6B,EAAQ;SAAe,CAAA,GAGtE,kBAAC,QAAD;SAAM,WAAU;mBAA6B;SAAQ,CAAA;QAEpD,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACZ,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAS,GAAG,EAAS,GAAG,EAAQ,OAAO;UACtD,WAAU;UACV,OAAM;oBAEN,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;UACV,CAAA;SACL,CAAA;QACH,CAAA;OACF;QA7DE,EAAQ,GA6DV,CACL;KACI,CAAA,CACF;;GACE,CAAA,CAEV"}
|
|
1
|
+
{"version":3,"file":"ProductCatalogPage.js","names":[],"sources":["../../../src/product/pages/ProductCatalogPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { RefreshCw, Eye } from 'lucide-react';\nimport {\n AuroraBackground,\n CTAOverflowMenu,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useProductUser } from '../providers/ProductUserProvider';\nimport { usePublicProducts } from '../hooks/usePublicProducts';\nimport { ProductStatusBadge, SearchInput, LoadingState, ErrorState } from '../../shared/components';\nimport { isSafeUrl } from '../../shared/utils';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n PlatformProductStatus,\n type PlatformProductFilterInput,\n} from '../../generated/global-types';\n\nexport function ProductCatalogPage() {\n const { navigate, basePath = '/products' } = useProductUser();\n const tr = useTr();\n const [searchQuery, setSearchQuery] = useState('');\n const [filter, setFilter] = useState<PlatformProductFilterInput>({});\n\n const { products, loading, error, refetch } = usePublicProducts(\n { ...filter, search: searchQuery || undefined },\n { limit: 20 }\n );\n\n if (loading && !products.length) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('productCatalog.loading', 'Loading products...')} />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error.message}\n action={{\n label: tr('productCatalog.retry', 'Retry'),\n onClick: () => refetch(),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n <div className=\"mb-6\">\n <div className=\"relative overflow-hidden rounded-card mb-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4\">\n <AuroraBackground intensity=\"subtle\" />\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n <GradientText>{tr('productCatalog.title', 'Products')}</GradientText>\n </h1>\n <p className=\"text-text-secondary\">\n {tr('productCatalog.subtitle', 'Browse available platform products')}\n </p>\n </div>\n <CTAOverflowMenu\n actions={[\n {\n label: tr('productCatalog.refresh', 'Refresh'),\n onSelect: () => {\n void refetch();\n },\n icon: <RefreshCw className={`size-4 ${loading ? 'animate-spin' : ''}`} />,\n },\n ]}\n />\n </div>\n\n <PagePurpose className=\"mb-4\">\n {tr(\n 'productCatalog.purpose',\n 'This is the public product catalog — explore every platform product available to you, see whether each is live or coming soon, and open one to view its full details and shortcuts.'\n )}\n </PagePurpose>\n\n <div className=\"flex gap-4\">\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('productCatalog.searchPlaceholder', 'Search products...')}\n className=\"flex-1\"\n />\n\n <select\n value={filter.status || ''}\n onChange={(e) =>\n setFilter({\n ...filter,\n status: e.target.value ? (e.target.value as PlatformProductStatus) : undefined,\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('productCatalog.statusAll', 'All Statuses')}</option>\n <option value={PlatformProductStatus.Active}>\n {tr('productCatalog.statusActive', 'Active')}\n </option>\n <option value={PlatformProductStatus.ComingSoon}>\n {tr('productCatalog.statusComingSoon', 'Coming Soon')}\n </option>\n </select>\n </div>\n </div>\n\n {products.length === 0 ? (\n <GlassCard treatment=\"insight\" className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={searchQuery || filter.status ? 'empty-search' : 'empty-data'}\n title={tr('productCatalog.emptyTitle', 'No products found')}\n description={\n searchQuery || filter.status\n ? tr(\n 'productCatalog.emptyDescriptionFiltered',\n 'Try adjusting your search or filters.'\n )\n : tr(\n 'productCatalog.emptyDescription',\n 'Check back soon for available platform products.'\n )\n }\n />\n </GlassCard>\n ) : (\n <GlassCard treatment=\"glass\" glow className=\"overflow-hidden p-0\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken/60 border-b border-border-seam\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('productCatalog.columnProduct', 'Product')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('productCatalog.columnStatus', 'Status')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('productCatalog.columnWebsite', 'Website')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('productCatalog.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-seam\">\n {products.map((product) => (\n <tr\n key={product.id}\n className=\"hover:bg-bg-sunken/70 transition-colors duration-200\"\n >\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n {product.logoUrl ? (\n <img\n src={product.logoUrl}\n alt={product.name}\n className=\"size-10 rounded-lg object-cover\"\n />\n ) : (\n <div className=\"size-10 rounded-lg bg-[var(--color-status-warning-subtle)] flex items-center justify-center\">\n <span className=\"text-[var(--color-status-warning)] font-semibold\">\n {product.name[0]}\n </span>\n </div>\n )}\n <div>\n <p className=\"font-medium text-text-primary\">{product.name}</p>\n {product.description && (\n <p className=\"text-sm text-text-tertiary line-clamp-1\">\n {product.description}\n </p>\n )}\n </div>\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <ProductStatusBadge status={product.status} />\n </td>\n <td className=\"px-6 py-4\">\n {product.website ? (\n isSafeUrl(product.website) ? (\n <a\n href={product.website}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-[var(--color-text-link)] hover:underline\"\n >\n {product.website}\n </a>\n ) : (\n <span className=\"text-sm text-text-primary\">{product.website}</span>\n )\n ) : (\n <span className=\"text-sm text-text-tertiary\">\n {tr('productCatalog.websiteEmpty', '-')}\n </span>\n )}\n </td>\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center justify-end\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/${product.slug}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('productCatalog.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </GlassCard>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,SAAgB,IAAqB;CACnC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAgB,EACvD,IAAK,GAAO,EACZ,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAQ,KAAa,EAAqC,EAAE,CAAC,EAE9D,EAAE,aAAU,YAAS,UAAO,eAAY,EAC5C;EAAE,GAAG;EAAQ,QAAQ,KAAe,KAAA;EAAW,EAC/C,EAAE,OAAO,IAAI,CACd;AAwBD,QAtBI,KAAW,CAAC,EAAS,SAErB,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAc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ER,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;UAAG,WAAU;oBAAiC,EAAQ;UAAS,CAAA,EAC9D,EAAQ,eACP,kBAAC,KAAD;UAAG,WAAU;oBACV,EAAQ;UACP,CAAA,CAEF,EAAA,CAAA,CACF;;QACH,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACZ,kBAAC,GAAD,EAAoB,QAAQ,EAAQ,QAAU,CAAA;QAC3C,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAQ,UACP,EAAU,EAAQ,QAAQ,GACxB,kBAAC,KAAD;SACE,MAAM,EAAQ;SACd,QAAO;SACP,KAAI;SACJ,WAAU;mBAET,EAAQ;SACP,CAAA,GAEJ,kBAAC,QAAD;SAAM,WAAU;mBAA6B,EAAQ;SAAe,CAAA,GAGtE,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,+BAA+B,IAAI;SAClC,CAAA;QAEN,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACZ,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAS,GAAG,EAAS,GAAG,EAAQ,OAAO;UACtD,WAAU;UACV,OAAO,EAAG,8BAA8B,eAAe;oBAEvD,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;UACV,CAAA;SACL,CAAA;QACH,CAAA;OACF;QA/DE,EAAQ,GA+DV,CACL;KACI,CAAA,CACF;;GACE,CAAA,CAEV"}
|
|
@@ -1,82 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { LoadingState as t } from "./feedback/LoadingState.js";
|
|
3
|
+
import { GetEntityActivityLogsDocument as n } from "../../../generated/global-operations.js";
|
|
4
|
+
import { AlertCircle as r, Clock as i, User as a } from "lucide-react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { IllustratedEmptyState as c } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
import { useQuery as l } from "@apollo/client/react";
|
|
7
8
|
//#region src/product-management/shared/components/AuditHistoryTab.tsx
|
|
8
|
-
function
|
|
9
|
-
let { data:
|
|
9
|
+
function u({ resourceId: u, resourceType: d }) {
|
|
10
|
+
let f = e(), { data: p, loading: m, error: h } = l(n, {
|
|
10
11
|
variables: {
|
|
11
|
-
resourceId:
|
|
12
|
-
resourceType:
|
|
12
|
+
resourceId: u,
|
|
13
|
+
resourceType: d,
|
|
13
14
|
limit: 50,
|
|
14
15
|
offset: 0
|
|
15
16
|
},
|
|
16
17
|
fetchPolicy: "cache-and-network"
|
|
17
18
|
});
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
19
|
+
if (m) return /* @__PURE__ */ o(t, { message: f("auditHistory.loading", "Loading activity history…") });
|
|
20
|
+
if (h) return /* @__PURE__ */ s("div", {
|
|
20
21
|
className: "flex items-center gap-2 text-[var(--color-status-error)] p-4",
|
|
21
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ o(r, { size: 16 }), /* @__PURE__ */ o("span", {
|
|
22
23
|
className: "text-sm",
|
|
23
|
-
children:
|
|
24
|
+
children: h.message
|
|
24
25
|
})]
|
|
25
26
|
});
|
|
26
|
-
let
|
|
27
|
-
if (
|
|
27
|
+
let g = p?.activityLogs?.nodes ?? [];
|
|
28
|
+
if (g.length === 0) return /* @__PURE__ */ o(c, {
|
|
28
29
|
illustration: "empty-notifications",
|
|
29
|
-
title: "No activity yet",
|
|
30
|
-
description: "Changes to this item — who edited what and when — will appear here as they happen."
|
|
30
|
+
title: f("auditHistory.noActivityTitle", "No activity yet"),
|
|
31
|
+
description: f("auditHistory.noActivityDescription", "Changes to this item — who edited what and when — will appear here as they happen.")
|
|
31
32
|
});
|
|
32
|
-
let
|
|
33
|
+
let _ = (e) => new Date(e).toLocaleString("en-US", {
|
|
33
34
|
year: "numeric",
|
|
34
35
|
month: "short",
|
|
35
36
|
day: "numeric",
|
|
36
37
|
hour: "2-digit",
|
|
37
38
|
minute: "2-digit"
|
|
38
39
|
});
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ o("div", {
|
|
40
41
|
className: "divide-y divide-border-seam",
|
|
41
|
-
children:
|
|
42
|
+
children: g.map((e) => /* @__PURE__ */ s("div", {
|
|
42
43
|
className: "flex items-start gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
43
44
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ o("div", {
|
|
45
46
|
className: "size-8 rounded-full bg-[var(--color-status-info-subtle)] flex items-center justify-center shrink-0",
|
|
46
|
-
children: /* @__PURE__ */ a
|
|
47
|
+
children: /* @__PURE__ */ o(a, {
|
|
47
48
|
size: 14,
|
|
48
49
|
className: "text-[var(--color-status-info)]"
|
|
49
50
|
})
|
|
50
51
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ s("div", {
|
|
52
53
|
className: "flex-1 min-w-0",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ s("p", {
|
|
54
55
|
className: "text-sm text-text-primary",
|
|
55
56
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ o("span", {
|
|
57
58
|
className: "font-medium",
|
|
58
|
-
children: e.actorId ?? "system"
|
|
59
|
+
children: e.actorId ?? f("auditHistory.actorFallback", "system")
|
|
59
60
|
}),
|
|
60
61
|
" ",
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ o("span", {
|
|
62
63
|
className: "text-text-secondary",
|
|
63
64
|
children: e.description ?? e.action
|
|
64
65
|
})
|
|
65
66
|
]
|
|
66
|
-
}), e.metadata && typeof e.metadata == "object" && Object.keys(e.metadata).length > 0 && /* @__PURE__ */
|
|
67
|
+
}), e.metadata && typeof e.metadata == "object" && Object.keys(e.metadata).length > 0 && /* @__PURE__ */ o("p", {
|
|
67
68
|
className: "text-xs text-text-tertiary font-mono mt-0.5 truncate",
|
|
68
69
|
children: JSON.stringify(e.metadata)
|
|
69
70
|
})]
|
|
70
71
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ s("div", {
|
|
72
73
|
className: "flex items-center gap-1 text-xs text-text-tertiary shrink-0",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ o(i, { size: 12 }), /* @__PURE__ */ o("span", { children: _(e.createdAt) })]
|
|
74
75
|
})
|
|
75
76
|
]
|
|
76
77
|
}, e.id))
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
//#endregion
|
|
80
|
-
export {
|
|
81
|
+
export { u as AuditHistoryTab };
|
|
81
82
|
|
|
82
83
|
//# sourceMappingURL=AuditHistoryTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditHistoryTab.js","names":[],"sources":["../../../../src/product-management/shared/components/AuditHistoryTab.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport { Clock, User, AlertCircle } from 'lucide-react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport {\n GetEntityActivityLogsDocument,\n type GetEntityActivityLogsQuery,\n} from '../../../generated/global-operations';\nimport { LoadingState } from './feedback/LoadingState';\n\ntype ActivityLog = NonNullable<GetEntityActivityLogsQuery['activityLogs']['nodes'][number]>;\n\ninterface AuditHistoryTabProps {\n resourceId: string;\n resourceType: string;\n}\n\nexport function AuditHistoryTab({ resourceId, resourceType }: AuditHistoryTabProps) {\n const { data, loading, error } = useQuery(GetEntityActivityLogsDocument, {\n variables: { resourceId, resourceType, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n if (loading)
|
|
1
|
+
{"version":3,"file":"AuditHistoryTab.js","names":[],"sources":["../../../../src/product-management/shared/components/AuditHistoryTab.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport { Clock, User, AlertCircle } from 'lucide-react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport {\n GetEntityActivityLogsDocument,\n type GetEntityActivityLogsQuery,\n} from '../../../generated/global-operations';\nimport { LoadingState } from './feedback/LoadingState';\nimport { useTr } from '../hooks/useTr';\n\ntype ActivityLog = NonNullable<GetEntityActivityLogsQuery['activityLogs']['nodes'][number]>;\n\ninterface AuditHistoryTabProps {\n resourceId: string;\n resourceType: string;\n}\n\nexport function AuditHistoryTab({ resourceId, resourceType }: AuditHistoryTabProps) {\n const tr = useTr();\n const { data, loading, error } = useQuery(GetEntityActivityLogsDocument, {\n variables: { resourceId, resourceType, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n if (loading)\n return <LoadingState message={tr('auditHistory.loading', 'Loading activity history…')} />;\n\n if (error) {\n return (\n <div className=\"flex items-center gap-2 text-[var(--color-status-error)] p-4\">\n <AlertCircle size={16} />\n <span className=\"text-sm\">{error.message}</span>\n </div>\n );\n }\n\n const logs = data?.activityLogs?.nodes ?? [];\n\n if (logs.length === 0) {\n return (\n <IllustratedEmptyState\n illustration=\"empty-notifications\"\n title={tr('auditHistory.noActivityTitle', 'No activity yet')}\n description={tr(\n 'auditHistory.noActivityDescription',\n 'Changes to this item — who edited what and when — will appear here as they happen.'\n )}\n />\n );\n }\n\n const formatDate = (dateString: string) =>\n new Date(dateString).toLocaleString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n\n return (\n <div className=\"divide-y divide-border-seam\">\n {logs.map((log: ActivityLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors\"\n >\n <div className=\"size-8 rounded-full bg-[var(--color-status-info-subtle)] flex items-center justify-center shrink-0\">\n <User size={14} className=\"text-[var(--color-status-info)]\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm text-text-primary\">\n <span className=\"font-medium\">\n {log.actorId ?? tr('auditHistory.actorFallback', 'system')}\n </span>{' '}\n <span className=\"text-text-secondary\">{log.description ?? log.action}</span>\n </p>\n {log.metadata &&\n typeof log.metadata === 'object' &&\n Object.keys(log.metadata as object).length > 0 && (\n <p className=\"text-xs text-text-tertiary font-mono mt-0.5 truncate\">\n {JSON.stringify(log.metadata)}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1 text-xs text-text-tertiary shrink-0\">\n <Clock size={12} />\n <span>{formatDate(log.createdAt)}</span>\n </div>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,EAAgB,EAAE,eAAY,mBAAsC;CAClF,IAAM,IAAK,GAAO,EACZ,EAAE,SAAM,YAAS,aAAU,EAAS,GAA+B;EACvE,WAAW;GAAE;GAAY;GAAc,OAAO;GAAI,QAAQ;GAAG;EAC7D,aAAa;EACd,CAAC;AAEF,KAAI,EACF,QAAO,kBAAC,GAAD,EAAc,SAAS,EAAG,wBAAwB,4BAA4B,EAAI,CAAA;AAE3F,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,EACzB,kBAAC,QAAD;GAAM,WAAU;aAAW,EAAM;GAAe,CAAA,CAC5C;;CAIV,IAAM,IAAO,GAAM,cAAc,SAAS,EAAE;AAE5C,KAAI,EAAK,WAAW,EAClB,QACE,kBAAC,GAAD;EACE,cAAa;EACb,OAAO,EAAG,gCAAgC,kBAAkB;EAC5D,aAAa,EACX,sCACA,qFACD;EACD,CAAA;CAIN,IAAM,KAAc,MAClB,IAAI,KAAK,EAAW,CAAC,eAAe,SAAS;EAC3C,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACT,CAAC;AAEJ,QACE,kBAAC,OAAD;EAAK,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