@burdenoff/microfe-export 2026.1124.2 → 2026.1125.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/ExportRoutes.js +62 -57
- package/dist/export/ExportRoutes.js.map +1 -1
- package/dist/export/components/ConfirmDestructiveDialog.js +18 -14
- package/dist/export/components/ConfirmDestructiveDialog.js.map +1 -1
- package/dist/export/components/DownloadStatus.js +14 -10
- package/dist/export/components/DownloadStatus.js.map +1 -1
- package/dist/export/components/ExportProgressBar.d.ts +3 -1
- package/dist/export/components/ExportProgressBar.js +23 -11
- package/dist/export/components/ExportProgressBar.js.map +1 -1
- package/dist/export/components/loadingSystem.d.ts +64 -0
- package/dist/export/components/loadingSystem.js +49 -0
- package/dist/export/components/loadingSystem.js.map +1 -0
- package/dist/export/hooks/exportBackgroundTask.d.ts +18 -0
- package/dist/export/hooks/exportBackgroundTask.js +46 -0
- package/dist/export/hooks/exportBackgroundTask.js.map +1 -0
- package/dist/export/hooks/useExportQueries.js +140 -124
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/pages/CreateExportPage.js +29 -27
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDashboardPage.js +114 -113
- package/dist/export/pages/ExportDashboardPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.js +104 -98
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/pages/ExportHistoryPage.js +150 -149
- package/dist/export/pages/ExportHistoryPage.js.map +1 -1
- package/dist/export/pages/ExportTemplatesPage.js +156 -154
- package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
- package/dist/export/pages/TemplateDetailPage.js +142 -136
- package/dist/export/pages/TemplateDetailPage.js.map +1 -1
- package/dist/export/pages/v2/DownloadDetailPage.js +108 -103
- package/dist/export/pages/v2/DownloadDetailPage.js.map +1 -1
- package/dist/export/pages/v2/DownloadsPage.js +153 -152
- package/dist/export/pages/v2/DownloadsPage.js.map +1 -1
- package/dist/export/pages/v2/NewDownloadPage.js +142 -138
- package/dist/export/pages/v2/NewDownloadPage.js.map +1 -1
- package/dist/export/workspace-v2/DownloadCells.js +32 -20
- package/dist/export/workspace-v2/DownloadCells.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,49 +2,54 @@ import { useTr as e } from "./hooks/useTr.js";
|
|
|
2
2
|
import { useExport as t } from "./providers/ExportProvider.js";
|
|
3
3
|
import { useNavigationV2 as n } from "./navigation-v2/NavigationV2.js";
|
|
4
4
|
import { ExportLandingPage as r } from "./pages/ExportLandingPage.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { SectionLoaderOr as i, SpinnerIcon as a } from "./components/loadingSystem.js";
|
|
6
|
+
import { Component as o, Suspense as s, lazy as c } from "react";
|
|
7
|
+
import { AlertTriangle as l, RefreshCw as u } from "lucide-react";
|
|
8
|
+
import { FeatureGate as d } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
9
|
+
import { Navigate as f, Route as p, Routes as m, useSearchParams as h } from "react-router";
|
|
10
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
|
+
import { useWorkspacePagesV2 as v } from "@burdenoff/fe-libs/ui";
|
|
11
12
|
// src/export/ExportRoutes.tsx
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
var y = c(() => import("./pages/CreateExportPage.js").then((e) => ({ default: e.CreateExportPage }))), b = c(() => import("./pages/ExportHistoryPage.js").then((e) => ({ default: e.ExportHistoryPage }))), x = c(() => import("./pages/ExportDetailPage.js").then((e) => ({ default: e.ExportDetailPage }))), S = c(() => import("./pages/ExportTemplatesPage.js").then((e) => ({ default: e.ExportTemplatesPage }))), C = c(() => import("./pages/v2/DownloadsPage.js").then((e) => ({ default: e.DownloadsPage }))), w = c(() => import("./pages/v2/NewDownloadPage.js").then((e) => ({ default: e.NewDownloadPage }))), T = c(() => import("./pages/v2/DownloadDetailPage.js").then((e) => ({ default: e.DownloadDetailPage }))), E = c(() => import("./pages/TemplateDetailPage.js").then((e) => ({ default: e.TemplateDetailPage }))), D = c(() => import("./workspace-v2/ExportV2Routes.js").then((e) => ({ default: e.ExportV2Routes })));
|
|
14
|
+
function O() {
|
|
15
|
+
return /* @__PURE__ */ g(i, {
|
|
16
|
+
route: !0,
|
|
17
|
+
minHeight: "400px",
|
|
18
|
+
today: /* @__PURE__ */ g("div", {
|
|
19
|
+
className: "flex items-center justify-center min-h-[400px]",
|
|
20
|
+
children: /* @__PURE__ */ g(a, { className: "size-8 animate-spin text-primary" })
|
|
21
|
+
})
|
|
17
22
|
});
|
|
18
23
|
}
|
|
19
|
-
function
|
|
24
|
+
function k({ error: t, onRetry: n }) {
|
|
20
25
|
let r = e();
|
|
21
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ _("div", {
|
|
22
27
|
className: "flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6",
|
|
23
28
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ g("div", {
|
|
25
30
|
className: "p-3 rounded-full bg-status-error-bg/10",
|
|
26
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ g(l, { className: "size-8 text-status-error-text" })
|
|
27
32
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ _("div", {
|
|
29
34
|
className: "space-y-2",
|
|
30
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
31
36
|
className: "text-lg font-semibold text-text-primary",
|
|
32
37
|
children: r("export.routes.error.title", "Failed to load page")
|
|
33
|
-
}), /* @__PURE__ */
|
|
38
|
+
}), /* @__PURE__ */ g("p", {
|
|
34
39
|
className: "text-sm text-text-secondary max-w-md",
|
|
35
40
|
children: t?.message || r("export.routes.error.description", "The page chunk could not be loaded. This may be due to a network issue.")
|
|
36
41
|
})]
|
|
37
42
|
}),
|
|
38
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ _("button", {
|
|
39
44
|
type: "button",
|
|
40
45
|
onClick: n,
|
|
41
46
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ g(u, { className: "size-4" }), r("export.routes.error.retry", "Try Again")]
|
|
43
48
|
})
|
|
44
49
|
]
|
|
45
50
|
});
|
|
46
51
|
}
|
|
47
|
-
var
|
|
52
|
+
var A = class extends o {
|
|
48
53
|
constructor(e) {
|
|
49
54
|
super(e), this.state = {
|
|
50
55
|
hasError: !1,
|
|
@@ -67,49 +72,49 @@ var k = class extends i {
|
|
|
67
72
|
});
|
|
68
73
|
};
|
|
69
74
|
render() {
|
|
70
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
75
|
+
return this.state.hasError ? /* @__PURE__ */ g(k, {
|
|
71
76
|
error: this.state.error,
|
|
72
77
|
onRetry: this.handleRetry
|
|
73
78
|
}) : this.props.children;
|
|
74
79
|
}
|
|
75
80
|
};
|
|
76
|
-
function
|
|
81
|
+
function j() {
|
|
77
82
|
let t = e();
|
|
78
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ _("div", {
|
|
79
84
|
className: "flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ g("div", {
|
|
81
86
|
className: "p-3 rounded-full bg-bg-sunken",
|
|
82
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ g("svg", {
|
|
83
88
|
className: "size-8 text-text-secondary",
|
|
84
89
|
fill: "none",
|
|
85
90
|
viewBox: "0 0 24 24",
|
|
86
91
|
stroke: "currentColor",
|
|
87
92
|
strokeWidth: 1.5,
|
|
88
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ g("path", {
|
|
89
94
|
strokeLinecap: "round",
|
|
90
95
|
strokeLinejoin: "round",
|
|
91
96
|
d: "M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"
|
|
92
97
|
})
|
|
93
98
|
})
|
|
94
|
-
}), /* @__PURE__ */
|
|
99
|
+
}), /* @__PURE__ */ _("div", {
|
|
95
100
|
className: "space-y-2",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
97
102
|
className: "text-lg font-semibold text-text-primary",
|
|
98
103
|
children: t("export.routes.disabled.title", "Data Export Unavailable")
|
|
99
|
-
}), /* @__PURE__ */
|
|
104
|
+
}), /* @__PURE__ */ g("p", {
|
|
100
105
|
className: "text-sm text-text-secondary max-w-md",
|
|
101
106
|
children: t("export.routes.disabled.description", "The Data Export feature is currently disabled for this workspace. Contact your administrator to enable it.")
|
|
102
107
|
})]
|
|
103
108
|
})]
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
|
-
function
|
|
107
|
-
let [e] =
|
|
111
|
+
function M() {
|
|
112
|
+
let [e] = h(), t = e.get("tab");
|
|
108
113
|
if (t === "templates" || t === "new") {
|
|
109
114
|
let n = new URLSearchParams(e);
|
|
110
115
|
n.delete("tab");
|
|
111
116
|
let r = n.toString();
|
|
112
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ g(f, {
|
|
113
118
|
to: {
|
|
114
119
|
pathname: t,
|
|
115
120
|
search: r ? `?${r}` : ""
|
|
@@ -117,45 +122,45 @@ function j() {
|
|
|
117
122
|
replace: !0
|
|
118
123
|
});
|
|
119
124
|
}
|
|
120
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ g(C, {});
|
|
121
126
|
}
|
|
122
|
-
function
|
|
123
|
-
let e = n(), i =
|
|
124
|
-
return /* @__PURE__ */
|
|
127
|
+
function N() {
|
|
128
|
+
let e = n(), i = v(), { basePath: a = "/" } = t();
|
|
129
|
+
return /* @__PURE__ */ g(A, { children: /* @__PURE__ */ g(d, {
|
|
125
130
|
flag: "workspaces.export",
|
|
126
131
|
defaultValue: !0,
|
|
127
|
-
fallback: /* @__PURE__ */
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
-
fallback: /* @__PURE__ */
|
|
130
|
-
children: i ? /* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
+
fallback: /* @__PURE__ */ g(j, {}),
|
|
133
|
+
children: /* @__PURE__ */ g(s, {
|
|
134
|
+
fallback: /* @__PURE__ */ g(O, {}),
|
|
135
|
+
children: i ? /* @__PURE__ */ g(D, {}) : /* @__PURE__ */ _(m, { children: [
|
|
136
|
+
/* @__PURE__ */ g(p, {
|
|
132
137
|
index: !0,
|
|
133
|
-
element:
|
|
138
|
+
element: g(e ? M : r, {})
|
|
134
139
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ g(p, {
|
|
136
141
|
path: "new",
|
|
137
|
-
element:
|
|
142
|
+
element: g(e ? w : y, {})
|
|
138
143
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ g(p, {
|
|
140
145
|
path: "history",
|
|
141
|
-
element:
|
|
146
|
+
element: g(e ? C : b, {})
|
|
142
147
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ g(p, {
|
|
144
149
|
path: ":jobId",
|
|
145
|
-
element:
|
|
150
|
+
element: g(e ? T : x, {})
|
|
146
151
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ g(p, {
|
|
148
153
|
path: "templates",
|
|
149
|
-
element: /* @__PURE__ */
|
|
154
|
+
element: /* @__PURE__ */ g(S, {})
|
|
150
155
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ g(p, {
|
|
152
157
|
path: "templates/:templateId",
|
|
153
|
-
element: /* @__PURE__ */
|
|
158
|
+
element: /* @__PURE__ */ g(E, {})
|
|
154
159
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ g(p, {
|
|
156
161
|
path: "*",
|
|
157
|
-
element: /* @__PURE__ */
|
|
158
|
-
to:
|
|
162
|
+
element: /* @__PURE__ */ g(f, {
|
|
163
|
+
to: a,
|
|
159
164
|
replace: !0
|
|
160
165
|
})
|
|
161
166
|
})
|
|
@@ -163,6 +168,6 @@ function M() {
|
|
|
163
168
|
})
|
|
164
169
|
}) });
|
|
165
170
|
}
|
|
166
|
-
export {
|
|
171
|
+
export { N as ExportRoutes, M as V2Landing };
|
|
167
172
|
|
|
168
173
|
//# sourceMappingURL=ExportRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportRoutes.js","names":["CreateExportPage","lazy","m","ExportHistoryPage","ExportDetailPage","ExportTemplatesPage","DownloadsPage","NewDownloadPage","DownloadDetailPage","TemplateDetailPage","ExportV2Routes","PageLoader","Loader2","LazyErrorFallback","tr","useTr","AlertTriangle","error","onRetry","RefreshCw","LazyErrorBoundary","Component","props","errorInfo","ExportDisabledFallback","V2Landing","params","useSearchParams","tab","rest","search","Navigate","ExportRoutes","navigationV2","useNavigationV2","workspacePagesV2","useWorkspacePagesV2","useExport","FeatureGate","Suspense","Routes","Route","jsx","ExportLandingPage","basePath"],"sources":["../../src/export/ExportRoutes.tsx"],"sourcesContent":["import {\n lazy,\n Suspense,\n Component,\n type ReactNode,\n type ErrorInfo,\n} from \"react\";\nimport { Navigate, Route, Routes, useSearchParams } from \"react-router\";\nimport { Loader2, AlertTriangle, RefreshCw } from \"lucide-react\";\nimport { FeatureGate } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { useWorkspacePagesV2 } from \"@burdenoff/fe-libs/ui\";\nimport { useTr } from \"./hooks/useTr\";\nimport { useExport } from \"./providers/ExportProvider\";\nimport { useNavigationV2 } from \"./navigation-v2/NavigationV2\";\n\n// Eager loaded - primary landing page\nimport { ExportLandingPage } from \"./pages/ExportLandingPage\";\n\n// Lazy loaded pages\nconst CreateExportPage = lazy(() =>\n import(\"./pages/CreateExportPage\").then((m) => ({\n default: m.CreateExportPage,\n })),\n);\nconst ExportHistoryPage = lazy(() =>\n import(\"./pages/ExportHistoryPage\").then((m) => ({\n default: m.ExportHistoryPage,\n })),\n);\nconst ExportDetailPage = lazy(() =>\n import(\"./pages/ExportDetailPage\").then((m) => ({\n default: m.ExportDetailPage,\n })),\n);\nconst ExportTemplatesPage = lazy(() =>\n import(\"./pages/ExportTemplatesPage\").then((m) => ({\n default: m.ExportTemplatesPage,\n })),\n);\nconst DownloadsPage = lazy(() =>\n import(\"./pages/v2/DownloadsPage\").then((m) => ({\n default: m.DownloadsPage,\n })),\n);\nconst NewDownloadPage = lazy(() =>\n import(\"./pages/v2/NewDownloadPage\").then((m) => ({\n default: m.NewDownloadPage,\n })),\n);\nconst DownloadDetailPage = lazy(() =>\n import(\"./pages/v2/DownloadDetailPage\").then((m) => ({\n default: m.DownloadDetailPage,\n })),\n);\nconst TemplateDetailPage = lazy(() =>\n import(\"./pages/TemplateDetailPage\").then((m) => ({\n default: m.TemplateDetailPage,\n })),\n);\n// Workspace pages v2 (BOFF-15822): the redesigned \"Download your data\", for hosts that opt in.\nconst ExportV2Routes = lazy(() =>\n import(\"./workspace-v2/ExportV2Routes\").then((m) => ({\n default: m.ExportV2Routes,\n })),\n);\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Translated error UI rendered by LazyErrorBoundary.\n * Extracted as a function component so it can use the `useTr` hook.\n */\nfunction LazyErrorFallback({\n error,\n onRetry,\n}: {\n error: Error | null;\n onRetry: () => void;\n}) {\n const tr = useTr();\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">\n {tr(\"export.routes.error.title\", \"Failed to load page\")}\n </h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {error?.message ||\n tr(\n \"export.routes.error.description\",\n \"The page chunk could not be loaded. This may be due to a network issue.\",\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n {tr(\"export.routes.error.retry\", \"Try Again\")}\n </button>\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nclass LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error(\"[Export] Lazy page load failed:\", error, errorInfo);\n }\n\n handleRetry = () => {\n this.setState({ hasError: false, error: null });\n };\n\n override render() {\n if (this.state.hasError) {\n return (\n <LazyErrorFallback\n error={this.state.error}\n onRetry={this.handleRetry}\n />\n );\n }\n\n return this.props.children;\n }\n}\n\n/**\n * Fallback shown when the Export feature flag is OFF.\n */\nfunction ExportDisabledFallback() {\n const tr = useTr();\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-bg-sunken\">\n <svg\n className=\"size-8 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3\"\n />\n </svg>\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">\n {tr(\"export.routes.disabled.title\", \"Data Export Unavailable\")}\n </h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {tr(\n \"export.routes.disabled.description\",\n \"The Data Export feature is currently disabled for this workspace. Contact your administrator to enable it.\",\n )}\n </p>\n </div>\n </div>\n );\n}\n\n/**\n * Internal router for the Export microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes (relative to basePath, e.g., /export):\n * - / → Export dashboard page\n * - /new → Create new export job\n * - /history → Export history list\n * - /:jobId → Export job detail page\n * - /templates → Export templates list\n * - /templates/:templateId → Template detail page\n */\n/**\n * Navigation v2 landing (BOFF-11870): the old tab bar is gone, and every old\n * `?tab=` value opens its page. `dashboard` and `history` are the one list;\n * `templates` and the hidden `new` redirect, keeping the rest of the query\n * (`?templateId=`, `?status=`).\n */\nexport function V2Landing() {\n const [params] = useSearchParams();\n const tab = params.get(\"tab\");\n if (tab === \"templates\" || tab === \"new\") {\n const rest = new URLSearchParams(params);\n rest.delete(\"tab\");\n const search = rest.toString();\n return (\n <Navigate\n to={{ pathname: tab, search: search ? `?${search}` : \"\" }}\n replace\n />\n );\n }\n return <DownloadsPage />;\n}\n\nexport function ExportRoutes() {\n const navigationV2 = useNavigationV2();\n // Off everywhere but FluidGrids (AppShellConfig.workspacePagesV2): the\n // routes below, unchanged. On: the redesigned pages (workspace-v2/).\n const workspacePagesV2 = useWorkspacePagesV2();\n const { basePath = \"/\" } = useExport();\n return (\n <LazyErrorBoundary>\n <FeatureGate\n flag=\"workspaces.export\"\n defaultValue={true}\n fallback={<ExportDisabledFallback />}\n >\n <Suspense fallback={<PageLoader />}>\n {workspacePagesV2 ? (\n <ExportV2Routes />\n ) : (\n <Routes>\n {/* Tabbed landing - default route (eager loaded). Navigation v2:\n one \"Download your data\" list, old ?tab= values still work. */}\n <Route\n index\n element={navigationV2 ? <V2Landing /> : <ExportLandingPage />}\n />\n\n {/* Create new export (lazy loaded) */}\n <Route\n path=\"new\"\n element={\n navigationV2 ? <NewDownloadPage /> : <CreateExportPage />\n }\n />\n\n {/* Export history (lazy loaded); the same list in Navigation v2 */}\n <Route\n path=\"history\"\n element={\n navigationV2 ? <DownloadsPage /> : <ExportHistoryPage />\n }\n />\n\n {/* Export job detail (lazy loaded) */}\n <Route\n path=\":jobId\"\n element={\n navigationV2 ? <DownloadDetailPage /> : <ExportDetailPage />\n }\n />\n\n {/* Templates (lazy loaded) */}\n <Route path=\"templates\" element={<ExportTemplatesPage />} />\n <Route\n path=\"templates/:templateId\"\n element={<TemplateDetailPage />}\n />\n\n {/* Catch-all route - redirect to the landing page. An empty \"to\"\n resolves to the unmatched URL itself inside a splat route, so\n the module's own base path is used. */}\n <Route path=\"*\" element={<Navigate to={basePath} replace />} />\n </Routes>\n )}\n </Suspense>\n </FeatureGate>\n </LazyErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAMA,IAAmBC,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,iBACb,EAAE,CACJ,GACMC,IAAoBF,QACxB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAC/C,SAASC,EAAE,kBACb,EAAE,CACJ,GACME,IAAmBH,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,iBACb,EAAE,CACJ,GACMG,IAAsBJ,QAC1B,OAAO,iCAA8B,CAAC,MAAM,OAAO,EACjD,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portRoutes.js","names":["CreateExportPage","lazy","m","ExportHistoryPage","ExportDetailPage","ExportTemplatesPage","DownloadsPage","NewDownloadPage","DownloadDetailPage","TemplateDetailPage","ExportV2Routes","PageLoader","SectionLoaderOr","SpinnerIcon","LazyErrorFallback","tr","useTr","AlertTriangle","error","onRetry","RefreshCw","LazyErrorBoundary","Component","props","errorInfo","ExportDisabledFallback","V2Landing","params","useSearchParams","tab","rest","search","Navigate","ExportRoutes","navigationV2","useNavigationV2","workspacePagesV2","useWorkspacePagesV2","useExport","FeatureGate","Suspense","Routes","Route","jsx","ExportLandingPage","basePath"],"sources":["../../src/export/ExportRoutes.tsx"],"sourcesContent":["import {\n lazy,\n Suspense,\n Component,\n type ReactNode,\n type ErrorInfo,\n} from \"react\";\nimport { Navigate, Route, Routes, useSearchParams } from \"react-router\";\nimport { AlertTriangle, RefreshCw } from \"lucide-react\";\nimport { FeatureGate } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { useWorkspacePagesV2 } from \"@burdenoff/fe-libs/ui\";\nimport { useTr } from \"./hooks/useTr\";\nimport { useExport } from \"./providers/ExportProvider\";\nimport { useNavigationV2 } from \"./navigation-v2/NavigationV2\";\n\n// Eager loaded - primary landing page\nimport { ExportLandingPage } from \"./pages/ExportLandingPage\";\nimport { SectionLoaderOr, SpinnerIcon } from \"./components/loadingSystem\";\n\n// Lazy loaded pages\nconst CreateExportPage = lazy(() =>\n import(\"./pages/CreateExportPage\").then((m) => ({\n default: m.CreateExportPage,\n })),\n);\nconst ExportHistoryPage = lazy(() =>\n import(\"./pages/ExportHistoryPage\").then((m) => ({\n default: m.ExportHistoryPage,\n })),\n);\nconst ExportDetailPage = lazy(() =>\n import(\"./pages/ExportDetailPage\").then((m) => ({\n default: m.ExportDetailPage,\n })),\n);\nconst ExportTemplatesPage = lazy(() =>\n import(\"./pages/ExportTemplatesPage\").then((m) => ({\n default: m.ExportTemplatesPage,\n })),\n);\nconst DownloadsPage = lazy(() =>\n import(\"./pages/v2/DownloadsPage\").then((m) => ({\n default: m.DownloadsPage,\n })),\n);\nconst NewDownloadPage = lazy(() =>\n import(\"./pages/v2/NewDownloadPage\").then((m) => ({\n default: m.NewDownloadPage,\n })),\n);\nconst DownloadDetailPage = lazy(() =>\n import(\"./pages/v2/DownloadDetailPage\").then((m) => ({\n default: m.DownloadDetailPage,\n })),\n);\nconst TemplateDetailPage = lazy(() =>\n import(\"./pages/TemplateDetailPage\").then((m) => ({\n default: m.TemplateDetailPage,\n })),\n);\n// Workspace pages v2 (BOFF-15822): the redesigned \"Download your data\", for hosts that opt in.\nconst ExportV2Routes = lazy(() =>\n import(\"./workspace-v2/ExportV2Routes\").then((m) => ({\n default: m.ExportV2Routes,\n })),\n);\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <SectionLoaderOr\n route\n minHeight=\"400px\"\n today={\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <SpinnerIcon className=\"size-8 animate-spin text-primary\" />\n </div>\n }\n />\n );\n}\n\n/**\n * Translated error UI rendered by LazyErrorBoundary.\n * Extracted as a function component so it can use the `useTr` hook.\n */\nfunction LazyErrorFallback({\n error,\n onRetry,\n}: {\n error: Error | null;\n onRetry: () => void;\n}) {\n const tr = useTr();\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">\n {tr(\"export.routes.error.title\", \"Failed to load page\")}\n </h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {error?.message ||\n tr(\n \"export.routes.error.description\",\n \"The page chunk could not be loaded. This may be due to a network issue.\",\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n {tr(\"export.routes.error.retry\", \"Try Again\")}\n </button>\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nclass LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error(\"[Export] Lazy page load failed:\", error, errorInfo);\n }\n\n handleRetry = () => {\n this.setState({ hasError: false, error: null });\n };\n\n override render() {\n if (this.state.hasError) {\n return (\n <LazyErrorFallback\n error={this.state.error}\n onRetry={this.handleRetry}\n />\n );\n }\n\n return this.props.children;\n }\n}\n\n/**\n * Fallback shown when the Export feature flag is OFF.\n */\nfunction ExportDisabledFallback() {\n const tr = useTr();\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-bg-sunken\">\n <svg\n className=\"size-8 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3\"\n />\n </svg>\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">\n {tr(\"export.routes.disabled.title\", \"Data Export Unavailable\")}\n </h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {tr(\n \"export.routes.disabled.description\",\n \"The Data Export feature is currently disabled for this workspace. Contact your administrator to enable it.\",\n )}\n </p>\n </div>\n </div>\n );\n}\n\n/**\n * Internal router for the Export microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes (relative to basePath, e.g., /export):\n * - / → Export dashboard page\n * - /new → Create new export job\n * - /history → Export history list\n * - /:jobId → Export job detail page\n * - /templates → Export templates list\n * - /templates/:templateId → Template detail page\n */\n/**\n * Navigation v2 landing (BOFF-11870): the old tab bar is gone, and every old\n * `?tab=` value opens its page. `dashboard` and `history` are the one list;\n * `templates` and the hidden `new` redirect, keeping the rest of the query\n * (`?templateId=`, `?status=`).\n */\nexport function V2Landing() {\n const [params] = useSearchParams();\n const tab = params.get(\"tab\");\n if (tab === \"templates\" || tab === \"new\") {\n const rest = new URLSearchParams(params);\n rest.delete(\"tab\");\n const search = rest.toString();\n return (\n <Navigate\n to={{ pathname: tab, search: search ? `?${search}` : \"\" }}\n replace\n />\n );\n }\n return <DownloadsPage />;\n}\n\nexport function ExportRoutes() {\n const navigationV2 = useNavigationV2();\n // Off everywhere but FluidGrids (AppShellConfig.workspacePagesV2): the\n // routes below, unchanged. On: the redesigned pages (workspace-v2/).\n const workspacePagesV2 = useWorkspacePagesV2();\n const { basePath = \"/\" } = useExport();\n return (\n <LazyErrorBoundary>\n <FeatureGate\n flag=\"workspaces.export\"\n defaultValue={true}\n fallback={<ExportDisabledFallback />}\n >\n <Suspense fallback={<PageLoader />}>\n {workspacePagesV2 ? (\n <ExportV2Routes />\n ) : (\n <Routes>\n {/* Tabbed landing - default route (eager loaded). Navigation v2:\n one \"Download your data\" list, old ?tab= values still work. */}\n <Route\n index\n element={navigationV2 ? <V2Landing /> : <ExportLandingPage />}\n />\n\n {/* Create new export (lazy loaded) */}\n <Route\n path=\"new\"\n element={\n navigationV2 ? <NewDownloadPage /> : <CreateExportPage />\n }\n />\n\n {/* Export history (lazy loaded); the same list in Navigation v2 */}\n <Route\n path=\"history\"\n element={\n navigationV2 ? <DownloadsPage /> : <ExportHistoryPage />\n }\n />\n\n {/* Export job detail (lazy loaded) */}\n <Route\n path=\":jobId\"\n element={\n navigationV2 ? <DownloadDetailPage /> : <ExportDetailPage />\n }\n />\n\n {/* Templates (lazy loaded) */}\n <Route path=\"templates\" element={<ExportTemplatesPage />} />\n <Route\n path=\"templates/:templateId\"\n element={<TemplateDetailPage />}\n />\n\n {/* Catch-all route - redirect to the landing page. An empty \"to\"\n resolves to the unmatched URL itself inside a splat route, so\n the module's own base path is used. */}\n <Route path=\"*\" element={<Navigate to={basePath} replace />} />\n </Routes>\n )}\n </Suspense>\n </FeatureGate>\n </LazyErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAMA,IAAmBC,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,iBACb,EAAE,CACJ,GACMC,IAAoBF,QACxB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAC/C,SAASC,EAAE,kBACb,EAAE,CACJ,GACME,IAAmBH,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,iBACb,EAAE,CACJ,GACMG,IAAsBJ,QAC1B,OAAO,iCAA8B,CAAC,MAAM,OAAO,EACjD,SAASC,EAAE,oBACb,EAAE,CACJ,GACMI,IAAgBL,QACpB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAC9C,SAASC,EAAE,cACb,EAAE,CACJ,GACMK,IAAkBN,QACtB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAChD,SAASC,EAAE,gBACb,EAAE,CACJ,GACMM,IAAqBP,QACzB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EACnD,SAASC,EAAE,mBACb,EAAE,CACJ,GACMO,IAAqBR,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAChD,SAASC,EAAE,mBACb,EAAE,CACJ,GAEMQ,IAAiBT,QACrB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EACnD,SAASC,EAAE,eACb,EAAE,CACJ;AAKA,SAASS,IAAa;CACpB,OACE,kBAACC,GAAD;EACE,OAAA;EACA,WAAU;EACV,OACE,kBAA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BC,EAAfT,IAAgBR,IAAgBkB,GAAjB,CAAY,CAAwB;IAC7D,CAAA;IAGD,kBAACF,GAAD;KACE,MAAK;KACL,SACiBC,EAAfT,IAAgB3B,IAAsBP,GAAvB,CAAkB,CAAuB;IAE3D,CAAA;IAGD,kBAAC0C,GAAD;KACE,MAAK;KACL,SACiBC,EAAfT,IAAgB5B,IAAoBH,GAArB,CAAgB,CAAwB;IAE1D,CAAA;IAGD,kBAACuC,GAAD;KACE,MAAK;KACL,SACiBC,EAAfT,IAAgB1B,IAAyBJ,GAA1B,CAAqB,CAAuB;IAE9D,CAAA;IAGD,kBAACsC,GAAD;KAAO,MAAK;KAAY,SAAS,kBAACrC,GAAD,CAAsB,CAAA;IAAI,CAAA;IAC3D,kBAACqC,GAAD;KACE,MAAK;KACL,SAAS,kBAACjC,GAAD,CAAqB,CAAA;IAC/B,CAAA;IAKD,kBAACiC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAACV,GAAD;MAAU,IAAIa;MAAU,SAAA;KAAS,CAAA;IAAI,CAAA;GACxD,EAAA,CAAA;EAEF,CAAA;CACC,CAAA,EACI,CAAA;AAEvB"}
|
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SpinnerIcon as e } from "./loadingSystem.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { Button as r, ResponsiveDialog as i, ResponsiveDialogContent as a, ResponsiveDialogDescription as o, ResponsiveDialogFooter as s, ResponsiveDialogHeader as c, ResponsiveDialogTitle as l } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
import { useLoadingSystem as u } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
|
|
4
5
|
// src/export/components/ConfirmDestructiveDialog.tsx
|
|
5
|
-
function
|
|
6
|
+
function d({ open: d, title: f, description: p, confirmLabel: m, keepLabel: h, busy: g = !1, error: _, onConfirm: v, onOpenChange: y }) {
|
|
7
|
+
let b = u();
|
|
6
8
|
return /* @__PURE__ */ t(i, {
|
|
7
|
-
open:
|
|
8
|
-
onOpenChange:
|
|
9
|
+
open: d,
|
|
10
|
+
onOpenChange: y,
|
|
9
11
|
children: /* @__PURE__ */ n(a, { children: [
|
|
10
|
-
/* @__PURE__ */ n(c, { children: [/* @__PURE__ */ t(l, { children:
|
|
11
|
-
|
|
12
|
+
/* @__PURE__ */ n(c, { children: [/* @__PURE__ */ t(l, { children: f }), /* @__PURE__ */ t(o, { children: p })] }),
|
|
13
|
+
_ ? /* @__PURE__ */ t("p", {
|
|
12
14
|
role: "alert",
|
|
13
15
|
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
14
|
-
children:
|
|
16
|
+
children: _
|
|
15
17
|
}) : null,
|
|
16
18
|
/* @__PURE__ */ n(s, { children: [/* @__PURE__ */ t(r, {
|
|
17
19
|
type: "button",
|
|
18
20
|
variant: "outline",
|
|
19
|
-
onClick: () =>
|
|
20
|
-
children:
|
|
21
|
+
onClick: () => y(!1),
|
|
22
|
+
children: h
|
|
21
23
|
}), /* @__PURE__ */ n(r, {
|
|
24
|
+
busy: b && g,
|
|
22
25
|
type: "button",
|
|
23
26
|
variant: "destructive",
|
|
24
|
-
disabled:
|
|
25
|
-
onClick:
|
|
26
|
-
children: [
|
|
27
|
+
disabled: !b && g,
|
|
28
|
+
onClick: v,
|
|
29
|
+
children: [!b && g ? /* @__PURE__ */ t(e, {
|
|
30
|
+
tone: "current",
|
|
27
31
|
size: 16,
|
|
28
32
|
className: "animate-spin",
|
|
29
33
|
"aria-hidden": "true"
|
|
30
|
-
}) : null,
|
|
34
|
+
}) : null, m]
|
|
31
35
|
})] })
|
|
32
36
|
] })
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
|
-
export {
|
|
39
|
+
export { d as ConfirmDestructiveDialog };
|
|
36
40
|
|
|
37
41
|
//# sourceMappingURL=ConfirmDestructiveDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDestructiveDialog.js","names":["ConfirmDestructiveDialog","ResponsiveDialog","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","title","ResponsiveDialogDescription","description","error","ResponsiveDialogFooter","Button","onOpenChange","keepLabel","busy","onConfirm","
|
|
1
|
+
{"version":3,"file":"ConfirmDestructiveDialog.js","names":["ConfirmDestructiveDialog","loadingSystem","useLoadingSystem","ResponsiveDialog","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","title","ResponsiveDialogDescription","description","error","ResponsiveDialogFooter","Button","onOpenChange","keepLabel","busy","onConfirm","SpinnerIcon","confirmLabel"],"sources":["../../../src/export/components/ConfirmDestructiveDialog.tsx"],"sourcesContent":["import {\n Button,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useLoadingSystem } from \"@burdenoff/fe-libs/ui/loading/LoadingSystemProvider\";\nimport { SpinnerIcon } from \"./loadingSystem\";\n\nexport interface ConfirmDestructiveDialogProps {\n open: boolean;\n /** Names the item: \"Delete “Weekly backup”?\" */\n title: string;\n /** Says what happens to it. */\n description: string;\n confirmLabel: string;\n keepLabel: string;\n busy?: boolean;\n /** Shown when the last attempt failed; the dialog stays open to retry. */\n error?: string | null;\n onConfirm: () => void;\n onOpenChange: (open: boolean) => void;\n}\n\n/**\n * Navigation v2 confirm for cancel/delete (BOFF-11870): fe-libs'\n * `ResponsiveDialog` (focus trap, Escape, a bottom sheet on phones) in place\n * of the module's hand-rolled overlays. A failure is shown in the dialog\n * instead of closing it silently.\n */\nexport function ConfirmDestructiveDialog({\n open,\n title,\n description,\n confirmLabel,\n keepLabel,\n busy = false,\n error,\n onConfirm,\n onOpenChange,\n}: ConfirmDestructiveDialogProps) {\n const loadingSystem = useLoadingSystem();\n return (\n <ResponsiveDialog open={open} onOpenChange={onOpenChange}>\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>{title}</ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n {description}\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n {error ? (\n <p\n role=\"alert\"\n className=\"rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\"\n >\n {error}\n </p>\n ) : null}\n <ResponsiveDialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => onOpenChange(false)}\n >\n {keepLabel}\n </Button>\n <Button\n busy={loadingSystem && busy}\n type=\"button\"\n variant=\"destructive\"\n disabled={!loadingSystem && busy}\n onClick={onConfirm}\n >\n {!loadingSystem && busy ? (\n <SpinnerIcon\n tone=\"current\"\n size={16}\n className=\"animate-spin\"\n aria-hidden=\"true\"\n />\n ) : null}\n {confirmLabel}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;;;AAiCA,SAAgBA,EAAyB,EACvC,SACA,UACA,gBACA,iBACA,cACA,UAAO,IACP,UACA,cACA,mBACgC;CAChC,IAAMC,IAAgBC,EAAiB;CACvC,OACE,kBAACC,GAAD;EAAwB;EAAoB;EAC1C,UAAA,kBAACC,GAAD,EAAA,UAAA;GACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAwBC,EAA6B,CAAA,GACrD,kBAACC,GAAD,EAAA,UACGC,EAC0B,CAAA,CACP,EAAA,CAAA;GACvBC,IACC,kBAAC,KAAD;IACE,MAAK;IACL,WAAU;IAET,UAAAA;GACA,CAAA,IACD;GACJ,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,eAAeC,EAAa,EAAK;IAEhC,UAAAC;GACK,CAAA,GACR,kBAACF,GAAD;IACE,MAAMX,KAAiBc;IACvB,MAAK;IACL,SAAQ;IACR,UAAU,CAACd,KAAiBc;IAC5B,SAASC;IALX,UAAA,CAOG,CAACf,KAAiBc,IACjB,kBAACE,GAAD;KACE,MAAK;KACL,MAAM;KACN,WAAU;KACV,eAAY;IACb,CAAA,IACC,MACHC,CACK;GACc,CAAA,CAAA,EAAA,CAAA;EACD,EAAA,CAAA;CACT,CAAA;AAEtB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useTr as e } from "../hooks/useTr.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { DOWNLOAD_PHASE_COPY as n, downloadPhase as r } from "../utils/downloadStatus.js";
|
|
4
|
-
import {
|
|
4
|
+
import { SpinnerIcon as i } from "./loadingSystem.js";
|
|
5
|
+
import { CheckCircle2 as a, RotateCcw as o, XCircle as s } from "lucide-react";
|
|
5
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
7
|
// src/export/components/DownloadStatus.tsx
|
|
7
8
|
var u = {
|
|
8
|
-
|
|
9
|
-
ready: i,
|
|
9
|
+
ready: a,
|
|
10
10
|
failed: s,
|
|
11
11
|
cancelled: s,
|
|
12
12
|
expired: o,
|
|
@@ -19,16 +19,20 @@ function d() {
|
|
|
19
19
|
return t(i.key, i.label);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function f({ status: e, className: n, badge:
|
|
23
|
-
let
|
|
22
|
+
function f({ status: e, className: n, badge: a = !1 }) {
|
|
23
|
+
let o = d(), s = r(e), f = s === "preparing" ? void 0 : u[s];
|
|
24
24
|
return /* @__PURE__ */ l("span", {
|
|
25
|
-
"data-phase":
|
|
26
|
-
className: t("inline-flex items-center gap-1.5 text-sm text-text-secondary",
|
|
27
|
-
children: [/* @__PURE__ */ c(
|
|
25
|
+
"data-phase": s,
|
|
26
|
+
className: t("inline-flex items-center gap-1.5 text-sm text-text-secondary", a && "rounded-full border border-border-subtle bg-bg-surface px-2.5 py-0.5 text-xs font-medium text-text-primary", n),
|
|
27
|
+
children: [f ? /* @__PURE__ */ c(f, {
|
|
28
28
|
size: 14,
|
|
29
29
|
"aria-hidden": "true",
|
|
30
|
-
className:
|
|
31
|
-
}),
|
|
30
|
+
className: "shrink-0"
|
|
31
|
+
}) : /* @__PURE__ */ c(i, {
|
|
32
|
+
size: 14,
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: "shrink-0 motion-safe:animate-spin"
|
|
35
|
+
}), o(e)]
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
export { f as DownloadStatus, d as useDownloadStatusLabel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadStatus.js","names":["PHASE_ICON","
|
|
1
|
+
{"version":3,"file":"DownloadStatus.js","names":["PHASE_ICON","CheckCircle2","XCircle","RotateCcw","useDownloadStatusLabel","tr","useTr","copy","DOWNLOAD_PHASE_COPY","downloadPhase","status","DownloadStatus","label","phase","Icon","cn","badge","className","SpinnerIcon"],"sources":["../../../src/export/components/DownloadStatus.tsx"],"sourcesContent":["import { CheckCircle2, Clock, RotateCcw, XCircle } from \"lucide-react\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport {\n DOWNLOAD_PHASE_COPY,\n downloadPhase,\n type DownloadPhase,\n} from \"../utils/downloadStatus\";\nimport type { ExportJobStatus } from \"../types\";\nimport { SpinnerIcon } from \"./loadingSystem\";\n\n/** A preparing download turns: `SpinnerIcon` (lucide's Loader2 without the opt-in). */\nconst PHASE_ICON: Record<Exclude<DownloadPhase, \"preparing\">, typeof Clock> = {\n ready: CheckCircle2,\n failed: XCircle,\n cancelled: XCircle,\n expired: RotateCcw,\n deleted: XCircle,\n};\n\n/** The plain status words, for code that needs the text only. */\nexport function useDownloadStatusLabel(): (status: ExportJobStatus) => string {\n const tr = useTr();\n return (status) => {\n const copy = DOWNLOAD_PHASE_COPY[downloadPhase(status)];\n return tr(copy.key, copy.label);\n };\n}\n\n/**\n * Navigation v2 status: an icon and the plain words, in the text colour. The\n * words carry the meaning, so nothing depends on colour.\n */\nexport function DownloadStatus({\n status,\n className,\n badge = false,\n}: {\n status: ExportJobStatus;\n className?: string;\n /** A bordered pill, for a page header. */\n badge?: boolean;\n}) {\n const label = useDownloadStatusLabel();\n const phase = downloadPhase(status);\n const Icon = phase === \"preparing\" ? undefined : PHASE_ICON[phase];\n return (\n <span\n data-phase={phase}\n className={cn(\n \"inline-flex items-center gap-1.5 text-sm text-text-secondary\",\n badge &&\n \"rounded-full border border-border-subtle bg-bg-surface px-2.5 py-0.5 text-xs font-medium text-text-primary\",\n className,\n )}\n >\n {Icon ? (\n <Icon size={14} aria-hidden=\"true\" className=\"shrink-0\" />\n ) : (\n <SpinnerIcon\n size={14}\n aria-hidden=\"true\"\n className=\"shrink-0 motion-safe:animate-spin\"\n />\n )}\n {label(status)}\n </span>\n );\n}\n"],"mappings":";;;;;;;AAYA,IAAMA,IAAwE;CAC5E,OAAOC;CACP,QAAQC;CACR,WAAWA;CACX,SAASC;CACT,SAASD;AACX;AAGA,SAAgBE,IAA8D;CAC5E,IAAMC,IAAKC,EAAM;CACjB,QAAQ,MAAW;EACjB,IAAMC,IAAOC,EAAoBC,EAAcC,CAAM;EACrD,OAAOL,EAAGE,EAAK,KAAKA,EAAK,KAAK;CAChC;AACF;AAMA,SAAgBI,EAAe,EAC7B,WACA,cACA,WAAQ,MAMP;CACD,IAAMC,IAAQR,EAAuB,GAC/BS,IAAQJ,EAAcC,CAAM,GAC5BI,IAAOD,MAAU,cAAc,KAAA,IAAYb,EAAWa;CAC5D,OACE,kBAAC,QAAD;EACE,cAAYA;EACZ,WAAWE,EACT,gEACAC,KACE,8GACFC,CACF;EAPF,UAAA,CASGH,IACC,kBAACA,GAAD;GAAM,MAAM;GAAI,eAAY;GAAO,WAAU;EAAY,CAAA,IAEzD,kBAACI,GAAD;GACE,MAAM;GACN,eAAY;GACZ,WAAU;EACX,CAAA,GAEFN,EAAMF,CAAM,CACT;;AAEV"}
|
|
@@ -5,7 +5,9 @@ interface ExportProgressBarProps {
|
|
|
5
5
|
size?: "sm" | "md" | "lg";
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* ExportProgressBar - Shows export progress percentage
|
|
8
|
+
* ExportProgressBar - Shows export progress percentage. BOFF-16259: under the loading system's
|
|
9
|
+
* opt-in (FluidGrids) it is fe-libs' ProgressBar (the real share, the fill scaled, 25/50/75/100 %
|
|
10
|
+
* announced); without it, today's bar.
|
|
9
11
|
*/
|
|
10
12
|
export declare function ExportProgressBar({ progress, className, showLabel, size, }: ExportProgressBarProps): import('react').JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
import { useTr as e } from "../hooks/useTr.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { useLoadingSystem as i } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
|
|
5
|
+
import { ProgressBar as a } from "@burdenoff/fe-libs/ui/loading/ProgressBar";
|
|
4
6
|
// src/export/components/ExportProgressBar.tsx
|
|
5
|
-
var
|
|
7
|
+
var o = {
|
|
6
8
|
sm: "h-1.5",
|
|
7
9
|
md: "h-2.5",
|
|
8
10
|
lg: "h-4"
|
|
9
11
|
};
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
+
function s({ progress: s, className: c, showLabel: l = !0, size: u = "md" }) {
|
|
13
|
+
let d = e(), f = i(), p = Math.min(100, Math.max(0, s));
|
|
14
|
+
if (f) {
|
|
15
|
+
let e = d("export.progress.label", "Progress");
|
|
16
|
+
return /* @__PURE__ */ n(a, {
|
|
17
|
+
value: p / 100,
|
|
18
|
+
label: e,
|
|
19
|
+
count: l ? e : void 0,
|
|
20
|
+
done: p === 100,
|
|
21
|
+
className: c
|
|
22
|
+
});
|
|
23
|
+
}
|
|
12
24
|
return /* @__PURE__ */ r("div", {
|
|
13
|
-
className: t("w-full",
|
|
14
|
-
children: [
|
|
25
|
+
className: t("w-full", c),
|
|
26
|
+
children: [l && /* @__PURE__ */ r("div", {
|
|
15
27
|
className: "flex items-center justify-between mb-1",
|
|
16
28
|
children: [/* @__PURE__ */ n("span", {
|
|
17
29
|
className: "text-xs font-medium text-text-secondary",
|
|
18
|
-
children:
|
|
30
|
+
children: d("export.progress.label", "Progress")
|
|
19
31
|
}), /* @__PURE__ */ r("span", {
|
|
20
32
|
className: "text-xs font-semibold text-text-primary",
|
|
21
|
-
children: [Math.round(
|
|
33
|
+
children: [Math.round(p), "%"]
|
|
22
34
|
})]
|
|
23
35
|
}), /* @__PURE__ */ n("div", {
|
|
24
|
-
className: t("w-full bg-bg-sunken rounded-full overflow-hidden",
|
|
36
|
+
className: t("w-full bg-bg-sunken rounded-full overflow-hidden", o[u]),
|
|
25
37
|
children: /* @__PURE__ */ n("div", {
|
|
26
|
-
className: t("h-full rounded-full transition-all duration-500 ease-out",
|
|
27
|
-
style: { width: `${
|
|
38
|
+
className: t("h-full rounded-full transition-all duration-500 ease-out", p === 100 ? "bg-status-success-bg" : "bg-action-primary-bg bg-gradient-to-r from-primary to-primary/80"),
|
|
39
|
+
style: { width: `${p}%` }
|
|
28
40
|
})
|
|
29
41
|
})]
|
|
30
42
|
});
|
|
31
43
|
}
|
|
32
|
-
export {
|
|
44
|
+
export { s as ExportProgressBar };
|
|
33
45
|
|
|
34
46
|
//# sourceMappingURL=ExportProgressBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportProgressBar.js","names":["sizeClasses","ExportProgressBar","tr","useTr","clampedProgress","progress","
|
|
1
|
+
{"version":3,"file":"ExportProgressBar.js","names":["sizeClasses","ExportProgressBar","tr","useTr","loadingSystem","useLoadingSystem","clampedProgress","progress","word","ProgressBar","showLabel","cn","className","size"],"sources":["../../../src/export/components/ExportProgressBar.tsx"],"sourcesContent":["import { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport { useLoadingSystem } from \"@burdenoff/fe-libs/ui/loading/LoadingSystemProvider\";\nimport { ProgressBar } from \"@burdenoff/fe-libs/ui/loading/ProgressBar\";\n\ninterface ExportProgressBarProps {\n progress: number;\n className?: string;\n showLabel?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst sizeClasses = {\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-4\",\n};\n\n/**\n * ExportProgressBar - Shows export progress percentage. BOFF-16259: under the loading system's\n * opt-in (FluidGrids) it is fe-libs' ProgressBar (the real share, the fill scaled, 25/50/75/100 %\n * announced); without it, today's bar.\n */\nexport function ExportProgressBar({\n progress,\n className,\n showLabel = true,\n size = \"md\",\n}: ExportProgressBarProps) {\n const tr = useTr();\n const loadingSystem = useLoadingSystem();\n const clampedProgress = Math.min(100, Math.max(0, progress));\n\n if (loadingSystem) {\n const word = tr(\"export.progress.label\", \"Progress\");\n return (\n <ProgressBar\n value={clampedProgress / 100}\n label={word}\n count={showLabel ? word : undefined}\n done={clampedProgress === 100}\n className={className}\n />\n );\n }\n\n return (\n <div className={cn(\"w-full\", className)}>\n {showLabel && (\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {tr(\"export.progress.label\", \"Progress\")}\n </span>\n <span className=\"text-xs font-semibold text-text-primary\">\n {Math.round(clampedProgress)}%\n </span>\n </div>\n )}\n <div\n className={cn(\n \"w-full bg-bg-sunken rounded-full overflow-hidden\",\n sizeClasses[size],\n )}\n >\n <div\n className={cn(\n \"h-full rounded-full transition-all duration-500 ease-out\",\n clampedProgress === 100\n ? \"bg-status-success-bg\"\n : \"bg-action-primary-bg bg-gradient-to-r from-primary to-primary/80\",\n )}\n style={{ width: `${clampedProgress}%` }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAYA,IAAMA,IAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAOA,SAAgBC,EAAkB,EAChC,aACA,cACA,eAAY,IACZ,UAAO,QACkB;CACzB,IAAMC,IAAKC,EAAM,GACXC,IAAgBC,EAAiB,GACjCC,IAAkB,KAAK,IAAI,KAAK,KAAK,IAAI,GAAGC,CAAQ,CAAC;CAE3D,IAAIH,GAAe;EACjB,IAAMI,IAAON,EAAG,yBAAyB,UAAU;EACnD,OACE,kBAACO,GAAD;GACE,OAAOH,IAAkB;GACzB,OAAOE;GACP,OAAOE,IAAYF,IAAO,KAAA;GAC1B,MAAMF,MAAoB;GACf;EACZ,CAAA;CAEL;CAEA,OACE,kBAAC,OAAD;EAAK,WAAWK,EAAG,UAAUC,CAAS;EAAtC,UAAA,CACGF,KACC,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IACb,UAAAR,EAAG,yBAAyB,UAAU;GACnC,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,KAAK,MAAMI,CAAe,GAAE,GACzB;GACH,CAAA,CAAA;EAEP,CAAA,GAAA,kBAAC,OAAD;GACE,WAAWK,EACT,oDACAX,EAAYa,EACd;GAEA,UAAA,kBAAC,OAAD;IACE,WAAWF,EACT,4DACAL,MAAoB,MAChB,yBACA,kEACN;IACA,OAAO,EAAE,OAAO,GAAGA,EAAgB,GAAG;GACvC,CAAA;EACE,CAAA,CACF;;AAET"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SpinnerIconProps } from '@burdenoff/fe-libs/ui/loading/SpinnerIcon';
|
|
3
|
+
/**
|
|
4
|
+
* A drop-in for `<Loader2 className="… animate-spin" />`. Without the opt-in it IS this module's
|
|
5
|
+
* `Loader2`, with exactly the props it was given: fe-libs resolves a newer lucide-react than the
|
|
6
|
+
* module's (its icons add `aria-hidden`), so fe-libs' own `SpinnerIcon` would not draw the module's
|
|
7
|
+
* spinner byte for byte. Under the opt-in, fe-libs' `SpinnerIcon`: the compact mark, sized from
|
|
8
|
+
* the classes, `animate-spin` dropped; `tone="current"` lights it in the label's colour (a filled
|
|
9
|
+
* button).
|
|
10
|
+
*/
|
|
11
|
+
export declare function SpinnerIcon({ tone, ...props }: SpinnerIconProps): import('react').JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* A spinner the module draws itself (a CSS ring, its own svg, a turning icon): `today` exactly
|
|
14
|
+
* without the opt-in; under it, the compact mark. As fe-libs' `CompactMarkOr`, with the mark's
|
|
15
|
+
* `tone`: in a filled button it lights in the label's colour (an accent light on an accent fill
|
|
16
|
+
* would not show).
|
|
17
|
+
*/
|
|
18
|
+
export declare function CompactMarkOr({ today, className, tone, }: {
|
|
19
|
+
/** The spinner as the module draws it today. */
|
|
20
|
+
today: ReactNode;
|
|
21
|
+
/** The compact mark's classes (its size, its margins). */
|
|
22
|
+
className?: string;
|
|
23
|
+
tone?: "brand" | "current";
|
|
24
|
+
}): import('react').JSX.Element;
|
|
25
|
+
export type SkeletonBlockProps = HTMLAttributes<HTMLElement> & {
|
|
26
|
+
/** Today's element: a `span` stays a `span` (it may sit in a line of text). */
|
|
27
|
+
as?: "div" | "span";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A grey block standing in for content on its way: a drop-in for today's hand-made
|
|
31
|
+
* `<div className="… animate-pulse bg-…" />`. Without the opt-in it IS that element, with exactly
|
|
32
|
+
* the props it was given, in their order; under it, the system's skeleton (one light passing, still
|
|
33
|
+
* under reduced motion, hidden from assistive technology) in the block's size, shape and place.
|
|
34
|
+
*/
|
|
35
|
+
export declare function SkeletonBlock({ as, ...props }: SkeletonBlockProps): import('react').JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* A box that pulses as a whole around its grey blocks (today's `<div className="animate-pulse …">`
|
|
38
|
+
* with plain blocks inside): a drop-in for that element. Without the opt-in it IS that element,
|
|
39
|
+
* prop for prop; under it, the same element without the pulse (its blocks are `SkeletonBlock`s,
|
|
40
|
+
* each with the system's light).
|
|
41
|
+
*/
|
|
42
|
+
export type SkeletonGroupProps = HTMLAttributes<HTMLElement> & {
|
|
43
|
+
/** Today's element. */
|
|
44
|
+
as?: "div" | "span" | "li" | "section";
|
|
45
|
+
};
|
|
46
|
+
export declare function SkeletonGroup({ as, ...props }: SkeletonGroupProps): import('react').JSX.Element;
|
|
47
|
+
export interface SectionLoaderOrProps {
|
|
48
|
+
/** Today's loader, rendered exactly as it is without the opt-in. */
|
|
49
|
+
today: ReactNode;
|
|
50
|
+
/** What is loading, from today's words; the shell's "Loading…" when the box had none. */
|
|
51
|
+
label?: string;
|
|
52
|
+
/** Today's box height, so nothing moves when the content lands. */
|
|
53
|
+
minHeight?: string;
|
|
54
|
+
/** A page's loader (a route's code or its first data): it also runs the route wire. */
|
|
55
|
+
route?: boolean;
|
|
56
|
+
/** Where today's box sat (its grid span, margins). */
|
|
57
|
+
className?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A box that waits on content of unknown shape. Without the opt-in it is `today`, exactly; under
|
|
61
|
+
* it, fe-libs' `SectionLoader`: nothing for 300 ms, then the product's mark and the words, held at
|
|
62
|
+
* least 600 ms, in a box of today's height.
|
|
63
|
+
*/
|
|
64
|
+
export declare function SectionLoaderOr({ today, label, minHeight, route, className, }: SectionLoaderOrProps): import('react').JSX.Element;
|