@burdenoff/microfe-ecoimpacthub 2026.1110.3 → 2026.1110.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecoimpacthub/EcoImpactHubRoot.js +60 -44
- package/dist/ecoimpacthub/EcoImpactHubRoot.js.map +1 -1
- package/dist/ecoimpacthub/EcoImpactHubRoutes.js +34 -26
- package/dist/ecoimpacthub/EcoImpactHubRoutes.js.map +1 -1
- package/dist/ecoimpacthub/components/StatusBadge.js +18 -0
- package/dist/ecoimpacthub/components/StatusBadge.js.map +1 -1
- package/dist/ecoimpacthub/hooks/index.js +10 -10
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.d.ts +55 -1
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +270 -46
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
- package/dist/ecoimpacthub/pages/circularity/CircularityPage.d.ts +19 -0
- package/dist/ecoimpacthub/pages/circularity/CircularityPage.js +1111 -0
- package/dist/ecoimpacthub/pages/circularity/CircularityPage.js.map +1 -0
- package/dist/ecoimpacthub/pages/metrics/MetricDetailDialog.d.ts +12 -0
- package/dist/ecoimpacthub/pages/metrics/MetricDetailDialog.js +84 -0
- package/dist/ecoimpacthub/pages/metrics/MetricDetailDialog.js.map +1 -0
- package/dist/ecoimpacthub/pages/metrics/MetricsPage.d.ts +15 -0
- package/dist/ecoimpacthub/pages/metrics/MetricsPage.js +312 -0
- package/dist/ecoimpacthub/pages/metrics/MetricsPage.js.map +1 -0
- package/dist/ecoimpacthub/types/index.d.ts +155 -0
- package/package.json +1 -1
|
@@ -5,112 +5,128 @@ import { useCallback as r, useEffect as i } from "react";
|
|
|
5
5
|
import { QueryClient as a, QueryClientProvider as o } from "@tanstack/react-query";
|
|
6
6
|
import { FeatureFlagProvider as s } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
7
7
|
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
-
import { Binoculars as l,
|
|
9
|
-
import { jsx as
|
|
8
|
+
import { Binoculars as l, BookOpen as u, Factory as d, FileText as f, Gauge as p, LayoutDashboard as m, MapPin as h, PawPrint as g, Recycle as _, Trees as v } from "lucide-react";
|
|
9
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
10
10
|
// src/ecoimpacthub/EcoImpactHubRoot.tsx
|
|
11
|
-
var
|
|
11
|
+
var b = new a({ defaultOptions: { queries: {
|
|
12
12
|
staleTime: 3e5,
|
|
13
13
|
retry: 1,
|
|
14
14
|
refetchOnWindowFocus: !1
|
|
15
|
-
} } }),
|
|
16
|
-
let { registerNavItems:
|
|
17
|
-
let n =
|
|
15
|
+
} } }), x = (a) => {
|
|
16
|
+
let { registerNavItems: x, registerFooterItems: S, basePath: C = "/" } = a, { t: w } = c(), T = r((e, t) => {
|
|
17
|
+
let n = w(e);
|
|
18
18
|
return n === e ? t : n;
|
|
19
|
-
}, [
|
|
19
|
+
}, [w]);
|
|
20
20
|
return i(() => {
|
|
21
|
-
if (!
|
|
21
|
+
if (!x) return;
|
|
22
22
|
let e = [
|
|
23
23
|
{
|
|
24
24
|
id: "ecoimpacthub-dashboard",
|
|
25
|
-
label:
|
|
26
|
-
path: n(
|
|
27
|
-
icon: /* @__PURE__ */
|
|
25
|
+
label: T("ecoimpacthub.nav.dashboard", "Dashboard"),
|
|
26
|
+
path: n(C, ""),
|
|
27
|
+
icon: /* @__PURE__ */ y(m, { size: 20 }),
|
|
28
28
|
order: 0,
|
|
29
29
|
group: "products"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
id: "ecoimpacthub-sites",
|
|
33
|
-
label:
|
|
34
|
-
path: n(
|
|
35
|
-
icon: /* @__PURE__ */
|
|
33
|
+
label: T("ecoimpacthub.nav.sites", "Sites"),
|
|
34
|
+
path: n(C, "sites"),
|
|
35
|
+
icon: /* @__PURE__ */ y(h, { size: 20 }),
|
|
36
36
|
order: 1,
|
|
37
37
|
group: "products"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
id: "ecoimpacthub-monitoring",
|
|
41
|
-
label:
|
|
42
|
-
path: n(
|
|
43
|
-
icon: /* @__PURE__ */
|
|
41
|
+
label: T("ecoimpacthub.nav.monitoring", "Monitoring"),
|
|
42
|
+
path: n(C, "monitoring"),
|
|
43
|
+
icon: /* @__PURE__ */ y(p, { size: 20 }),
|
|
44
44
|
order: 2,
|
|
45
45
|
group: "products"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
id: "ecoimpacthub-species",
|
|
49
|
-
label:
|
|
50
|
-
path: n(
|
|
51
|
-
icon: /* @__PURE__ */
|
|
49
|
+
label: T("ecoimpacthub.nav.species", "Species"),
|
|
50
|
+
path: n(C, "species"),
|
|
51
|
+
icon: /* @__PURE__ */ y(g, { size: 20 }),
|
|
52
52
|
order: 3,
|
|
53
53
|
group: "products"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
id: "ecoimpacthub-observations",
|
|
57
|
-
label:
|
|
58
|
-
path: n(
|
|
59
|
-
icon: /* @__PURE__ */
|
|
57
|
+
label: T("ecoimpacthub.nav.observations", "Observations"),
|
|
58
|
+
path: n(C, "observations"),
|
|
59
|
+
icon: /* @__PURE__ */ y(l, { size: 20 }),
|
|
60
60
|
order: 4,
|
|
61
61
|
group: "products"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
id: "ecoimpacthub-habitat",
|
|
65
|
-
label:
|
|
66
|
-
path: n(
|
|
67
|
-
icon: /* @__PURE__ */
|
|
65
|
+
label: T("ecoimpacthub.nav.habitat", "Habitat"),
|
|
66
|
+
path: n(C, "habitat"),
|
|
67
|
+
icon: /* @__PURE__ */ y(v, { size: 20 }),
|
|
68
68
|
order: 5,
|
|
69
69
|
group: "products"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
id: "ecoimpacthub-carbon",
|
|
73
|
-
label:
|
|
74
|
-
path: n(
|
|
75
|
-
icon: /* @__PURE__ */
|
|
73
|
+
label: T("ecoimpacthub.nav.carbon", "Carbon"),
|
|
74
|
+
path: n(C, "carbon"),
|
|
75
|
+
icon: /* @__PURE__ */ y(d, { size: 20 }),
|
|
76
76
|
order: 6,
|
|
77
77
|
group: "products"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
|
-
id: "ecoimpacthub-
|
|
81
|
-
label:
|
|
82
|
-
path: n(
|
|
83
|
-
icon: /* @__PURE__ */ _
|
|
80
|
+
id: "ecoimpacthub-circularity",
|
|
81
|
+
label: T("ecoimpacthub.nav.circularity", "Waste & Circularity"),
|
|
82
|
+
path: n(C, "circularity"),
|
|
83
|
+
icon: /* @__PURE__ */ y(_, { size: 20 }),
|
|
84
|
+
order: 7,
|
|
85
|
+
group: "products"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "ecoimpacthub-metrics",
|
|
89
|
+
label: T("ecoimpacthub.nav.metrics", "Metrics"),
|
|
90
|
+
path: n(C, "metrics"),
|
|
91
|
+
icon: /* @__PURE__ */ y(u, { size: 20 }),
|
|
84
92
|
order: 7,
|
|
85
93
|
group: "products"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "ecoimpacthub-reports",
|
|
97
|
+
label: T("ecoimpacthub.nav.reports", "Reports"),
|
|
98
|
+
path: n(C, "reports"),
|
|
99
|
+
icon: /* @__PURE__ */ y(f, { size: 20 }),
|
|
100
|
+
order: 9,
|
|
101
|
+
group: "products"
|
|
86
102
|
}
|
|
87
103
|
];
|
|
88
|
-
return
|
|
104
|
+
return x(e);
|
|
89
105
|
}, [
|
|
90
|
-
y,
|
|
91
106
|
x,
|
|
92
|
-
C
|
|
107
|
+
C,
|
|
108
|
+
T
|
|
93
109
|
]), i(() => {
|
|
94
|
-
if (
|
|
110
|
+
if (S) return S([{
|
|
95
111
|
id: "ecoimpacthub-status",
|
|
96
|
-
label:
|
|
112
|
+
label: T("ecoimpacthub.footer.ready", "EcoImpactHub Ready"),
|
|
97
113
|
type: "status",
|
|
98
114
|
section: "left",
|
|
99
115
|
order: 10
|
|
100
116
|
}]);
|
|
101
|
-
}, [
|
|
102
|
-
client:
|
|
103
|
-
children: /* @__PURE__ */
|
|
117
|
+
}, [S, T]), /* @__PURE__ */ y(o, {
|
|
118
|
+
client: b,
|
|
119
|
+
children: /* @__PURE__ */ y(s, {
|
|
104
120
|
workspaceId: null,
|
|
105
121
|
gateway: "global",
|
|
106
122
|
defaultEnabled: !0,
|
|
107
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ y(e, {
|
|
108
124
|
...a,
|
|
109
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ y(t, {})
|
|
110
126
|
})
|
|
111
127
|
})
|
|
112
128
|
});
|
|
113
129
|
};
|
|
114
|
-
export {
|
|
130
|
+
export { x as EcoImpactHubRoot };
|
|
115
131
|
|
|
116
132
|
//# sourceMappingURL=EcoImpactHubRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcoImpactHubRoot.js","names":["queryClient","QueryClient","EcoImpactHubRoot","props","translate","useI18n","t","useCallback","value","key","fallback","useEffect","registerNavItems","navItems","joinPath","basePath","LayoutDashboard","MapPin","Gauge","PawPrint","Binoculars","Trees","Factory","FileText","registerFooterItems","QueryClientProvider","FeatureFlagProvider","EcoImpactHubProvider","EcoImpactHubRoutes"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoot.tsx"],"sourcesContent":["/**\n * EcoImpactHub Root Component\n * @module ecoimpacthub\n *\n * Host-contract entry point. Registers the product's sidebar nav (
|
|
1
|
+
{"version":3,"file":"EcoImpactHubRoot.js","names":["queryClient","QueryClient","EcoImpactHubRoot","props","translate","useI18n","t","useCallback","value","key","fallback","useEffect","registerNavItems","navItems","joinPath","basePath","LayoutDashboard","MapPin","Gauge","PawPrint","Binoculars","Trees","Factory","Recycle","BookOpen","FileText","registerFooterItems","QueryClientProvider","FeatureFlagProvider","EcoImpactHubProvider","EcoImpactHubRoutes"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoot.tsx"],"sourcesContent":["/**\n * EcoImpactHub Root Component\n * @module ecoimpacthub\n *\n * Host-contract entry point. Registers the product's sidebar nav (sections\n * that map 1:1 to the wspace-ecoimpacthub-svc `eco*` backend) and mounts the\n * routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n LayoutDashboard,\n MapPin,\n Gauge,\n PawPrint,\n Binoculars,\n Trees,\n Factory,\n Recycle,\n BookOpen,\n FileText,\n} from 'lucide-react';\nimport { EcoImpactHubProvider } from './context/EcoImpactHubContext';\nimport { EcoImpactHubRoutes } from './EcoImpactHubRoutes';\nimport { joinPath } from './utils/navigation';\nimport type { EcoImpactHubRootProps, NavItem } from './types';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nexport const EcoImpactHubRoot: FC<EcoImpactHubRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Register navigation items with the shell on mount. Ids/paths/orders match\n // the app-shell static NavRegistration block so the two are a single,\n // consistent source of truth.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'ecoimpacthub-dashboard',\n label: t('ecoimpacthub.nav.dashboard', 'Dashboard'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 0,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-sites',\n label: t('ecoimpacthub.nav.sites', 'Sites'),\n path: joinPath(basePath, 'sites'),\n icon: <MapPin size={20} />,\n order: 1,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-monitoring',\n label: t('ecoimpacthub.nav.monitoring', 'Monitoring'),\n path: joinPath(basePath, 'monitoring'),\n icon: <Gauge size={20} />,\n order: 2,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-species',\n label: t('ecoimpacthub.nav.species', 'Species'),\n path: joinPath(basePath, 'species'),\n icon: <PawPrint size={20} />,\n order: 3,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-observations',\n label: t('ecoimpacthub.nav.observations', 'Observations'),\n path: joinPath(basePath, 'observations'),\n icon: <Binoculars size={20} />,\n order: 4,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-habitat',\n label: t('ecoimpacthub.nav.habitat', 'Habitat'),\n path: joinPath(basePath, 'habitat'),\n icon: <Trees size={20} />,\n order: 5,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-carbon',\n label: t('ecoimpacthub.nav.carbon', 'Carbon'),\n path: joinPath(basePath, 'carbon'),\n icon: <Factory size={20} />,\n order: 6,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-circularity',\n label: t('ecoimpacthub.nav.circularity', 'Waste & Circularity'),\n path: joinPath(basePath, 'circularity'),\n icon: <Recycle size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-metrics',\n label: t('ecoimpacthub.nav.metrics', 'Metrics'),\n path: joinPath(basePath, 'metrics'),\n icon: <BookOpen size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-reports',\n label: t('ecoimpacthub.nav.reports', 'Reports'),\n path: joinPath(basePath, 'reports'),\n icon: <FileText size={20} />,\n order: 9,\n group: 'products',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'ecoimpacthub-status',\n label: t('ecoimpacthub.footer.ready', 'EcoImpactHub Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <EcoImpactHubProvider {...props}>\n <EcoImpactHubRoutes />\n </EcoImpactHubProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AA+BA,IAAMA,IAAc,IAAIC,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW;CACX,OAAO;CACP,sBAAsB;AACxB,EACF,EACF,CAAC,GAEYC,KAA+C,MAAU;CACpE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQC,GAC5D,EAAE,GAAGC,MAAcC,EAAQ,GAC3BC,IAAIC,GACP,GAAa,MAA6B;EACzC,IAAMC,IAAQJ,EAAUK,CAAG;EAC3B,OAAOD,MAAUC,IAAMC,IAAWF;CACpC,GACA,CAACJ,CAAS,CACZ;CA2GA,OAtGAO,QAAgB;EACd,IAAI,CAACC,GAAkB;EAEvB,IAAMC,IAAsB;GAC1B;IACE,IAAI;IACJ,OAAOP,EAAE,8BAA8B,WAAW;IAClD,MAAMQ,EAASC,GAAU,EAAE;IAC3B,MAAM,kBAACC,GAAD,EAAiB,MAAM,GAAK,CAAA;IAClC,OAAO;IACP,OAAO;GACT;GACA;IACE,IAAI;IACJ,OAAOV,EAAE,0BAA0B,OAAO;IAC1C,MAAMQ,EAASC,GAAU,OAAO;IAChC,MAAM,kBAACE,GAAD,EAAQ,MAAM,GAAK,CAAA;IACzB,OAAO;IACP,OAAO;GACT;GACA;IACE,IAAI;IACJ,OAAOX,EAAE,+BAA+B,YAAY;IACpD,MAAMQ,EAASC,GAAU,YAAY;IACrC,MAAM,kBAACG,GAAD,EAAO,MAAM,GAAK,CAAA;IACxB,OAAO;IACP,OAAO;GACT;GACA;IACE,IAAI;IACJ,OAAOZ,EA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zB;GACE,IAAI;GACJ,OAAOpB,EAAE,6BAA6B,oBAAoB;GAC1D,MAAM;GACN,SAAS;GACT,OAAO;EACT,CACF,CAAC;CACH,GAAG,CAACoB,GAAqBpB,CAAC,CAAC,GAGzB,kBAACqB,GAAD;EAAqB,QAAQ3B;EAC3B,UAAA,kBAAC4B,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;GACvE,UAAA,kBAACC,GAAD;IAAsB,GAAI1B;IACxB,UAAA,kBAAC2B,GAAD,CAAqB,CAAA;GACD,CAAA;EACH,CAAA;CACF,CAAA;AAEzB"}
|
|
@@ -7,93 +7,101 @@ import { Navigate as s, Route as c, Routes as l, useLocation as u } from "react-
|
|
|
7
7
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
import { Spinner as p } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
// src/ecoimpacthub/EcoImpactHubRoutes.tsx
|
|
10
|
-
var m = a(() => import("./pages/sites/SitesPage.js").then((e) => ({ default: e.SitesPage }))), h = a(() => import("./pages/sites/SiteDetailPage.js").then((e) => ({ default: e.SiteDetailPage }))), g = a(() => import("./pages/monitoring/MonitoringPage.js").then((e) => ({ default: e.MonitoringPage }))), _ = a(() => import("./pages/species/SpeciesPage.js").then((e) => ({ default: e.SpeciesPage }))), v = a(() => import("./pages/species/SpeciesDetailPage.js").then((e) => ({ default: e.SpeciesDetailPage }))), y = a(() => import("./pages/observations/ObservationsPage.js").then((e) => ({ default: e.ObservationsPage }))), b = a(() => import("./pages/habitat/HabitatProjectsPage.js").then((e) => ({ default: e.HabitatProjectsPage }))), x = a(() => import("./pages/habitat/HabitatProjectDetailPage.js").then((e) => ({ default: e.HabitatProjectDetailPage }))), S = a(() => import("./pages/carbon/CarbonPage.js").then((e) => ({ default: e.CarbonPage }))), C = a(() => import("./pages/reports/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))),
|
|
11
|
-
function
|
|
10
|
+
var m = a(() => import("./pages/sites/SitesPage.js").then((e) => ({ default: e.SitesPage }))), h = a(() => import("./pages/sites/SiteDetailPage.js").then((e) => ({ default: e.SiteDetailPage }))), g = a(() => import("./pages/monitoring/MonitoringPage.js").then((e) => ({ default: e.MonitoringPage }))), _ = a(() => import("./pages/species/SpeciesPage.js").then((e) => ({ default: e.SpeciesPage }))), v = a(() => import("./pages/species/SpeciesDetailPage.js").then((e) => ({ default: e.SpeciesDetailPage }))), y = a(() => import("./pages/observations/ObservationsPage.js").then((e) => ({ default: e.ObservationsPage }))), b = a(() => import("./pages/habitat/HabitatProjectsPage.js").then((e) => ({ default: e.HabitatProjectsPage }))), x = a(() => import("./pages/habitat/HabitatProjectDetailPage.js").then((e) => ({ default: e.HabitatProjectDetailPage }))), S = a(() => import("./pages/carbon/CarbonPage.js").then((e) => ({ default: e.CarbonPage }))), C = a(() => import("./pages/circularity/CircularityPage.js").then((e) => ({ default: e.CircularityPage }))), w = a(() => import("./pages/reports/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))), T = a(() => import("./pages/reports/ReportDetailPage.js").then((e) => ({ default: e.ReportDetailPage }))), E = a(() => import("./pages/metrics/MetricsPage.js").then((e) => ({ default: e.MetricsPage }))), D = a(() => import("./pages/mobile/MobileDashboardPage.js").then((e) => ({ default: e.MobileDashboardPage }))), O = a(() => import("./pages/mobile/MobileRecordObservationPage.js").then((e) => ({ default: e.MobileRecordObservationPage }))), k = () => (n(), null), A = "ecoimpacthub.field.nativeHomeShown";
|
|
11
|
+
function j() {
|
|
12
12
|
if (!globalThis.Capacitor?.isNativePlatform?.()) return !1;
|
|
13
13
|
try {
|
|
14
|
-
if (sessionStorage.getItem(
|
|
15
|
-
sessionStorage.setItem(
|
|
14
|
+
if (sessionStorage.getItem(A)) return !1;
|
|
15
|
+
sessionStorage.setItem(A, "1");
|
|
16
16
|
} catch {}
|
|
17
17
|
return !0;
|
|
18
18
|
}
|
|
19
|
-
var
|
|
20
|
-
let [e] = o(
|
|
19
|
+
var M = () => {
|
|
20
|
+
let [e] = o(j);
|
|
21
21
|
return e ? /* @__PURE__ */ d(s, {
|
|
22
22
|
to: "mobile",
|
|
23
23
|
replace: !0
|
|
24
24
|
}) : /* @__PURE__ */ d(r, {});
|
|
25
|
-
},
|
|
25
|
+
}, N = () => /* @__PURE__ */ d("div", {
|
|
26
26
|
className: "flex min-h-[400px] items-center justify-center",
|
|
27
27
|
children: /* @__PURE__ */ d(p, { size: "lg" })
|
|
28
28
|
});
|
|
29
|
-
function
|
|
29
|
+
function P(e, n) {
|
|
30
30
|
return /* @__PURE__ */ d(t, {
|
|
31
31
|
flag: e,
|
|
32
32
|
children: n
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var F = () => {
|
|
36
36
|
let { basePath: t, isStandalone: n } = e(), r = u(), a = t === "/" ? "" : (t ?? "").replace(/\/$/, "");
|
|
37
37
|
return a && !n && !(r.pathname === a || r.pathname.startsWith(a + "/")) ? null : /* @__PURE__ */ f("div", {
|
|
38
38
|
className: "flex min-h-full flex-col",
|
|
39
|
-
children: [/* @__PURE__ */ d(
|
|
40
|
-
fallback: /* @__PURE__ */ d(
|
|
39
|
+
children: [/* @__PURE__ */ d(k, {}), /* @__PURE__ */ d(i, {
|
|
40
|
+
fallback: /* @__PURE__ */ d(N, {}),
|
|
41
41
|
children: /* @__PURE__ */ f(l, { children: [
|
|
42
42
|
/* @__PURE__ */ d(c, {
|
|
43
43
|
index: !0,
|
|
44
|
-
element:
|
|
44
|
+
element: P("ecoimpacthub.page.dashboard", /* @__PURE__ */ d(M, {}))
|
|
45
45
|
}),
|
|
46
46
|
/* @__PURE__ */ d(c, {
|
|
47
47
|
path: "sites",
|
|
48
|
-
element:
|
|
48
|
+
element: P("ecoimpacthub.page.sites", /* @__PURE__ */ d(m, {}))
|
|
49
49
|
}),
|
|
50
50
|
/* @__PURE__ */ d(c, {
|
|
51
51
|
path: "sites/:id",
|
|
52
|
-
element:
|
|
52
|
+
element: P("ecoimpacthub.page.sites", /* @__PURE__ */ d(h, {}))
|
|
53
53
|
}),
|
|
54
54
|
/* @__PURE__ */ d(c, {
|
|
55
55
|
path: "monitoring",
|
|
56
|
-
element:
|
|
56
|
+
element: P("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(g, {}))
|
|
57
57
|
}),
|
|
58
58
|
/* @__PURE__ */ d(c, {
|
|
59
59
|
path: "species",
|
|
60
|
-
element:
|
|
60
|
+
element: P("ecoimpacthub.page.species", /* @__PURE__ */ d(_, {}))
|
|
61
61
|
}),
|
|
62
62
|
/* @__PURE__ */ d(c, {
|
|
63
63
|
path: "species/:id",
|
|
64
|
-
element:
|
|
64
|
+
element: P("ecoimpacthub.page.species", /* @__PURE__ */ d(v, {}))
|
|
65
65
|
}),
|
|
66
66
|
/* @__PURE__ */ d(c, {
|
|
67
67
|
path: "observations",
|
|
68
|
-
element:
|
|
68
|
+
element: P("ecoimpacthub.page.observations", /* @__PURE__ */ d(y, {}))
|
|
69
69
|
}),
|
|
70
70
|
/* @__PURE__ */ d(c, {
|
|
71
71
|
path: "habitat",
|
|
72
|
-
element:
|
|
72
|
+
element: P("ecoimpacthub.page.habitat", /* @__PURE__ */ d(b, {}))
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ d(c, {
|
|
75
75
|
path: "habitat/:id",
|
|
76
|
-
element:
|
|
76
|
+
element: P("ecoimpacthub.page.habitat", /* @__PURE__ */ d(x, {}))
|
|
77
77
|
}),
|
|
78
78
|
/* @__PURE__ */ d(c, {
|
|
79
79
|
path: "carbon",
|
|
80
|
-
element:
|
|
80
|
+
element: P("ecoimpacthub.page.carbon", /* @__PURE__ */ d(S, {}))
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ d(c, {
|
|
83
|
+
path: "circularity",
|
|
84
|
+
element: P("ecoimpacthub.page.circularity", /* @__PURE__ */ d(C, {}))
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ d(c, {
|
|
87
|
+
path: "metrics",
|
|
88
|
+
element: P("ecoimpacthub.page.metrics", /* @__PURE__ */ d(E, {}))
|
|
81
89
|
}),
|
|
82
90
|
/* @__PURE__ */ d(c, {
|
|
83
91
|
path: "reports",
|
|
84
|
-
element:
|
|
92
|
+
element: P("ecoimpacthub.page.reports", /* @__PURE__ */ d(w, {}))
|
|
85
93
|
}),
|
|
86
94
|
/* @__PURE__ */ d(c, {
|
|
87
95
|
path: "reports/:id",
|
|
88
|
-
element:
|
|
96
|
+
element: P("ecoimpacthub.page.reports", /* @__PURE__ */ d(T, {}))
|
|
89
97
|
}),
|
|
90
98
|
/* @__PURE__ */ d(c, {
|
|
91
99
|
path: "mobile",
|
|
92
|
-
element:
|
|
100
|
+
element: P("ecoimpacthub.page.mobile", /* @__PURE__ */ d(D, {}))
|
|
93
101
|
}),
|
|
94
102
|
/* @__PURE__ */ d(c, {
|
|
95
103
|
path: "mobile/record-observation",
|
|
96
|
-
element:
|
|
104
|
+
element: P("ecoimpacthub.page.observations", /* @__PURE__ */ d(O, {}))
|
|
97
105
|
}),
|
|
98
106
|
/* @__PURE__ */ d(c, {
|
|
99
107
|
path: "*",
|
|
@@ -106,6 +114,6 @@ var N = () => {
|
|
|
106
114
|
})]
|
|
107
115
|
});
|
|
108
116
|
};
|
|
109
|
-
export {
|
|
117
|
+
export { F as EcoImpactHubRoutes };
|
|
110
118
|
|
|
111
119
|
//# sourceMappingURL=EcoImpactHubRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcoImpactHubRoutes.js","names":["SitesPage","lazy","m","SiteDetailPage","MonitoringPage","SpeciesPage","SpeciesDetailPage","ObservationsPage","HabitatProjectsPage","HabitatProjectDetailPage","CarbonPage","ReportsPage","ReportDetailPage","MobileDashboardPage","MobileRecordObservationPage","FieldSyncBridge","useFieldSyncBridge","NATIVE_HOME_KEY","shouldOpenNativeHome","DashboardIndex","openNativeHome","useState","Navigate","DashboardPage","PageLoader","Spinner","gated","FeatureFlagGate","element","EcoImpactHubRoutes","useEcoImpactHub","location","useLocation","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoutes.tsx"],"sourcesContent":["/**\n * EcoImpactHub Routes\n * @module ecoimpacthub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `eco*` backend capability.\n */\n\nimport { type FC, lazy, Suspense, type ReactNode, useState } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useEcoImpactHub } from './context/EcoImpactHubContext';\nimport { FeatureFlagGate } from './components/FeatureFlagGate';\nimport { useFieldSyncBridge } from './field/useFieldQueue';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/DashboardPage';\n\n// Sites (Environmental Monitoring)\nconst SitesPage = lazy(() =>\n import('./pages/sites/SitesPage').then((m) => ({ default: m.SitesPage }))\n);\nconst SiteDetailPage = lazy(() =>\n import('./pages/sites/SiteDetailPage').then((m) => ({ default: m.SiteDetailPage }))\n);\n\n// Monitoring (sensors / measurements / thresholds)\nconst MonitoringPage = lazy(() =>\n import('./pages/monitoring/MonitoringPage').then((m) => ({ default: m.MonitoringPage }))\n);\n\n// Species (Conservation)\nconst SpeciesPage = lazy(() =>\n import('./pages/species/SpeciesPage').then((m) => ({ default: m.SpeciesPage }))\n);\nconst SpeciesDetailPage = lazy(() =>\n import('./pages/species/SpeciesDetailPage').then((m) => ({ default: m.SpeciesDetailPage }))\n);\n\n// Observations (citizen science / field data)\nconst ObservationsPage = lazy(() =>\n import('./pages/observations/ObservationsPage').then((m) => ({ default: m.ObservationsPage }))\n);\n\n// Habitat projects & restoration\nconst HabitatProjectsPage = lazy(() =>\n import('./pages/habitat/HabitatProjectsPage').then((m) => ({ default: m.HabitatProjectsPage }))\n);\nconst HabitatProjectDetailPage = lazy(() =>\n import('./pages/habitat/HabitatProjectDetailPage').then((m) => ({\n default: m.HabitatProjectDetailPage,\n }))\n);\n\n// Carbon ledger / emission factors / reduction targets (Sustainability)\nconst CarbonPage = lazy(() =>\n import('./pages/carbon/CarbonPage').then((m) => ({ default: m.CarbonPage }))\n);\n\n// ESG Reports\nconst ReportsPage = lazy(() =>\n import('./pages/reports/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\nconst ReportDetailPage = lazy(() =>\n import('./pages/reports/ReportDetailPage').then((m) => ({ default: m.ReportDetailPage }))\n);\n\n// Mobile field app (Capacitor iOS/Android home + offline field capture)\nconst MobileDashboardPage = lazy(() =>\n import('./pages/mobile/MobileDashboardPage').then((m) => ({ default: m.MobileDashboardPage }))\n);\nconst MobileRecordObservationPage = lazy(() =>\n import('./pages/mobile/MobileRecordObservationPage').then((m) => ({\n default: m.MobileRecordObservationPage,\n }))\n);\n\n/**\n * Drains the offline field-observation queue for the active workspace while\n * the MFE is mounted, whichever page is showing (see `field/fieldSync.ts`).\n */\nconst FieldSyncBridge: FC = () => {\n useFieldSyncBridge();\n return null;\n};\n\nconst NATIVE_HOME_KEY = 'ecoimpacthub.field.nativeHomeShown';\n\n/**\n * Inside the installed iOS/Android app the first screen of each launch is the\n * field app's mobile dashboard; after that the regular dashboard stays one tap\n * away (sidebar \"Dashboard\"). Capacitor injects `window.Capacitor`, so the MFE\n * needs no Capacitor dependency to detect it.\n */\nfunction shouldOpenNativeHome(): boolean {\n const cap = (globalThis as { Capacitor?: { isNativePlatform?: () => boolean } }).Capacitor;\n if (!cap?.isNativePlatform?.()) return false;\n try {\n if (sessionStorage.getItem(NATIVE_HOME_KEY)) return false;\n sessionStorage.setItem(NATIVE_HOME_KEY, '1');\n } catch {\n // Storage unavailable: still open the field home this time.\n }\n return true;\n}\n\nconst DashboardIndex: FC = () => {\n const [openNativeHome] = useState(shouldOpenNativeHome);\n if (openNativeHome) return <Navigate to=\"mobile\" replace />;\n return <DashboardPage />;\n};\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nfunction gated(flag: string, element: ReactNode): ReactNode {\n return <FeatureFlagGate flag={flag}>{element}</FeatureFlagGate>;\n}\n\nexport const EcoImpactHubRoutes: FC = () => {\n const { basePath, isStandalone } = useEcoImpactHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <FieldSyncBridge />\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={gated('ecoimpacthub.page.dashboard', <DashboardIndex />)} />\n\n <Route path=\"sites\" element={gated('ecoimpacthub.page.sites', <SitesPage />)} />\n <Route path=\"sites/:id\" element={gated('ecoimpacthub.page.sites', <SiteDetailPage />)} />\n\n <Route\n path=\"monitoring\"\n element={gated('ecoimpacthub.page.monitoring', <MonitoringPage />)}\n />\n\n <Route path=\"species\" element={gated('ecoimpacthub.page.species', <SpeciesPage />)} />\n <Route\n path=\"species/:id\"\n element={gated('ecoimpacthub.page.species', <SpeciesDetailPage />)}\n />\n\n <Route\n path=\"observations\"\n element={gated('ecoimpacthub.page.observations', <ObservationsPage />)}\n />\n\n <Route\n path=\"habitat\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectsPage />)}\n />\n <Route\n path=\"habitat/:id\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectDetailPage />)}\n />\n\n <Route path=\"carbon\" element={gated('ecoimpacthub.page.carbon', <CarbonPage />)} />\n\n <Route path=\"reports\" element={gated('ecoimpacthub.page.reports', <ReportsPage />)} />\n <Route\n path=\"reports/:id\"\n element={gated('ecoimpacthub.page.reports', <ReportDetailPage />)}\n />\n\n <Route\n path=\"mobile\"\n element={gated('ecoimpacthub.page.mobile', <MobileDashboardPage />)}\n />\n <Route\n path=\"mobile/record-observation\"\n element={gated('ecoimpacthub.page.observations', <MobileRecordObservationPage />)}\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAmBA,IAAMA,IAAYC,QAChB,OAAO,6BAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,UAAU,EAAE,CAC1E,GACMC,IAAiBF,QACrB,OAAO,kCAA+B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CACpF,GAGME,IAAiBH,QACrB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CACzF,GAGMG,IAAcJ,QAClB,OAAO,iCAA8B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,YAAY,EAAE,CAChF,GACMI,IAAoBL,QACxB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,kBAAkB,EAAE,CAC5F,GAGMK,IAAmBN,QACvB,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAC/F,GAGMM,IAAsBP,QAC1B,OAAO,yCAAsC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,oBAAoB,EAAE,CAChG,GACMO,IAA2BR,QAC/B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAASC,EAAE,yBACb,EAAE,CACJ,GAGMQ,IAAaT,QACjB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,WAAW,EAAE,CAC7E,GAGMS,IAAcV,QAClB,OAAO,iCAA8B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,YAAY,EAAE,CAChF,GACMU,IAAmBX,QACvB,OAAO,sCAAmC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAC1F,GAGMW,IAAsBZ,QAC1B,OAAO,wCAAqC,CAAC,MAAM,OAA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BAA4B,kBAACb,GAAD,CAAsB,CAAA,CAAC;IACnE,CAAA;IACD,kBAACyB,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,kCAAkC,kBAACZ,GAAD,CAA8B,CAAA,CAAC;IACjF,CAAA;IAED,kBAACwB,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAChB,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA,CACP;;AAET"}
|
|
1
|
+
{"version":3,"file":"EcoImpactHubRoutes.js","names":["SitesPage","lazy","m","SiteDetailPage","MonitoringPage","SpeciesPage","SpeciesDetailPage","ObservationsPage","HabitatProjectsPage","HabitatProjectDetailPage","CarbonPage","CircularityPage","ReportsPage","ReportDetailPage","MetricsPage","MobileDashboardPage","MobileRecordObservationPage","FieldSyncBridge","useFieldSyncBridge","NATIVE_HOME_KEY","shouldOpenNativeHome","DashboardIndex","openNativeHome","useState","Navigate","DashboardPage","PageLoader","Spinner","gated","FeatureFlagGate","element","EcoImpactHubRoutes","useEcoImpactHub","location","useLocation","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoutes.tsx"],"sourcesContent":["/**\n * EcoImpactHub Routes\n * @module ecoimpacthub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `eco*` backend capability.\n */\n\nimport { type FC, lazy, Suspense, type ReactNode, useState } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useEcoImpactHub } from './context/EcoImpactHubContext';\nimport { FeatureFlagGate } from './components/FeatureFlagGate';\nimport { useFieldSyncBridge } from './field/useFieldQueue';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/DashboardPage';\n\n// Sites (Environmental Monitoring)\nconst SitesPage = lazy(() =>\n import('./pages/sites/SitesPage').then((m) => ({ default: m.SitesPage }))\n);\nconst SiteDetailPage = lazy(() =>\n import('./pages/sites/SiteDetailPage').then((m) => ({ default: m.SiteDetailPage }))\n);\n\n// Monitoring (sensors / measurements / thresholds)\nconst MonitoringPage = lazy(() =>\n import('./pages/monitoring/MonitoringPage').then((m) => ({ default: m.MonitoringPage }))\n);\n\n// Species (Conservation)\nconst SpeciesPage = lazy(() =>\n import('./pages/species/SpeciesPage').then((m) => ({ default: m.SpeciesPage }))\n);\nconst SpeciesDetailPage = lazy(() =>\n import('./pages/species/SpeciesDetailPage').then((m) => ({ default: m.SpeciesDetailPage }))\n);\n\n// Observations (citizen science / field data)\nconst ObservationsPage = lazy(() =>\n import('./pages/observations/ObservationsPage').then((m) => ({ default: m.ObservationsPage }))\n);\n\n// Habitat projects & restoration\nconst HabitatProjectsPage = lazy(() =>\n import('./pages/habitat/HabitatProjectsPage').then((m) => ({ default: m.HabitatProjectsPage }))\n);\nconst HabitatProjectDetailPage = lazy(() =>\n import('./pages/habitat/HabitatProjectDetailPage').then((m) => ({\n default: m.HabitatProjectDetailPage,\n }))\n);\n\n// Carbon ledger / emission factors / reduction targets (Sustainability)\nconst CarbonPage = lazy(() =>\n import('./pages/carbon/CarbonPage').then((m) => ({ default: m.CarbonPage }))\n);\n\n// ESG Reports\n// Waste & circularity — waste streams, diversion tracking, material loops (BOFF-5830)\nconst CircularityPage = lazy(() =>\n import('./pages/circularity/CircularityPage').then((m) => ({ default: m.CircularityPage }))\n);\n\nconst ReportsPage = lazy(() =>\n import('./pages/reports/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\nconst ReportDetailPage = lazy(() =>\n import('./pages/reports/ReportDetailPage').then((m) => ({ default: m.ReportDetailPage }))\n);\n\n// Environmental metrics library (cross-product rollups)\nconst MetricsPage = lazy(() =>\n import('./pages/metrics/MetricsPage').then((m) => ({ default: m.MetricsPage }))\n);\n\n// Mobile field app (Capacitor iOS/Android home + offline field capture)\nconst MobileDashboardPage = lazy(() =>\n import('./pages/mobile/MobileDashboardPage').then((m) => ({ default: m.MobileDashboardPage }))\n);\nconst MobileRecordObservationPage = lazy(() =>\n import('./pages/mobile/MobileRecordObservationPage').then((m) => ({\n default: m.MobileRecordObservationPage,\n }))\n);\n\n/**\n * Drains the offline field-observation queue for the active workspace while\n * the MFE is mounted, whichever page is showing (see `field/fieldSync.ts`).\n */\nconst FieldSyncBridge: FC = () => {\n useFieldSyncBridge();\n return null;\n};\n\nconst NATIVE_HOME_KEY = 'ecoimpacthub.field.nativeHomeShown';\n\n/**\n * Inside the installed iOS/Android app the first screen of each launch is the\n * field app's mobile dashboard; after that the regular dashboard stays one tap\n * away (sidebar \"Dashboard\"). Capacitor injects `window.Capacitor`, so the MFE\n * needs no Capacitor dependency to detect it.\n */\nfunction shouldOpenNativeHome(): boolean {\n const cap = (globalThis as { Capacitor?: { isNativePlatform?: () => boolean } }).Capacitor;\n if (!cap?.isNativePlatform?.()) return false;\n try {\n if (sessionStorage.getItem(NATIVE_HOME_KEY)) return false;\n sessionStorage.setItem(NATIVE_HOME_KEY, '1');\n } catch {\n // Storage unavailable: still open the field home this time.\n }\n return true;\n}\n\nconst DashboardIndex: FC = () => {\n const [openNativeHome] = useState(shouldOpenNativeHome);\n if (openNativeHome) return <Navigate to=\"mobile\" replace />;\n return <DashboardPage />;\n};\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nfunction gated(flag: string, element: ReactNode): ReactNode {\n return <FeatureFlagGate flag={flag}>{element}</FeatureFlagGate>;\n}\n\nexport const EcoImpactHubRoutes: FC = () => {\n const { basePath, isStandalone } = useEcoImpactHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <FieldSyncBridge />\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={gated('ecoimpacthub.page.dashboard', <DashboardIndex />)} />\n\n <Route path=\"sites\" element={gated('ecoimpacthub.page.sites', <SitesPage />)} />\n <Route path=\"sites/:id\" element={gated('ecoimpacthub.page.sites', <SiteDetailPage />)} />\n\n <Route\n path=\"monitoring\"\n element={gated('ecoimpacthub.page.monitoring', <MonitoringPage />)}\n />\n\n <Route path=\"species\" element={gated('ecoimpacthub.page.species', <SpeciesPage />)} />\n <Route\n path=\"species/:id\"\n element={gated('ecoimpacthub.page.species', <SpeciesDetailPage />)}\n />\n\n <Route\n path=\"observations\"\n element={gated('ecoimpacthub.page.observations', <ObservationsPage />)}\n />\n\n <Route\n path=\"habitat\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectsPage />)}\n />\n <Route\n path=\"habitat/:id\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectDetailPage />)}\n />\n\n <Route path=\"carbon\" element={gated('ecoimpacthub.page.carbon', <CarbonPage />)} />\n\n <Route\n path=\"circularity\"\n element={gated('ecoimpacthub.page.circularity', <CircularityPage />)}\n />\n\n <Route path=\"metrics\" element={gated('ecoimpacthub.page.metrics', <MetricsPage />)} />\n\n <Route path=\"reports\" element={gated('ecoimpacthub.page.reports', <ReportsPage />)} />\n <Route\n path=\"reports/:id\"\n element={gated('ecoimpacthub.page.reports', <ReportDetailPage />)}\n />\n\n <Route\n path=\"mobile\"\n element={gated('ecoimpacthub.page.mobile', <MobileDashboardPage />)}\n />\n <Route\n path=\"mobile/record-observation\"\n element={gated('ecoimpacthub.page.observations', <MobileRecordObservationPage />)}\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAmBA,IAAMA,IAAYC,QAChB,OAAO,6BAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EA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kBAAC4B,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,6BAA6B,kBAACf,GAAD,CAAmB,CAAA,CAAC;IACjE,CAAA;IAED,kBAAC2B,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,4BAA4B,kBAACb,GAAD,CAAsB,CAAA,CAAC;IACnE,CAAA;IACD,kBAACyB,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,kCAAkC,kBAACZ,GAAD,CAA8B,CAAA,CAAC;IACjF,CAAA;IAED,kBAACwB,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAChB,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA,CACP;;AAET"}
|
|
@@ -61,6 +61,24 @@ var i = {
|
|
|
61
61
|
SCOPE_1: "destructive",
|
|
62
62
|
SCOPE_2: "warning",
|
|
63
63
|
SCOPE_3: "info",
|
|
64
|
+
GENERAL: "secondary",
|
|
65
|
+
RECYCLABLES: "info",
|
|
66
|
+
ORGANIC: "success",
|
|
67
|
+
HAZARDOUS: "destructive",
|
|
68
|
+
ELECTRONIC: "info",
|
|
69
|
+
CONSTRUCTION_DEMOLITION: "warning",
|
|
70
|
+
TEXTILES: "info",
|
|
71
|
+
PACKAGING: "info",
|
|
72
|
+
LANDFILL: "destructive",
|
|
73
|
+
RECYCLED: "success",
|
|
74
|
+
COMPOSTED: "success",
|
|
75
|
+
RECOVERED: "info",
|
|
76
|
+
REUSED: "success",
|
|
77
|
+
OTHER: "secondary",
|
|
78
|
+
INPUT: "info",
|
|
79
|
+
USE: "secondary",
|
|
80
|
+
RECOVERY: "warning",
|
|
81
|
+
REUSE: "success",
|
|
64
82
|
GHG_PROTOCOL: "outline",
|
|
65
83
|
GRI: "outline",
|
|
66
84
|
TCFD: "outline",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":["variantStyles","liveStatuses","statusVariantMap","StatusBadge","key","status","variant","isLive","cn","className","formatEnumLabel"],"sources":["../../../src/ecoimpacthub/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module ecoimpacthub/components\n *\n * A colored badge for EcoImpactHub domain statuses (site status, sensor status,\n * threshold severity, conservation status, habitat-project lifecycle, carbon\n * entry status, reduction-target status, report status/framework, emission\n * scope) with semantic color mapping. Accepts the raw server enum value.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses that represent a \"live\" / in-progress condition get a subtle,\n// opacity-only glow pulse (reduced-motion safe via motion-safe:).\nconst liveStatuses = new Set(['IN_PROGRESS', 'ONLINE', 'ACTIVE']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Site status\n ACTIVE: 'success',\n MONITORING_PAUSED: 'warning',\n ARCHIVED: 'outline',\n\n // Sensor status\n ONLINE: 'success',\n OFFLINE: 'destructive',\n DEGRADED: 'warning',\n MAINTENANCE: 'info',\n RETIRED: 'outline',\n\n // Threshold severity / generic severity\n INFO: 'secondary',\n WARNING: 'warning',\n CRITICAL: 'destructive',\n\n // Threshold direction\n ABOVE: 'warning',\n BELOW: 'info',\n OUTSIDE_RANGE: 'warning',\n\n // Measurement / breach\n BREACH: 'destructive',\n OK: 'success',\n\n // AI alert triage classification + anomaly kinds\n REAL_EVENT: 'destructive',\n SENSOR_FAULT: 'warning',\n INSUFFICIENT_DATA: 'secondary',\n SPIKE: 'warning',\n DROP: 'info',\n FLATLINE: 'secondary',\n\n // Conservation status (IUCN-style)\n LEAST_CONCERN: 'success',\n NEAR_THREATENED: 'info',\n VULNERABLE: 'warning',\n ENDANGERED: 'destructive',\n CRITICALLY_ENDANGERED: 'destructive',\n EXTINCT_IN_WILD: 'outline',\n DATA_DEFICIENT: 'secondary',\n NOT_EVALUATED: 'secondary',\n\n // Habitat-project lifecycle\n PLANNED: 'secondary',\n MONITORING: 'info',\n COMPLETED: 'success',\n ON_HOLD: 'warning',\n CANCELLED: 'destructive',\n\n // Carbon-entry status\n DRAFT: 'secondary',\n RECORDED: 'info',\n VERIFIED: 'success',\n ADJUSTED: 'warning',\n\n // Report status\n IN_REVIEW: 'warning',\n PUBLISHED: 'success',\n\n // Reduction-target status\n PROPOSED: 'secondary',\n ACHIEVED: 'success',\n MISSED: 'destructive',\n\n // Emission scope\n SCOPE_1: 'destructive',\n SCOPE_2: 'warning',\n SCOPE_3: 'info',\n\n // Report frameworks (neutral badges)\n GHG_PROTOCOL: 'outline',\n GRI: 'outline',\n TCFD: 'outline',\n CDP: 'outline',\n SASB: 'outline',\n CSRD: 'outline',\n ISSB: 'outline',\n EU_TAXONOMY: 'outline',\n CUSTOM: 'secondary',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAqBA,IAAMA,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAIMC,oBAAe,IAAI,IAAI;CAAC;CAAe;CAAU;AAAQ,CAAC,GAE1DC,IAAiD;CAErD,QAAQ;CACR,mBAAmB;CACnB,UAAU;CAGV,QAAQ;CACR,SAAS;CACT,UAAU;CACV,aAAa;CACb,SAAS;CAGT,MAAM;CACN,SAAS;CACT,UAAU;CAGV,OAAO;CACP,OAAO;CACP,eAAe;CAGf,QAAQ;CACR,IAAI;CAGJ,YAAY;CACZ,cAAc;CACd,mBAAmB;CACnB,OAAO;CACP,MAAM;CACN,UAAU;CAGV,eAAe;CACf,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,uBAAuB;CACvB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CAGf,SAAS;CACT,YAAY;CACZ,WAAW;CACX,SAAS;CACT,WAAW;CAGX,OAAO;CACP,UAAU;CACV,UAAU;CACV,UAAU;CAGV,WAAW;CACX,WAAW;CAGX,UAAU;CACV,UAAU;CACV,QAAQ;CAGR,SAAS;CACT,SAAS;CACT,SAAS;CAGT,cAAc;CACd,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;CACN,MAAM;CACN,aAAa;CACb,QAAQ;AACV,GAEaC,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAMC,IAAMC,EAAO,YAAY,GACzBC,IAAUJ,EAAiBE,MAAQ,aACnCG,IAASN,EAAa,IAAIG,CAAG;CAEnC,OACE,kBAAC,QAAD;EACE,WAAWI,EACT,mFACAR,EAAcM,IACdG,CACF;EALF,UAAA,CAOGF,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA,GAEFG,EAAgBL,CAAM,CACnB;;AAEV"}
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":["variantStyles","liveStatuses","statusVariantMap","StatusBadge","key","status","variant","isLive","cn","className","formatEnumLabel"],"sources":["../../../src/ecoimpacthub/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module ecoimpacthub/components\n *\n * A colored badge for EcoImpactHub domain statuses (site status, sensor status,\n * threshold severity, conservation status, habitat-project lifecycle, carbon\n * entry status, reduction-target status, report status/framework, emission\n * scope) with semantic color mapping. Accepts the raw server enum value.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses that represent a \"live\" / in-progress condition get a subtle,\n// opacity-only glow pulse (reduced-motion safe via motion-safe:).\nconst liveStatuses = new Set(['IN_PROGRESS', 'ONLINE', 'ACTIVE']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Site status\n ACTIVE: 'success',\n MONITORING_PAUSED: 'warning',\n ARCHIVED: 'outline',\n\n // Sensor status\n ONLINE: 'success',\n OFFLINE: 'destructive',\n DEGRADED: 'warning',\n MAINTENANCE: 'info',\n RETIRED: 'outline',\n\n // Threshold severity / generic severity\n INFO: 'secondary',\n WARNING: 'warning',\n CRITICAL: 'destructive',\n\n // Threshold direction\n ABOVE: 'warning',\n BELOW: 'info',\n OUTSIDE_RANGE: 'warning',\n\n // Measurement / breach\n BREACH: 'destructive',\n OK: 'success',\n\n // AI alert triage classification + anomaly kinds\n REAL_EVENT: 'destructive',\n SENSOR_FAULT: 'warning',\n INSUFFICIENT_DATA: 'secondary',\n SPIKE: 'warning',\n DROP: 'info',\n FLATLINE: 'secondary',\n\n // Conservation status (IUCN-style)\n LEAST_CONCERN: 'success',\n NEAR_THREATENED: 'info',\n VULNERABLE: 'warning',\n ENDANGERED: 'destructive',\n CRITICALLY_ENDANGERED: 'destructive',\n EXTINCT_IN_WILD: 'outline',\n DATA_DEFICIENT: 'secondary',\n NOT_EVALUATED: 'secondary',\n\n // Habitat-project lifecycle\n PLANNED: 'secondary',\n MONITORING: 'info',\n COMPLETED: 'success',\n ON_HOLD: 'warning',\n CANCELLED: 'destructive',\n\n // Carbon-entry status\n DRAFT: 'secondary',\n RECORDED: 'info',\n VERIFIED: 'success',\n ADJUSTED: 'warning',\n\n // Report status\n IN_REVIEW: 'warning',\n PUBLISHED: 'success',\n\n // Reduction-target status\n PROPOSED: 'secondary',\n ACHIEVED: 'success',\n MISSED: 'destructive',\n\n // Emission scope\n SCOPE_1: 'destructive',\n SCOPE_2: 'warning',\n SCOPE_3: 'info',\n\n // Waste categories (BOFF-5830) — informational, neutral badges\n GENERAL: 'secondary',\n RECYCLABLES: 'info',\n ORGANIC: 'success',\n HAZARDOUS: 'destructive',\n ELECTRONIC: 'info',\n CONSTRUCTION_DEMOLITION: 'warning',\n TEXTILES: 'info',\n PACKAGING: 'info',\n\n // Waste disposal routes (BOFF-5830): diverted routes read green/blue,\n // landfill reads red, OTHER stays neutral.\n LANDFILL: 'destructive',\n RECYCLED: 'success',\n COMPOSTED: 'success',\n RECOVERED: 'info',\n REUSED: 'success',\n OTHER: 'secondary',\n\n // Material-loop stages (BOFF-5830)\n INPUT: 'info',\n USE: 'secondary',\n RECOVERY: 'warning',\n REUSE: 'success',\n\n // Report frameworks (neutral badges)\n GHG_PROTOCOL: 'outline',\n GRI: 'outline',\n TCFD: 'outline',\n CDP: 'outline',\n SASB: 'outline',\n CSRD: 'outline',\n ISSB: 'outline',\n EU_TAXONOMY: 'outline',\n CUSTOM: 'secondary',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAqBA,IAAMA,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAIMC,oBAAe,IAAI,IAAI;CAAC;CAAe;CAAU;AAAQ,CAAC,GAE1DC,IAAiD;CAErD,QAAQ;CACR,mBAAmB;CACnB,UAAU;CAGV,QAAQ;CACR,SAAS;CACT,UAAU;CACV,aAAa;CACb,SAAS;CAGT,MAAM;CACN,SAAS;CACT,UAAU;CAGV,OAAO;CACP,OAAO;CACP,eAAe;CAGf,QAAQ;CACR,IAAI;CAGJ,YAAY;CACZ,cAAc;CACd,mBAAmB;CACnB,OAAO;CACP,MAAM;CACN,UAAU;CAGV,eAAe;CACf,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,uBAAuB;CACvB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CAGf,SAAS;CACT,YAAY;CACZ,WAAW;CACX,SAAS;CACT,WAAW;CAGX,OAAO;CACP,UAAU;CACV,UAAU;CACV,UAAU;CAGV,WAAW;CACX,WAAW;CAGX,UAAU;CACV,UAAU;CACV,QAAQ;CAGR,SAAS;CACT,SAAS;CACT,SAAS;CAGT,SAAS;CACT,aAAa;CACb,SAAS;CACT,WAAW;CACX,YAAY;CACZ,yBAAyB;CACzB,UAAU;CACV,WAAW;CAIX,UAAU;CACV,UAAU;CACV,WAAW;CACX,WAAW;CACX,QAAQ;CACR,OAAO;CAGP,OAAO;CACP,KAAK;CACL,UAAU;CACV,OAAO;CAGP,cAAc;CACd,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;CACN,MAAM;CACN,aAAa;CACb,QAAQ;AACV,GAEaC,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAMC,IAAMC,EAAO,YAAY,GACzBC,IAAUJ,EAAiBE,MAAQ,aACnCG,IAASN,EAAa,IAAIG,CAAG;CAEnC,OACE,kBAAC,QAAD;EACE,WAAWI,EACT,mFACAR,EAAcM,IACdG,CACF;EALF,UAAA,CAOGF,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA,GAEFG,EAAgBL,CAAM,CACnB;;AAEV"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useEcoAcceptCarbonEntryDraft as e, useEcoAddReportLineItem as t, useEcoAiDraftCarbonEntries as n, useEcoAiSuggestEmissionFactor as r, useEcoApproveReport as i,
|
|
2
|
-
import { useCursorPager as
|
|
3
|
-
import { uploadEcoFile as
|
|
4
|
-
import { useEcoComments as
|
|
5
|
-
import { useEcoAssignTag as
|
|
6
|
-
import { DASHBOARD_WIDGET_DEFS as
|
|
7
|
-
import { useActiveEcoEntity as
|
|
8
|
-
import { useTr as
|
|
9
|
-
import { ECO_AI_DETECT_ANOMALIES_QUERY as
|
|
10
|
-
export {
|
|
1
|
+
import { useEcoAcceptCarbonEntryDraft as e, useEcoAddReportLineItem as t, useEcoAiDraftCarbonEntries as n, useEcoAiSuggestEmissionFactor as r, useEcoApproveReport as i, useEcoArchiveMaterialLoop as a, useEcoArchiveSite as o, useEcoArchiveSpecies as s, useEcoArchiveWasteStream as c, useEcoCarbonEntries as l, useEcoCarbonTotals as u, useEcoCreateEmissionFactor as d, useEcoCreateHabitatProject as f, useEcoCreateMaterialLoop as p, useEcoCreateReductionTarget as m, useEcoCreateReport as h, useEcoCreateSensor as g, useEcoCreateSite as _, useEcoCreateSpecies as v, useEcoCreateThreshold as y, useEcoCreateWasteStream as b, useEcoDeleteMaterialLoopFlow as x, useEcoDeleteWasteRecord as S, useEcoEmissionFactors as C, useEcoHabitatProject as w, useEcoHabitatProjects as T, useEcoLogRestorationActivity as E, useEcoMaterialLoopFlows as D, useEcoMaterialLoopSummary as O, useEcoMaterialLoops as k, useEcoMeasurements as A, useEcoMetric as j, useEcoMetricRollups as M, useEcoMetrics as N, useEcoObservations as P, useEcoPublishReport as F, useEcoRecordCarbonEntry as I, useEcoRecordMaterialLoopFlow as L, useEcoRecordMeasurement as R, useEcoRecordObservation as z, useEcoRecordWaste as B, useEcoReductionTargets as V, useEcoRejectCarbonEntryDraft as H, useEcoRejectReport as U, useEcoReport as W, useEcoReports as G, useEcoSensors as K, useEcoSetReductionTargetStatus as q, useEcoSetSensorStatus as J, useEcoSetThresholdActive as Y, useEcoSite as X, useEcoSites as Z, useEcoSpecies as Q, useEcoSpeciesDetail as $, useEcoSubmitReportForApproval as ee, useEcoThresholds as te, useEcoTransitionHabitatProject as ne, useEcoUpdateSpecies as re, useEcoVerifyCarbonEntry as ie, useEcoWasteDiversionSummary as ae, useEcoWasteRecords as oe, useEcoWasteStreams as se } from "./useEcoImpactHubApi.js";
|
|
2
|
+
import { useCursorPager as ce } from "./useCursorPager.js";
|
|
3
|
+
import { uploadEcoFile as le, useEcoFile as ue, useEcoFileUpload as de, wspaceFetch as fe } from "./useEcoFiles.js";
|
|
4
|
+
import { useEcoComments as pe, useEcoCreateComment as me } from "./useEcoComments.js";
|
|
5
|
+
import { useEcoAssignTag as he, useEcoCreateAndAssignTag as ge, useEcoEntityTags as _e, useEcoRemoveTagAssignment as ve, useEcoTagSearch as ye } from "./useEcoTags.js";
|
|
6
|
+
import { DASHBOARD_WIDGET_DEFS as be, useDashboardLayout as xe } from "./useDashboardLayout.js";
|
|
7
|
+
import { useActiveEcoEntity as Se } from "./useActiveEcoEntity.js";
|
|
8
|
+
import { useTr as Ce } from "./useTr.js";
|
|
9
|
+
import { ECO_AI_DETECT_ANOMALIES_QUERY as we, ECO_AI_PROPOSE_THRESHOLD_MUTATION as Te, ECO_AI_TRIAGE_ALERT_MUTATION as Ee, useEcoAiDetectAnomalies as De, useEcoAiErrorReporter as Oe, useEcoAiProposeThreshold as ke, useEcoAiTriageAlert as Ae } from "./useEcoAiMonitoring.js";
|
|
10
|
+
export { be as DASHBOARD_WIDGET_DEFS, we as ECO_AI_DETECT_ANOMALIES_QUERY, Te as ECO_AI_PROPOSE_THRESHOLD_MUTATION, Ee as ECO_AI_TRIAGE_ALERT_MUTATION, le as uploadEcoFile, Se as useActiveEcoEntity, ce as useCursorPager, xe as useDashboardLayout, e as useEcoAcceptCarbonEntryDraft, t as useEcoAddReportLineItem, De as useEcoAiDetectAnomalies, n as useEcoAiDraftCarbonEntries, Oe as useEcoAiErrorReporter, ke as useEcoAiProposeThreshold, r as useEcoAiSuggestEmissionFactor, Ae as useEcoAiTriageAlert, i as useEcoApproveReport, a as useEcoArchiveMaterialLoop, o as useEcoArchiveSite, s as useEcoArchiveSpecies, c as useEcoArchiveWasteStream, he as useEcoAssignTag, l as useEcoCarbonEntries, u as useEcoCarbonTotals, pe as useEcoComments, ge as useEcoCreateAndAssignTag, me as useEcoCreateComment, d as useEcoCreateEmissionFactor, f as useEcoCreateHabitatProject, p as useEcoCreateMaterialLoop, m as useEcoCreateReductionTarget, h as useEcoCreateReport, g as useEcoCreateSensor, _ as useEcoCreateSite, v as useEcoCreateSpecies, y as useEcoCreateThreshold, b as useEcoCreateWasteStream, x as useEcoDeleteMaterialLoopFlow, S as useEcoDeleteWasteRecord, C as useEcoEmissionFactors, _e as useEcoEntityTags, ue as useEcoFile, de as useEcoFileUpload, w as useEcoHabitatProject, T as useEcoHabitatProjects, E as useEcoLogRestorationActivity, D as useEcoMaterialLoopFlows, O as useEcoMaterialLoopSummary, k as useEcoMaterialLoops, A as useEcoMeasurements, j as useEcoMetric, M as useEcoMetricRollups, N as useEcoMetrics, P as useEcoObservations, F as useEcoPublishReport, I as useEcoRecordCarbonEntry, L as useEcoRecordMaterialLoopFlow, R as useEcoRecordMeasurement, z as useEcoRecordObservation, B as useEcoRecordWaste, V as useEcoReductionTargets, H as useEcoRejectCarbonEntryDraft, U as useEcoRejectReport, ve as useEcoRemoveTagAssignment, W as useEcoReport, G as useEcoReports, K as useEcoSensors, q as useEcoSetReductionTargetStatus, J as useEcoSetSensorStatus, Y as useEcoSetThresholdActive, X as useEcoSite, Z as useEcoSites, Q as useEcoSpecies, $ as useEcoSpeciesDetail, ee as useEcoSubmitReportForApproval, ye as useEcoTagSearch, te as useEcoThresholds, ne as useEcoTransitionHabitatProject, re as useEcoUpdateSpecies, ie as useEcoVerifyCarbonEntry, ae as useEcoWasteDiversionSummary, oe as useEcoWasteRecords, se as useEcoWasteStreams, Ce as useTr, fe as wspaceFetch };
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import { EcoConnection, EcoSite, EcoSiteStatus, EcoSiteType, EcoSensor, EcoSensorKind, EcoSensorStatus, EcoMeasurement, EcoAlertThreshold, EcoSpecies, EcoTaxonGroup, EcoConservationStatus, EcoObservation, EcoHabitatProject, EcoHabitatProjectStatus, EcoRestorationActivity, EcoEmissionFactor, EcoEmissionScope, EcoCarbonEntry, EcoCarbonEntryStatus, EcoReductionTarget, EcoReductionTargetStatus, EcoReport, EcoReportStatus, EcoReportLineItem, EcoCreateSiteInput, EcoUpdateSiteInput, EcoCreateSensorInput, EcoRecordMeasurementInput, EcoCreateThresholdInput, EcoCreateSpeciesInput, EcoUpdateSpeciesInput, EcoRecordObservationInput, EcoCreateHabitatProjectInput, EcoLogRestorationActivityInput, EcoCreateEmissionFactorInput, EcoRecordCarbonEntryInput, EcoCreateReductionTargetInput, EcoCreateReportInput, EcoAddReportLineItemInput, EcoRejectReportInput, EcoAiDraftBatch, EcoAiDraftCarbonEntriesInput, EcoAiFactorSuggestion, EcoAiSuggestEmissionFactorInput, PaginationInput } from '../types';
|
|
1
|
+
import { EcoConnection, EcoSite, EcoSiteStatus, EcoSiteType, EcoSensor, EcoSensorKind, EcoSensorStatus, EcoMeasurement, EcoAlertThreshold, EcoSpecies, EcoTaxonGroup, EcoConservationStatus, EcoObservation, EcoHabitatProject, EcoHabitatProjectStatus, EcoRestorationActivity, EcoEmissionFactor, EcoEmissionScope, EcoCarbonEntry, EcoCarbonEntryStatus, EcoReductionTarget, EcoReductionTargetStatus, EcoReport, EcoReportStatus, EcoReportLineItem, EcoCreateSiteInput, EcoUpdateSiteInput, EcoCreateSensorInput, EcoRecordMeasurementInput, EcoCreateThresholdInput, EcoCreateSpeciesInput, EcoUpdateSpeciesInput, EcoRecordObservationInput, EcoCreateHabitatProjectInput, EcoLogRestorationActivityInput, EcoCreateEmissionFactorInput, EcoRecordCarbonEntryInput, EcoCreateReductionTargetInput, EcoCreateReportInput, EcoAddReportLineItemInput, EcoRejectReportInput, EcoAiDraftBatch, EcoAiDraftCarbonEntriesInput, EcoAiFactorSuggestion, EcoAiSuggestEmissionFactorInput, EcoMetric, EcoMetricRollup, PaginationInput, EcoWasteStream, EcoWasteRecord, EcoWasteRoute, EcoWasteDiversionSummary, EcoMaterialLoop, EcoMaterialLoopFlow, EcoMaterialLoopStage, EcoMaterialLoopSummary, EcoCreateWasteStreamInput, EcoUpdateWasteStreamInput, EcoRecordWasteInput, EcoCreateMaterialLoopInput, EcoUpdateMaterialLoopInput, EcoRecordMaterialLoopFlowInput } from '../types';
|
|
2
|
+
/** Filter set shared by the metrics library list and the rollup view. */
|
|
3
|
+
export interface EcoMetricFilters {
|
|
4
|
+
category?: string;
|
|
5
|
+
metricKey?: string;
|
|
6
|
+
sourceProduct?: string;
|
|
7
|
+
periodStart?: string;
|
|
8
|
+
periodEnd?: string;
|
|
9
|
+
pagination?: PaginationInput;
|
|
10
|
+
}
|
|
2
11
|
export interface SiteFilters {
|
|
3
12
|
status?: EcoSiteStatus;
|
|
4
13
|
type?: EcoSiteType;
|
|
@@ -118,3 +127,48 @@ export declare const useEcoPublishReport: () => import('@tanstack/react-query').
|
|
|
118
127
|
export declare const useEcoSubmitReportForApproval: () => import('@tanstack/react-query').UseMutationResult<EcoReport, Error, string, unknown>;
|
|
119
128
|
export declare const useEcoApproveReport: () => import('@tanstack/react-query').UseMutationResult<EcoReport, Error, string, unknown>;
|
|
120
129
|
export declare const useEcoRejectReport: () => import('@tanstack/react-query').UseMutationResult<EcoReport, Error, EcoRejectReportInput, unknown>;
|
|
130
|
+
export declare const useEcoMetrics: (filters?: EcoMetricFilters) => import('@tanstack/react-query').UseQueryResult<EcoConnection<EcoMetric>, Error>;
|
|
131
|
+
export declare const useEcoMetric: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<EcoMetric | null, Error>;
|
|
132
|
+
export declare const useEcoMetricRollups: (filters?: Omit<EcoMetricFilters, "pagination">) => import('@tanstack/react-query').UseQueryResult<EcoMetricRollup[], Error>;
|
|
133
|
+
export declare const useEcoWasteStreams: (filters?: {
|
|
134
|
+
siteId?: string | null;
|
|
135
|
+
activeOnly?: boolean;
|
|
136
|
+
}) => import('@tanstack/react-query').UseQueryResult<EcoConnection<EcoWasteStream>, Error>;
|
|
137
|
+
export declare const useEcoCreateWasteStream: () => import('@tanstack/react-query').UseMutationResult<EcoWasteStream, Error, EcoCreateWasteStreamInput, unknown>;
|
|
138
|
+
export declare const useEcoUpdateWasteStream: () => import('@tanstack/react-query').UseMutationResult<EcoWasteStream, Error, {
|
|
139
|
+
id: string;
|
|
140
|
+
input: EcoUpdateWasteStreamInput;
|
|
141
|
+
}, unknown>;
|
|
142
|
+
export declare const useEcoArchiveWasteStream: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
143
|
+
export declare const useEcoWasteRecords: (filters?: {
|
|
144
|
+
streamId?: string | null;
|
|
145
|
+
route?: EcoWasteRoute | null;
|
|
146
|
+
pagination?: PaginationInput;
|
|
147
|
+
}) => import('@tanstack/react-query').UseQueryResult<EcoConnection<EcoWasteRecord>, Error>;
|
|
148
|
+
export declare const useEcoRecordWaste: () => import('@tanstack/react-query').UseMutationResult<EcoWasteRecord, Error, EcoRecordWasteInput, unknown>;
|
|
149
|
+
export declare const useEcoDeleteWasteRecord: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
150
|
+
export declare const useEcoWasteDiversionSummary: (filters?: {
|
|
151
|
+
streamId?: string | null;
|
|
152
|
+
siteId?: string | null;
|
|
153
|
+
periodStart?: string | null;
|
|
154
|
+
periodEnd?: string | null;
|
|
155
|
+
}) => import('@tanstack/react-query').UseQueryResult<EcoWasteDiversionSummary, Error>;
|
|
156
|
+
export declare const useEcoMaterialLoops: (filters?: {
|
|
157
|
+
activeOnly?: boolean;
|
|
158
|
+
}) => import('@tanstack/react-query').UseQueryResult<EcoConnection<EcoMaterialLoop>, Error>;
|
|
159
|
+
export declare const useEcoCreateMaterialLoop: () => import('@tanstack/react-query').UseMutationResult<EcoMaterialLoop, Error, EcoCreateMaterialLoopInput, unknown>;
|
|
160
|
+
export declare const useEcoUpdateMaterialLoop: () => import('@tanstack/react-query').UseMutationResult<EcoMaterialLoop, Error, {
|
|
161
|
+
id: string;
|
|
162
|
+
input: EcoUpdateMaterialLoopInput;
|
|
163
|
+
}, unknown>;
|
|
164
|
+
export declare const useEcoArchiveMaterialLoop: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
165
|
+
export declare const useEcoMaterialLoopFlows: (filters?: {
|
|
166
|
+
loopId?: string | null;
|
|
167
|
+
stage?: EcoMaterialLoopStage | null;
|
|
168
|
+
}) => import('@tanstack/react-query').UseQueryResult<EcoConnection<EcoMaterialLoopFlow>, Error>;
|
|
169
|
+
export declare const useEcoRecordMaterialLoopFlow: () => import('@tanstack/react-query').UseMutationResult<EcoMaterialLoopFlow, Error, EcoRecordMaterialLoopFlowInput, unknown>;
|
|
170
|
+
export declare const useEcoDeleteMaterialLoopFlow: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, {
|
|
171
|
+
id: string;
|
|
172
|
+
loopId: string;
|
|
173
|
+
}, unknown>;
|
|
174
|
+
export declare const useEcoMaterialLoopSummary: (loopId: string | null) => import('@tanstack/react-query').UseQueryResult<EcoMaterialLoopSummary, Error>;
|