@burdenoff/microfe-export 2026.1108.1 → 2026.1113.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/ExportRoot.js +45 -40
- package/dist/export/ExportRoot.js.map +1 -1
- package/dist/export/ExportRoutes.d.ts +7 -0
- package/dist/export/ExportRoutes.js +70 -51
- package/dist/export/ExportRoutes.js.map +1 -1
- package/dist/export/components/ConfirmDestructiveDialog.d.ts +21 -0
- package/dist/export/components/ConfirmDestructiveDialog.js +37 -0
- package/dist/export/components/ConfirmDestructiveDialog.js.map +1 -0
- package/dist/export/components/DownloadSections.d.ts +10 -0
- package/dist/export/components/DownloadSections.js +161 -0
- package/dist/export/components/DownloadSections.js.map +1 -0
- package/dist/export/components/DownloadStatus.d.ts +13 -0
- package/dist/export/components/DownloadStatus.js +36 -0
- package/dist/export/components/DownloadStatus.js.map +1 -0
- package/dist/export/components/DownloadsTabs.d.ts +5 -0
- package/dist/export/components/DownloadsTabs.js +25 -0
- package/dist/export/components/DownloadsTabs.js.map +1 -0
- package/dist/export/hooks/useEntityLabel.d.ts +7 -0
- package/dist/export/hooks/useEntityLabel.js +16 -0
- package/dist/export/hooks/useEntityLabel.js.map +1 -0
- package/dist/export/hooks/useExportQueries.d.ts +3 -1
- package/dist/export/hooks/useExportQueries.js +23 -23
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/navigation-v2/NavigationV2.d.ts +7 -0
- package/dist/export/navigation-v2/NavigationV2.js +16 -0
- package/dist/export/navigation-v2/NavigationV2.js.map +1 -0
- package/dist/export/pages/CreateExportPage.js +123 -121
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.js +131 -124
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/pages/ExportHistoryPage.js +61 -57
- package/dist/export/pages/ExportHistoryPage.js.map +1 -1
- package/dist/export/pages/ExportTemplatesPage.js +214 -182
- package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
- package/dist/export/pages/TemplateDetailPage.js +141 -119
- package/dist/export/pages/TemplateDetailPage.js.map +1 -1
- package/dist/export/pages/v2/DownloadDetailPage.d.ts +8 -0
- package/dist/export/pages/v2/DownloadDetailPage.js +176 -0
- package/dist/export/pages/v2/DownloadDetailPage.js.map +1 -0
- package/dist/export/pages/v2/DownloadsPage.d.ts +10 -0
- package/dist/export/pages/v2/DownloadsPage.js +401 -0
- package/dist/export/pages/v2/DownloadsPage.js.map +1 -0
- package/dist/export/pages/v2/NewDownloadPage.d.ts +8 -0
- package/dist/export/pages/v2/NewDownloadPage.js +440 -0
- package/dist/export/pages/v2/NewDownloadPage.js.map +1 -0
- package/dist/export/types/index.d.ts +7 -0
- package/dist/export/utils/billing.d.ts +6 -0
- package/dist/export/utils/billing.js +7 -0
- package/dist/export/utils/billing.js.map +1 -0
- package/dist/export/utils/downloadStatus.d.ts +15 -0
- package/dist/export/utils/downloadStatus.js +48 -0
- package/dist/export/utils/downloadStatus.js.map +1 -0
- package/dist/export/utils/entityLabels.d.ts +47 -0
- package/dist/export/utils/entityLabels.js +150 -0
- package/dist/export/utils/entityLabels.js.map +1 -0
- package/dist/export/utils/formatBytes.d.ts +2 -0
- package/dist/export/utils/formatBytes.js +15 -0
- package/dist/export/utils/formatBytes.js.map +1 -0
- package/dist/export/utils/newDownloadForm.d.ts +32 -0
- package/dist/export/utils/newDownloadForm.js +42 -0
- package/dist/export/utils/newDownloadForm.js.map +1 -0
- package/dist/export/utils/paths.d.ts +2 -0
- package/dist/export/utils/paths.js +7 -0
- package/dist/export/utils/paths.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,344 +1,376 @@
|
|
|
1
1
|
import { useExport as e } from "../providers/ExportProvider.js";
|
|
2
|
-
import { useAvailableEntities as t, useCreateExportTemplate as
|
|
3
|
-
import { PageLayout as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { useAvailableEntities as t, useCreateExportTemplate as ee, useDeleteExportTemplate as te, useExportTemplates as ne } from "../hooks/useExportQueries.js";
|
|
3
|
+
import { PageLayout as re } from "../components/PageLayout.js";
|
|
4
|
+
import { DownloadsTabs as n } from "../components/DownloadsTabs.js";
|
|
5
|
+
import { ConfirmDestructiveDialog as ie } from "../components/ConfirmDestructiveDialog.js";
|
|
6
|
+
import { useNavigationV2 as r } from "../navigation-v2/NavigationV2.js";
|
|
7
|
+
import { useEntityLabel as ae } from "../hooks/useEntityLabel.js";
|
|
8
|
+
import { isExportEntityDisabled as oe, isForeignProductEntity as se } from "../utils/disabledModules.js";
|
|
9
|
+
import { getFormatDisplayName as ce } from "../constants/enums.js";
|
|
10
|
+
import { useTr as i } from "../hooks/useTr.js";
|
|
11
|
+
import { cn as a } from "../utils/cn.js";
|
|
12
|
+
import { nativeImpact as o, nativeNotify as s } from "../../utils/nativeBridge.js";
|
|
13
|
+
import { useMemo as c, useState as l } from "react";
|
|
14
|
+
import { ChevronRight as le, FileBox as u, Loader2 as ue, Plus as d, Search as de, Sparkles as fe, X as f } from "lucide-react";
|
|
15
|
+
import { useAppShell as p } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
16
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
17
|
+
import { CTAOverflowMenu as pe, IllustratedEmptyState as me, PagePurpose as g } from "@burdenoff/fe-libs/ui";
|
|
12
18
|
// src/export/pages/ExportTemplatesPage.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let { basePath:
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
if (!
|
|
19
|
-
else if (
|
|
19
|
+
var _ = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
20
|
+
function v() {
|
|
21
|
+
let { basePath: v = "/", navigate: y } = e(), b = i(), { data: x, isLoading: S } = ne(), { deleteTemplate: he } = te(), { createTemplate: ge, isPending: C } = ee(), { data: _e } = t(), w = r(), T = ae(w), { productSlug: E } = p(), D = _e.filter((e) => e.enabled !== !1 && !oe(e.entityType) && !se(e.entityType, E)), [O, k] = l(null), [A, j] = l(!1), [M, N] = l(""), [P, F] = l(!1), [I, L] = l(""), [R, z] = l(""), [B, V] = l([]), [H, U] = l("CSV"), [W, G] = l(null), [K, q] = l(null), J = () => {
|
|
22
|
+
L(""), z(""), V([]), U("CSV"), G(null), F(!0);
|
|
23
|
+
}, Y = async () => {
|
|
24
|
+
if (!I.trim()) G(b("export.templates.form.errors.nameRequired", "Template name is required."));
|
|
25
|
+
else if (B.length === 0) G(b("export.templates.form.errors.entityRequired", "Select at least one entity type."));
|
|
20
26
|
else {
|
|
21
|
-
|
|
27
|
+
G(null);
|
|
22
28
|
try {
|
|
23
|
-
await
|
|
24
|
-
name:
|
|
25
|
-
description:
|
|
26
|
-
entityTypes:
|
|
27
|
-
format:
|
|
28
|
-
}),
|
|
29
|
+
await ge({
|
|
30
|
+
name: I.trim(),
|
|
31
|
+
description: R.trim() || void 0,
|
|
32
|
+
entityTypes: B,
|
|
33
|
+
format: H
|
|
34
|
+
}), F(!1);
|
|
29
35
|
} catch (e) {
|
|
30
|
-
|
|
36
|
+
G(e instanceof Error ? e.message : b("export.templates.form.errors.createFailed", "Failed to create template."));
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
if (!
|
|
37
|
-
let e =
|
|
38
|
-
return
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
}, ve = (e) => {
|
|
40
|
+
V((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
41
|
+
}, X = c(() => {
|
|
42
|
+
if (!M) return x;
|
|
43
|
+
let e = M.toLowerCase();
|
|
44
|
+
return x.filter((t) => t.name.toLowerCase().includes(e) || t.entityTypes.some((t) => t.toLowerCase().includes(e) || T(t).toLowerCase().includes(e)));
|
|
45
|
+
}, [
|
|
46
|
+
x,
|
|
47
|
+
M,
|
|
48
|
+
T
|
|
49
|
+
]), Z = (e) => {
|
|
50
|
+
y?.(_(v, `templates/${e}`));
|
|
51
|
+
}, ye = async (e, t) => {
|
|
52
|
+
e.stopPropagation(), o("medium"), q(t);
|
|
53
|
+
}, Q = () => {
|
|
54
|
+
q(null), k(null);
|
|
55
|
+
}, $ = async () => {
|
|
56
|
+
if (K) {
|
|
57
|
+
k(null), j(!0);
|
|
45
58
|
try {
|
|
46
|
-
await
|
|
47
|
-
} catch {
|
|
48
|
-
|
|
59
|
+
await he(K), s("success"), q(null);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
s("error"), k(e instanceof Error && e.message ? e.message : b("export.templates.delete.failed", "Couldn't delete this template. Try again."));
|
|
62
|
+
} finally {
|
|
63
|
+
j(!1);
|
|
49
64
|
}
|
|
50
|
-
J(null);
|
|
51
65
|
}
|
|
52
|
-
};
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
title:
|
|
55
|
-
subtitle:
|
|
56
|
-
icon: /* @__PURE__ */
|
|
57
|
-
headerActions: /* @__PURE__ */
|
|
66
|
+
}, be = x.find((e) => e.id === K)?.name ?? "";
|
|
67
|
+
return /* @__PURE__ */ h(re, {
|
|
68
|
+
title: b("export.templates.title", "Export Templates"),
|
|
69
|
+
subtitle: b("export.templates.subtitle", "Reusable export configurations for common data exports"),
|
|
70
|
+
icon: /* @__PURE__ */ m(u, { size: 24 }),
|
|
71
|
+
headerActions: /* @__PURE__ */ m(pe, {
|
|
58
72
|
primary: {
|
|
59
|
-
label:
|
|
60
|
-
icon: /* @__PURE__ */
|
|
61
|
-
onSelect:
|
|
73
|
+
label: b("export.templates.actions.newTemplate", "New Template"),
|
|
74
|
+
icon: /* @__PURE__ */ m(d, { size: 16 }),
|
|
75
|
+
onSelect: J
|
|
62
76
|
},
|
|
63
77
|
actions: [{
|
|
64
|
-
label:
|
|
65
|
-
icon: /* @__PURE__ */
|
|
66
|
-
onSelect: () =>
|
|
78
|
+
label: b("export.templates.actions.newExport", "New Export"),
|
|
79
|
+
icon: /* @__PURE__ */ m(d, { size: 16 }),
|
|
80
|
+
onSelect: () => y?.(_(v, "new"))
|
|
67
81
|
}]
|
|
68
82
|
}),
|
|
69
|
-
headerContent: /* @__PURE__ */
|
|
83
|
+
headerContent: /* @__PURE__ */ h("span", {
|
|
70
84
|
className: "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
-
count:
|
|
73
|
-
suffix:
|
|
85
|
+
children: [/* @__PURE__ */ m(fe, { size: 12 }), w ? X.length === 1 ? b("export.templates.summary.one", "1 setup") : b("export.templates.summary.other", "{{count}} setups", { count: X.length }) : b("export.templates.summary.available", "{{count}} template{{suffix}} available", {
|
|
86
|
+
count: X.length,
|
|
87
|
+
suffix: X.length === 1 ? "" : "s"
|
|
74
88
|
})]
|
|
75
89
|
}),
|
|
76
90
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
79
|
-
|
|
91
|
+
w && /* @__PURE__ */ m(n, {}),
|
|
92
|
+
/* @__PURE__ */ m(g, {
|
|
93
|
+
icon: /* @__PURE__ */ m(u, { size: 16 }),
|
|
94
|
+
children: b("export.templates.purpose", "Templates save an export setup — the entity types and format you regularly need — so you don't rebuild it each time. Create one here, then start a new export from it in a single click. Handy for recurring backups, periodic audits, or any export you run more than once.")
|
|
80
95
|
}),
|
|
81
|
-
|
|
96
|
+
P && /* @__PURE__ */ h("div", {
|
|
82
97
|
className: "border border-primary/30 rounded-xl p-6 bg-accent-wash space-y-4",
|
|
83
98
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ h("div", {
|
|
85
100
|
className: "flex items-center justify-between",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
87
102
|
className: "font-semibold text-lg",
|
|
88
|
-
children:
|
|
89
|
-
}), /* @__PURE__ */
|
|
103
|
+
children: b("export.templates.form.title", "New Template")
|
|
104
|
+
}), /* @__PURE__ */ m("button", {
|
|
90
105
|
type: "button",
|
|
91
|
-
onClick: () =>
|
|
106
|
+
onClick: () => F(!1),
|
|
92
107
|
className: "p-1.5 rounded-md hover:bg-accent",
|
|
93
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ m(f, { size: 16 })
|
|
94
109
|
})]
|
|
95
110
|
}),
|
|
96
|
-
|
|
111
|
+
W && /* @__PURE__ */ m("p", {
|
|
97
112
|
className: "text-sm text-status-error-text bg-status-error-bg/10 rounded-lg px-3 py-2",
|
|
98
|
-
children:
|
|
113
|
+
children: W
|
|
99
114
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ h("div", {
|
|
101
116
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ h("div", {
|
|
103
118
|
className: "space-y-1",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ h("label", {
|
|
105
120
|
className: "text-sm font-medium",
|
|
106
|
-
children: [
|
|
107
|
-
}), /* @__PURE__ */
|
|
121
|
+
children: [b("export.templates.form.fields.name", "Name"), " *"]
|
|
122
|
+
}), /* @__PURE__ */ m("input", {
|
|
108
123
|
type: "text",
|
|
109
|
-
"aria-label":
|
|
110
|
-
placeholder:
|
|
111
|
-
value:
|
|
112
|
-
onChange: (e) =>
|
|
124
|
+
"aria-label": b("export.templates.form.fields.name", "Name"),
|
|
125
|
+
placeholder: b("export.templates.form.fields.namePlaceholder", "e.g. Weekly Tags Export"),
|
|
126
|
+
value: I,
|
|
127
|
+
onChange: (e) => L(e.target.value),
|
|
113
128
|
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all"
|
|
114
129
|
})]
|
|
115
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ h("div", {
|
|
116
131
|
className: "space-y-1",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ h("label", {
|
|
118
133
|
className: "text-sm font-medium",
|
|
119
|
-
children: [
|
|
120
|
-
}), /* @__PURE__ */
|
|
121
|
-
value:
|
|
122
|
-
onChange: (e) =>
|
|
134
|
+
children: [b("export.templates.form.fields.format", "Format"), " *"]
|
|
135
|
+
}), /* @__PURE__ */ h("select", {
|
|
136
|
+
value: H,
|
|
137
|
+
onChange: (e) => U(e.target.value),
|
|
123
138
|
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ m("option", {
|
|
125
140
|
value: "CSV",
|
|
126
|
-
children:
|
|
127
|
-
}), /* @__PURE__ */
|
|
141
|
+
children: b("export.format.csv", "CSV")
|
|
142
|
+
}), /* @__PURE__ */ m("option", {
|
|
128
143
|
value: "JSON",
|
|
129
|
-
children:
|
|
144
|
+
children: b("export.format.json", "JSON")
|
|
130
145
|
})]
|
|
131
146
|
})]
|
|
132
147
|
})]
|
|
133
148
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ h("div", {
|
|
135
150
|
className: "space-y-1",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ m("label", {
|
|
137
152
|
className: "text-sm font-medium",
|
|
138
|
-
children:
|
|
139
|
-
}), /* @__PURE__ */
|
|
153
|
+
children: b("export.templates.form.fields.description", "Description")
|
|
154
|
+
}), /* @__PURE__ */ m("input", {
|
|
140
155
|
type: "text",
|
|
141
|
-
"aria-label":
|
|
142
|
-
placeholder:
|
|
143
|
-
value:
|
|
144
|
-
onChange: (e) =>
|
|
156
|
+
"aria-label": b("export.templates.form.fields.description", "Description"),
|
|
157
|
+
placeholder: b("export.templates.form.fields.descriptionPlaceholder", "Optional description"),
|
|
158
|
+
value: R,
|
|
159
|
+
onChange: (e) => z(e.target.value),
|
|
145
160
|
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all"
|
|
146
161
|
})]
|
|
147
162
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ h("div", {
|
|
149
164
|
className: "space-y-2",
|
|
150
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ h("label", {
|
|
151
166
|
className: "text-sm font-medium",
|
|
152
167
|
children: [
|
|
153
|
-
|
|
168
|
+
b("export.templates.form.fields.entityTypes", "Entity Types"),
|
|
154
169
|
" *",
|
|
155
170
|
" ",
|
|
156
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ m("span", {
|
|
157
172
|
className: "text-text-secondary font-normal",
|
|
158
|
-
children:
|
|
173
|
+
children: b("export.templates.form.fields.entityTypesHint", "(select at least one)")
|
|
159
174
|
})
|
|
160
175
|
]
|
|
161
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ m("div", {
|
|
162
177
|
className: "flex flex-wrap gap-2",
|
|
163
|
-
children:
|
|
178
|
+
children: D.map((e) => /* @__PURE__ */ m("button", {
|
|
164
179
|
type: "button",
|
|
165
|
-
onClick: () =>
|
|
166
|
-
className:
|
|
167
|
-
children: e.displayName
|
|
180
|
+
onClick: () => ve(e.entityType),
|
|
181
|
+
className: a("px-3 py-1.5 rounded-lg text-sm font-medium border-2 transition-all", B.includes(e.entityType) ? "border-primary bg-action-primary-bg/10 text-primary" : "border-border-subtle bg-bg-surface hover:border-primary/50"),
|
|
182
|
+
children: w ? T(e.entityType) : e.displayName
|
|
168
183
|
}, e.entityType))
|
|
169
184
|
})]
|
|
170
185
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ h("div", {
|
|
172
187
|
className: "flex gap-3 pt-2",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ h("button", {
|
|
174
189
|
type: "button",
|
|
175
|
-
onClick:
|
|
176
|
-
disabled:
|
|
190
|
+
onClick: Y,
|
|
191
|
+
disabled: C,
|
|
177
192
|
className: "inline-flex items-center gap-2 px-5 py-2.5 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors font-medium disabled:opacity-50",
|
|
178
|
-
children: [
|
|
193
|
+
children: [C ? /* @__PURE__ */ m(ue, {
|
|
179
194
|
size: 16,
|
|
180
195
|
className: "animate-spin"
|
|
181
|
-
}) : /* @__PURE__ */
|
|
182
|
-
}), /* @__PURE__ */
|
|
196
|
+
}) : /* @__PURE__ */ m(d, { size: 16 }), b("export.templates.form.actions.create", "Create Template")]
|
|
197
|
+
}), /* @__PURE__ */ m("button", {
|
|
183
198
|
type: "button",
|
|
184
|
-
onClick: () =>
|
|
199
|
+
onClick: () => F(!1),
|
|
185
200
|
className: "px-5 py-2.5 border-2 border-border-subtle rounded-lg hover:bg-accent transition-colors font-medium",
|
|
186
|
-
children:
|
|
201
|
+
children: b("export.templates.form.actions.cancel", "Cancel")
|
|
187
202
|
})]
|
|
188
203
|
})
|
|
189
204
|
]
|
|
190
205
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ h("div", {
|
|
192
207
|
className: "relative group",
|
|
193
208
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ m(de, {
|
|
195
210
|
size: 18,
|
|
196
211
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors"
|
|
197
212
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ m("input", {
|
|
199
214
|
type: "text",
|
|
200
|
-
"aria-label":
|
|
201
|
-
placeholder:
|
|
202
|
-
value:
|
|
203
|
-
onChange: (e) =>
|
|
215
|
+
"aria-label": b("export.templates.search.placeholder", "Search templates"),
|
|
216
|
+
placeholder: b("export.templates.search.placeholder", "Search templates..."),
|
|
217
|
+
value: M,
|
|
218
|
+
onChange: (e) => N(e.target.value),
|
|
204
219
|
className: "w-full pl-[3.25rem] pr-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200"
|
|
205
220
|
}),
|
|
206
|
-
|
|
221
|
+
M && /* @__PURE__ */ m("button", {
|
|
207
222
|
type: "button",
|
|
208
|
-
onClick: () =>
|
|
223
|
+
onClick: () => N(""),
|
|
209
224
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 rounded-md text-text-secondary hover:text-text-primary hover:bg-accent",
|
|
210
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ m(f, { size: 16 })
|
|
211
226
|
})
|
|
212
227
|
]
|
|
213
228
|
}),
|
|
214
|
-
|
|
229
|
+
S && /* @__PURE__ */ m("div", {
|
|
215
230
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
|
|
216
231
|
children: [...[
|
|
217
232
|
,
|
|
218
233
|
,
|
|
219
234
|
,
|
|
220
235
|
,
|
|
221
|
-
]].map((e, t) => /* @__PURE__ */
|
|
236
|
+
]].map((e, t) => /* @__PURE__ */ h("div", {
|
|
222
237
|
className: "border border-border-seam rounded-xl p-5",
|
|
223
238
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ m("div", { className: "h-5 w-40 bg-bg-sunken rounded mb-3 animate-vc-shimmer" }),
|
|
240
|
+
/* @__PURE__ */ m("div", { className: "h-3 w-full bg-bg-sunken rounded mb-2 animate-vc-shimmer" }),
|
|
241
|
+
/* @__PURE__ */ h("div", {
|
|
227
242
|
className: "flex gap-2 mt-4",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ m("div", { className: "h-5 w-16 bg-bg-sunken rounded-full animate-vc-shimmer" }), /* @__PURE__ */ m("div", { className: "h-5 w-16 bg-bg-sunken rounded-full animate-vc-shimmer" })]
|
|
229
244
|
})
|
|
230
245
|
]
|
|
231
246
|
}, t))
|
|
232
247
|
}),
|
|
233
|
-
|
|
248
|
+
S ? null : X.length > 0 ? /* @__PURE__ */ m("div", {
|
|
234
249
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
|
|
235
|
-
children:
|
|
250
|
+
children: X.map((e, t) => /* @__PURE__ */ h("div", {
|
|
236
251
|
role: "button",
|
|
237
252
|
tabIndex: 0,
|
|
238
|
-
onClick: () =>
|
|
253
|
+
onClick: () => Z(e.id),
|
|
239
254
|
onKeyDown: (t) => {
|
|
240
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
255
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), Z(e.id));
|
|
241
256
|
},
|
|
242
|
-
className:
|
|
257
|
+
className: a("text-left group cursor-pointer border border-border-seam rounded-xl overflow-hidden bg-bg-surface", "hover:border-primary/40 shadow-[var(--shadow-pop)] transition-colors duration-200", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40", "animate-in fade-in-0"),
|
|
243
258
|
style: { animationDelay: `${t * 50}ms` },
|
|
244
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ m("div", {
|
|
245
260
|
className: "p-4 border-b bg-bg-sunken/30",
|
|
246
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ h("div", {
|
|
247
262
|
className: "flex items-start justify-between",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ h("div", {
|
|
249
264
|
className: "flex items-center gap-3",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ m("div", {
|
|
251
266
|
className: "p-2 rounded-lg bg-action-primary-bg/10",
|
|
252
|
-
children: /* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ m(u, {
|
|
253
268
|
size: 20,
|
|
254
269
|
className: "text-primary"
|
|
255
270
|
})
|
|
256
|
-
}), /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h3", {
|
|
257
272
|
className: "font-semibold",
|
|
258
273
|
children: e.name
|
|
259
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ h("p", {
|
|
260
275
|
className: "text-xs text-text-secondary",
|
|
261
|
-
children: [
|
|
276
|
+
children: [ce(e.format), e.isDefault && /* @__PURE__ */ m("span", {
|
|
262
277
|
className: "ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-xs bg-action-primary-bg/10 text-primary font-medium",
|
|
263
|
-
children:
|
|
278
|
+
children: b("export.templates.card.default", "Default")
|
|
264
279
|
})]
|
|
265
280
|
})] })]
|
|
266
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ h("div", {
|
|
267
282
|
className: "flex items-center gap-2",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ m("button", {
|
|
269
284
|
type: "button",
|
|
270
|
-
onClick: (t) =>
|
|
285
|
+
onClick: (t) => ye(t, e.id),
|
|
271
286
|
className: "p-1.5 rounded-md text-text-secondary hover:text-status-error-text hover:bg-status-error-bg/10 transition-colors",
|
|
272
|
-
"aria-label":
|
|
273
|
-
children: /* @__PURE__ */
|
|
274
|
-
}), /* @__PURE__ */
|
|
287
|
+
"aria-label": b("export.templates.card.deleteAriaLabel", "Delete {{name}}", { name: e.name }),
|
|
288
|
+
children: /* @__PURE__ */ m(f, { size: 14 })
|
|
289
|
+
}), /* @__PURE__ */ m(le, {
|
|
275
290
|
size: 18,
|
|
276
291
|
className: "text-text-secondary group-hover:text-primary transition-colors mt-1"
|
|
277
292
|
})]
|
|
278
293
|
})]
|
|
279
294
|
})
|
|
280
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ h("div", {
|
|
281
296
|
className: "p-4",
|
|
282
|
-
children: [e.description && /* @__PURE__ */
|
|
297
|
+
children: [e.description && /* @__PURE__ */ m("p", {
|
|
283
298
|
className: "text-sm text-text-secondary mb-3 line-clamp-2",
|
|
284
299
|
children: e.description
|
|
285
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ h("div", {
|
|
286
301
|
className: "flex flex-wrap gap-1.5 overflow-hidden",
|
|
287
|
-
children: [e.entityTypes.slice(0, 6).map((e) => /* @__PURE__ */
|
|
302
|
+
children: [e.entityTypes.slice(0, 6).map((e) => /* @__PURE__ */ m("span", {
|
|
288
303
|
className: "inline-flex px-2 py-0.5 rounded text-xs font-medium bg-bg-sunken text-text-secondary max-w-full truncate",
|
|
289
|
-
children: e
|
|
290
|
-
}, e)), e.entityTypes.length > 6 && /* @__PURE__ */
|
|
304
|
+
children: T(e)
|
|
305
|
+
}, e)), e.entityTypes.length > 6 && /* @__PURE__ */ m("span", {
|
|
291
306
|
className: "inline-flex px-2 py-0.5 rounded text-xs font-medium bg-bg-sunken text-text-secondary",
|
|
292
|
-
children:
|
|
307
|
+
children: b("export.templates.card.moreEntities", "+{{count}} more", { count: e.entityTypes.length - 6 })
|
|
293
308
|
})]
|
|
294
309
|
})]
|
|
295
310
|
})]
|
|
296
311
|
}, e.id))
|
|
297
|
-
}) : /* @__PURE__ */
|
|
298
|
-
illustration:
|
|
299
|
-
title:
|
|
300
|
-
description:
|
|
301
|
-
action:
|
|
312
|
+
}) : /* @__PURE__ */ m(me, {
|
|
313
|
+
illustration: M ? "empty-search" : "empty-data",
|
|
314
|
+
title: M ? b("export.templates.empty.filtered.title", "No matching templates") : b("export.templates.empty.title", "No templates yet"),
|
|
315
|
+
description: M ? b("export.templates.empty.filtered.description", "Try adjusting your search to find what you are looking for.") : b("export.templates.empty.description", "Create a template to save reusable export configurations."),
|
|
316
|
+
action: M ? /* @__PURE__ */ h("button", {
|
|
302
317
|
type: "button",
|
|
303
|
-
onClick: () =>
|
|
318
|
+
onClick: () => N(""),
|
|
304
319
|
className: "inline-flex items-center gap-2 px-4 py-2 border-2 border-border-subtle rounded-lg hover:bg-accent transition-colors font-medium",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
306
|
-
}) : /* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ m(f, { size: 16 }), b("export.templates.empty.filtered.actions.clear", "Clear Search")]
|
|
321
|
+
}) : /* @__PURE__ */ h("button", {
|
|
307
322
|
type: "button",
|
|
308
|
-
onClick:
|
|
323
|
+
onClick: J,
|
|
309
324
|
className: "inline-flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors font-medium",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ m(d, { size: 16 }), b("export.templates.empty.actions.newTemplate", "New Template")]
|
|
311
326
|
})
|
|
312
327
|
}),
|
|
313
|
-
|
|
328
|
+
w ? /* @__PURE__ */ m(ie, {
|
|
329
|
+
open: K !== null,
|
|
330
|
+
onOpenChange: (e) => {
|
|
331
|
+
e || Q();
|
|
332
|
+
},
|
|
333
|
+
title: b("export.templates.delete.named", "Delete “{{name}}”?", { name: be }),
|
|
334
|
+
description: b("export.templates.delete.description", "This removes the saved export configuration. Existing export jobs are not deleted."),
|
|
335
|
+
confirmLabel: b("export.templates.delete.confirmAction", "Delete Template"),
|
|
336
|
+
keepLabel: b("export.templates.delete.cancel", "Keep Template"),
|
|
337
|
+
busy: A,
|
|
338
|
+
error: O,
|
|
339
|
+
onConfirm: () => void $()
|
|
340
|
+
}) : K && /* @__PURE__ */ m("div", {
|
|
314
341
|
role: "dialog",
|
|
315
342
|
"aria-modal": "true",
|
|
316
343
|
"aria-labelledby": "template-list-delete-title",
|
|
317
344
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-surface/80 backdrop-blur-sm p-4",
|
|
318
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ h("div", {
|
|
319
346
|
className: "w-full max-w-md rounded-xl border-2 border-border-subtle bg-bg-surface p-6 shadow-xl",
|
|
320
347
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ m("h2", {
|
|
322
349
|
id: "template-list-delete-title",
|
|
323
350
|
className: "text-lg font-bold",
|
|
324
|
-
children:
|
|
351
|
+
children: b("export.templates.delete.title", "Delete template?")
|
|
325
352
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ m("p", {
|
|
327
354
|
className: "mt-2 text-sm text-text-secondary",
|
|
328
|
-
children:
|
|
355
|
+
children: b("export.templates.delete.description", "This removes the saved export configuration. Existing export jobs are not deleted.")
|
|
356
|
+
}),
|
|
357
|
+
O && /* @__PURE__ */ m("p", {
|
|
358
|
+
role: "alert",
|
|
359
|
+
className: "mt-3 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
360
|
+
children: O
|
|
329
361
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ h("div", {
|
|
331
363
|
className: "mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
364
|
+
children: [/* @__PURE__ */ m("button", {
|
|
333
365
|
type: "button",
|
|
334
|
-
onClick:
|
|
366
|
+
onClick: Q,
|
|
335
367
|
className: "px-4 py-2 rounded-lg border-2 border-border-subtle hover:bg-accent transition-colors font-medium",
|
|
336
|
-
children:
|
|
337
|
-
}), /* @__PURE__ */
|
|
368
|
+
children: b("export.templates.delete.cancel", "Keep Template")
|
|
369
|
+
}), /* @__PURE__ */ m("button", {
|
|
338
370
|
type: "button",
|
|
339
|
-
onClick:
|
|
371
|
+
onClick: $,
|
|
340
372
|
className: "px-4 py-2 rounded-lg bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90 transition-colors font-medium",
|
|
341
|
-
children:
|
|
373
|
+
children: b("export.templates.delete.confirmAction", "Delete Template")
|
|
342
374
|
})]
|
|
343
375
|
})
|
|
344
376
|
]
|
|
@@ -347,6 +379,6 @@ function w() {
|
|
|
347
379
|
]
|
|
348
380
|
});
|
|
349
381
|
}
|
|
350
|
-
export {
|
|
382
|
+
export { v as ExportTemplatesPage };
|
|
351
383
|
|
|
352
384
|
//# sourceMappingURL=ExportTemplatesPage.js.map
|