@burdenoff/microfe-export 2026.1124.2 → 2026.1125.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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.d.ts +12 -12
- package/dist/export/hooks/useExportQueries.js +166 -156
- 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/dist/export/workspace-v2/NewDownloadDialog.js +1 -1
- package/dist/export/workspace-v2/NewDownloadDialog.js.map +1 -1
- package/dist/export/workspace-v2/useExportAccess.d.ts +2 -2
- package/dist/export/workspace-v2/useExportAccess.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +0 -42
- package/dist/generated/wspace-operations.js +6 -16
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportTemplatesPage.js","names":["joinPath","base","path","ExportTemplatesPage","useExport","tr","useTr","templates","useExportTemplates","useDeleteExportTemplate","creating","useCreateExportTemplate","availableEntities","useAvailableEntities","navigationV2","useNavigationV2","label","useEntityLabel","hostProductSlug","useAppShell","selectableEntities","isExportEntityDisabled","isForeignProductEntity","deleteError","setDeleteError","useState","deletingTemplate","setDeletingTemplate","searchQuery","setSearchQuery","showCreateForm","setShowCreateForm","newTemplateName","setNewTemplateName","newTemplateDescription","setNewTemplateDescription","newTemplateEntityTypes","setNewTemplateEntityTypes","newTemplateFormat","setNewTemplateFormat","createError","setCreateError","templatePendingDelete","setTemplatePendingDelete","handleOpenCreate","handleCreateTemplate","createTemplate","err","toggleEntity","prev","entityType","e","filteredTemplates","useMemo","q","handleTemplateClick","basePath","templateId","handleDeleteTemplate","nativeImpact","closeDeleteConfirm","confirmDeleteTemplate","deleteTemplate","nativeNotify","pendingTemplateName","t","PageLayout","FileBox","CTAOverflowMenu","Plus","navigate","Sparkles","DownloadsTabs","PagePurpose","X","ThemedSelect","entity","cn","Loader2","Search","isLoading","i","template","index","getFormatDisplayName","ChevronRight","IllustratedEmptyState","ConfirmDestructiveDialog","open"],"sources":["../../../src/export/pages/ExportTemplatesPage.tsx"],"sourcesContent":["import { useState, useMemo } from \"react\";\nimport {\n Search,\n X,\n FileBox,\n Plus,\n ChevronRight,\n Sparkles,\n Loader2,\n} from \"lucide-react\";\nimport {\n CTAOverflowMenu,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport {\n useExportTemplates,\n useDeleteExportTemplate,\n useCreateExportTemplate,\n useAvailableEntities,\n} from \"../hooks/useExportQueries\";\nimport { PageLayout } from \"../components/PageLayout\";\nimport { DownloadsTabs } from \"../components/DownloadsTabs\";\nimport { ConfirmDestructiveDialog } from \"../components/ConfirmDestructiveDialog\";\nimport { useNavigationV2 } from \"../navigation-v2/NavigationV2\";\nimport { useEntityLabel } from \"../hooks/useEntityLabel\";\nimport { useAppShell } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport {\n isExportEntityDisabled,\n isForeignProductEntity,\n} from \"../utils/disabledModules\";\nimport { getFormatDisplayName } from \"../constants/enums\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport type { ExportFormat } from \"../types\";\nimport { nativeImpact, nativeNotify } from \"../../utils/nativeBridge\";\n\n/**\n * Helper to join paths correctly\n */\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\n/**\n * Export Templates Page\n * Template management list for reusable export configurations\n */\nexport function ExportTemplatesPage() {\n const { basePath = \"/\", navigate } = useExport();\n const tr = useTr();\n const { data: templates, isLoading } = useExportTemplates();\n const { deleteTemplate } = useDeleteExportTemplate();\n const { createTemplate, isPending: creating } = useCreateExportTemplate();\n const { data: availableEntities } = useAvailableEntities();\n const navigationV2 = useNavigationV2();\n const label = useEntityLabel(navigationV2);\n const { productSlug: hostProductSlug } = useAppShell();\n // The new-setup form offers only what \"New export\" itself can select in this\n // shell: not other products' entity types, not products whose export isn't\n // available yet, and not entity types the service marks disabled.\n const selectableEntities = availableEntities.filter(\n (e) =>\n e.enabled !== false &&\n !isExportEntityDisabled(e.entityType) &&\n !isForeignProductEntity(e.entityType, hostProductSlug),\n );\n const [deleteError, setDeleteError] = useState<string | null>(null);\n const [deletingTemplate, setDeletingTemplate] = useState(false);\n\n const [searchQuery, setSearchQuery] = useState(\"\");\n const [showCreateForm, setShowCreateForm] = useState(false);\n const [newTemplateName, setNewTemplateName] = useState(\"\");\n const [newTemplateDescription, setNewTemplateDescription] = useState(\"\");\n const [newTemplateEntityTypes, setNewTemplateEntityTypes] = useState<\n string[]\n >([]);\n const [newTemplateFormat, setNewTemplateFormat] =\n useState<ExportFormat>(\"CSV\");\n const [createError, setCreateError] = useState<string | null>(null);\n const [templatePendingDelete, setTemplatePendingDelete] = useState<\n string | null\n >(null);\n\n const handleOpenCreate = () => {\n setNewTemplateName(\"\");\n setNewTemplateDescription(\"\");\n setNewTemplateEntityTypes([]);\n setNewTemplateFormat(\"CSV\");\n setCreateError(null);\n setShowCreateForm(true);\n };\n\n const handleCreateTemplate = async () => {\n if (!newTemplateName.trim()) {\n setCreateError(\n tr(\n \"export.templates.form.errors.nameRequired\",\n \"Template name is required.\",\n ),\n );\n return;\n }\n if (newTemplateEntityTypes.length === 0) {\n setCreateError(\n tr(\n \"export.templates.form.errors.entityRequired\",\n \"Select at least one entity type.\",\n ),\n );\n return;\n }\n setCreateError(null);\n try {\n await createTemplate({\n name: newTemplateName.trim(),\n description: newTemplateDescription.trim() || undefined,\n entityTypes: newTemplateEntityTypes,\n format: newTemplateFormat,\n });\n setShowCreateForm(false);\n } catch (err) {\n setCreateError(\n err instanceof Error\n ? err.message\n : tr(\n \"export.templates.form.errors.createFailed\",\n \"Failed to create template.\",\n ),\n );\n }\n };\n\n const toggleEntity = (entityType: string) => {\n setNewTemplateEntityTypes((prev) =>\n prev.includes(entityType)\n ? prev.filter((e) => e !== entityType)\n : [...prev, entityType],\n );\n };\n\n // Client-side search filter\n const filteredTemplates = useMemo(() => {\n if (!searchQuery) return templates;\n const q = searchQuery.toLowerCase();\n return templates.filter(\n (t) =>\n t.name.toLowerCase().includes(q) ||\n t.entityTypes.some(\n (e) =>\n e.toLowerCase().includes(q) || label(e).toLowerCase().includes(q),\n ),\n );\n }, [templates, searchQuery, label]);\n\n const handleTemplateClick = (templateId: string) => {\n navigate?.(joinPath(basePath, `templates/${templateId}`));\n };\n\n const handleDeleteTemplate = async (\n e: React.MouseEvent,\n templateId: string,\n ) => {\n e.stopPropagation();\n nativeImpact(\"medium\");\n setTemplatePendingDelete(templateId);\n };\n\n const closeDeleteConfirm = () => {\n setTemplatePendingDelete(null);\n setDeleteError(null);\n };\n\n const confirmDeleteTemplate = async () => {\n if (!templatePendingDelete) return;\n setDeleteError(null);\n setDeletingTemplate(true);\n try {\n await deleteTemplate(templatePendingDelete);\n nativeNotify(\"success\");\n setTemplatePendingDelete(null);\n } catch (err) {\n nativeNotify(\"error\");\n // Say why and keep the confirm open, instead of closing it silently.\n setDeleteError(\n err instanceof Error && err.message\n ? err.message\n : tr(\n \"export.templates.delete.failed\",\n \"Couldn't delete this template. Try again.\",\n ),\n );\n } finally {\n setDeletingTemplate(false);\n }\n };\n\n const pendingTemplateName =\n templates.find((t) => t.id === templatePendingDelete)?.name ?? \"\";\n\n return (\n <PageLayout\n title={tr(\"export.templates.title\", \"Export Templates\")}\n subtitle={tr(\n \"export.templates.subtitle\",\n \"Reusable export configurations for common data exports\",\n )}\n icon={<FileBox size={24} />}\n headerActions={\n <CTAOverflowMenu\n primary={{\n label: tr(\"export.templates.actions.newTemplate\", \"New Template\"),\n icon: <Plus size={16} />,\n onSelect: handleOpenCreate,\n }}\n actions={[\n {\n label: tr(\"export.templates.actions.newExport\", \"New Export\"),\n icon: <Plus size={16} />,\n onSelect: () => navigate?.(joinPath(basePath, \"new\")),\n },\n ]}\n />\n }\n headerContent={\n <span 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\">\n <Sparkles size={12} />\n {navigationV2\n ? filteredTemplates.length === 1\n ? tr(\"export.templates.summary.one\", \"1 setup\")\n : tr(\"export.templates.summary.other\", \"{{count}} setups\", {\n count: filteredTemplates.length,\n })\n : tr(\n \"export.templates.summary.available\",\n \"{{count}} template{{suffix}} available\",\n {\n count: filteredTemplates.length,\n suffix: filteredTemplates.length !== 1 ? \"s\" : \"\",\n },\n )}\n </span>\n }\n >\n {navigationV2 && <DownloadsTabs />}\n {/* Page purpose — why templates exist */}\n <PagePurpose icon={<FileBox size={16} />}>\n {tr(\n \"export.templates.purpose\",\n \"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.\",\n )}\n </PagePurpose>\n\n {/* Create Template Form */}\n {showCreateForm && (\n <div className=\"border border-primary/30 rounded-xl p-6 bg-accent-wash space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-semibold text-lg\">\n {tr(\"export.templates.form.title\", \"New Template\")}\n </h3>\n <button\n type=\"button\"\n onClick={() => setShowCreateForm(false)}\n className=\"p-1.5 rounded-md hover:bg-accent\"\n >\n <X size={16} />\n </button>\n </div>\n {createError && (\n <p className=\"text-sm text-status-error-text bg-status-error-bg/10 rounded-lg px-3 py-2\">\n {createError}\n </p>\n )}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-1\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.name\", \"Name\")} *\n </label>\n <input\n type=\"text\"\n aria-label={tr(\"export.templates.form.fields.name\", \"Name\")}\n placeholder={tr(\n \"export.templates.form.fields.namePlaceholder\",\n \"e.g. Weekly Tags Export\",\n )}\n value={newTemplateName}\n onChange={(e) => setNewTemplateName(e.target.value)}\n 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\"\n />\n </div>\n <div className=\"space-y-1\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.format\", \"Format\")} *\n </label>\n <ThemedSelect\n value={newTemplateFormat}\n onChange={(e) =>\n setNewTemplateFormat(e.target.value as ExportFormat)\n }\n 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\"\n >\n <option value=\"CSV\">{tr(\"export.format.csv\", \"CSV\")}</option>\n <option value=\"JSON\">{tr(\"export.format.json\", \"JSON\")}</option>\n </ThemedSelect>\n </div>\n </div>\n <div className=\"space-y-1\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.description\", \"Description\")}\n </label>\n <input\n type=\"text\"\n aria-label={tr(\n \"export.templates.form.fields.description\",\n \"Description\",\n )}\n placeholder={tr(\n \"export.templates.form.fields.descriptionPlaceholder\",\n \"Optional description\",\n )}\n value={newTemplateDescription}\n onChange={(e) => setNewTemplateDescription(e.target.value)}\n 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\"\n />\n </div>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.entityTypes\", \"Entity Types\")} *{\" \"}\n <span className=\"text-text-secondary font-normal\">\n {tr(\n \"export.templates.form.fields.entityTypesHint\",\n \"(select at least one)\",\n )}\n </span>\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {selectableEntities.map((entity) => (\n <button\n key={entity.entityType}\n type=\"button\"\n onClick={() => toggleEntity(entity.entityType)}\n className={cn(\n \"px-3 py-1.5 rounded-lg text-sm font-medium border-2 transition-all\",\n newTemplateEntityTypes.includes(entity.entityType)\n ? \"border-primary bg-action-primary-bg/10 text-primary\"\n : \"border-border-subtle bg-bg-surface hover:border-primary/50\",\n )}\n >\n {navigationV2 ? label(entity.entityType) : entity.displayName}\n </button>\n ))}\n </div>\n </div>\n <div className=\"flex gap-3 pt-2\">\n <button\n type=\"button\"\n onClick={handleCreateTemplate}\n disabled={creating}\n 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\"\n >\n {creating ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <Plus size={16} />\n )}\n {tr(\"export.templates.form.actions.create\", \"Create Template\")}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowCreateForm(false)}\n className=\"px-5 py-2.5 border-2 border-border-subtle rounded-lg hover:bg-accent transition-colors font-medium\"\n >\n {tr(\"export.templates.form.actions.cancel\", \"Cancel\")}\n </button>\n </div>\n </div>\n )}\n {/* Search */}\n <div className=\"relative group\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n aria-label={tr(\n \"export.templates.search.placeholder\",\n \"Search templates\",\n )}\n placeholder={tr(\n \"export.templates.search.placeholder\",\n \"Search templates...\",\n )}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n 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\"\n />\n {searchQuery && (\n <button\n type=\"button\"\n onClick={() => setSearchQuery(\"\")}\n 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\"\n >\n <X size={16} />\n </button>\n )}\n </div>\n\n {/* Loading */}\n {isLoading && (\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"border border-border-seam rounded-xl p-5\">\n <div className=\"h-5 w-40 bg-bg-sunken rounded mb-3 animate-vc-shimmer\" />\n <div className=\"h-3 w-full bg-bg-sunken rounded mb-2 animate-vc-shimmer\" />\n <div className=\"flex gap-2 mt-4\">\n <div className=\"h-5 w-16 bg-bg-sunken rounded-full animate-vc-shimmer\" />\n <div className=\"h-5 w-16 bg-bg-sunken rounded-full animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Templates Grid */}\n {!isLoading ? (\n filteredTemplates.length > 0 ? (\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n {filteredTemplates.map((template, index) => (\n <div\n key={template.id}\n role=\"button\"\n tabIndex={0}\n onClick={() => handleTemplateClick(template.id)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleTemplateClick(template.id);\n }\n }}\n className={cn(\n \"text-left group cursor-pointer border border-border-seam rounded-xl overflow-hidden bg-bg-surface\",\n \"hover:border-primary/40 shadow-[var(--shadow-pop)] transition-colors duration-200\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40\",\n \"animate-in fade-in-0\",\n )}\n style={{ animationDelay: `${index * 50}ms` }}\n >\n {/* Header */}\n <div className=\"p-4 border-b bg-bg-sunken/30\">\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10\">\n <FileBox size={20} className=\"text-primary\" />\n </div>\n <div>\n <h3 className=\"font-semibold\">{template.name}</h3>\n <p className=\"text-xs text-text-secondary\">\n {getFormatDisplayName(template.format)}\n {template.isDefault && (\n <span 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\">\n {tr(\"export.templates.card.default\", \"Default\")}\n </span>\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={(e) => handleDeleteTemplate(e, template.id)}\n className=\"p-1.5 rounded-md text-text-secondary hover:text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n aria-label={tr(\n \"export.templates.card.deleteAriaLabel\",\n \"Delete {{name}}\",\n { name: template.name },\n )}\n >\n <X size={14} />\n </button>\n <ChevronRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors mt-1\"\n />\n </div>\n </div>\n </div>\n\n {/* Body */}\n <div className=\"p-4\">\n {template.description && (\n <p className=\"text-sm text-text-secondary mb-3 line-clamp-2\">\n {template.description}\n </p>\n )}\n <div className=\"flex flex-wrap gap-1.5 overflow-hidden\">\n {template.entityTypes.slice(0, 6).map((entity) => (\n <span\n key={entity}\n className=\"inline-flex px-2 py-0.5 rounded text-xs font-medium bg-bg-sunken text-text-secondary max-w-full truncate\"\n >\n {label(entity)}\n </span>\n ))}\n {template.entityTypes.length > 6 && (\n <span className=\"inline-flex px-2 py-0.5 rounded text-xs font-medium bg-bg-sunken text-text-secondary\">\n {tr(\n \"export.templates.card.moreEntities\",\n \"+{{count}} more\",\n {\n count: template.entityTypes.length - 6,\n },\n )}\n </span>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={searchQuery ? \"empty-search\" : \"empty-data\"}\n title={\n searchQuery\n ? tr(\n \"export.templates.empty.filtered.title\",\n \"No matching templates\",\n )\n : tr(\"export.templates.empty.title\", \"No templates yet\")\n }\n description={\n searchQuery\n ? tr(\n \"export.templates.empty.filtered.description\",\n \"Try adjusting your search to find what you are looking for.\",\n )\n : tr(\n \"export.templates.empty.description\",\n \"Create a template to save reusable export configurations.\",\n )\n }\n action={\n searchQuery ? (\n <button\n type=\"button\"\n onClick={() => setSearchQuery(\"\")}\n 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\"\n >\n <X size={16} />\n {tr(\n \"export.templates.empty.filtered.actions.clear\",\n \"Clear Search\",\n )}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={handleOpenCreate}\n 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\"\n >\n <Plus size={16} />\n {tr(\n \"export.templates.empty.actions.newTemplate\",\n \"New Template\",\n )}\n </button>\n )\n }\n kind={searchQuery ? \"no-results\" : \"first-use\"}\n glassIllustration=\"documents\"\n />\n )\n ) : null}\n {navigationV2 ? (\n <ConfirmDestructiveDialog\n open={templatePendingDelete !== null}\n onOpenChange={(open) => {\n if (!open) closeDeleteConfirm();\n }}\n title={tr(\"export.templates.delete.named\", \"Delete “{{name}}”?\", {\n name: pendingTemplateName,\n })}\n description={tr(\n \"export.templates.delete.description\",\n \"This removes the saved export configuration. Existing export jobs are not deleted.\",\n )}\n confirmLabel={tr(\n \"export.templates.delete.confirmAction\",\n \"Delete Template\",\n )}\n keepLabel={tr(\"export.templates.delete.cancel\", \"Keep Template\")}\n busy={deletingTemplate}\n error={deleteError}\n onConfirm={() => void confirmDeleteTemplate()}\n />\n ) : (\n templatePendingDelete && (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"template-list-delete-title\"\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-bg-surface/80 backdrop-blur-sm p-4\"\n >\n <div className=\"w-full max-w-md rounded-xl border-2 border-border-subtle bg-bg-surface p-6 shadow-xl\">\n <h2 id=\"template-list-delete-title\" className=\"text-lg font-bold\">\n {tr(\"export.templates.delete.title\", \"Delete template?\")}\n </h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {tr(\n \"export.templates.delete.description\",\n \"This removes the saved export configuration. Existing export jobs are not deleted.\",\n )}\n </p>\n {deleteError && (\n <p\n role=\"alert\"\n className=\"mt-3 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\"\n >\n {deleteError}\n </p>\n )}\n <div className=\"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3\">\n <button\n type=\"button\"\n onClick={closeDeleteConfirm}\n className=\"px-4 py-2 rounded-lg border-2 border-border-subtle hover:bg-accent transition-colors font-medium\"\n >\n {tr(\"export.templates.delete.cancel\", \"Keep Template\")}\n </button>\n <button\n type=\"button\"\n onClick={confirmDeleteTemplate}\n 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\"\n >\n {tr(\n \"export.templates.delete.confirmAction\",\n \"Delete Template\",\n )}\n </button>\n </div>\n </div>\n </div>\n )\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,IAAMA,KAAY,GAAc,OACZC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,MACzCC,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA;AAQtD,SAAgBC,IAAsB;CACpC,IAAM,EAAE,cAAW,KAAK,gBAAaC,EAAU,GACzCC,IAAKC,EAAM,GACX,EAAE,MAAMC,GAAW,iBAAcC,GAAmB,GACpD,EAAE,uBAAmBC,GAAwB,GAC7C,EAAE,oBAAgB,WAAWC,MAAaC,GAAwB,GAClE,EAAE,MAAMC,OAAsBC,EAAqB,GACnDC,IAAeC,GAAgB,GAC/BC,IAAQC,GAAeH,CAAY,GACnC,EAAE,aAAaI,MAAoBC,GAAY,GAI/CC,IAAqBR,GAAkB,QAC1C,MACC,EAAE,YAAY,MACd,CAACS,GAAuB,EAAE,UAAU,KACpC,CAACC,GAAuB,EAAE,YAAYJ,CAAe,CACzD,GACM,CAACK,GAAaC,KAAkBC,EAAwB,IAAI,GAC5D,CAACC,GAAkBC,KAAuBF,EAAS,EAAK,GAExD,CAACG,GAAaC,KAAkBJ,EAAS,EAAE,GAC3C,CAACK,GAAgBC,KAAqBN,EAAS,EAAK,GACpD,CAACO,GAAiBC,KAAsBR,EAAS,EAAE,GACnD,CAACS,GAAwBC,KAA6BV,EAAS,EAAE,GACjE,CAACW,GAAwBC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ACZ,yCACA,iBACF;IACA,WAAWA,EAAG,kCAAkC,eAAe;IAC/D,MAAMqB;IACN,OAAOH;IACP,iBAAiB,KAAKsC,EAAsB;GAC7C,CAAA,IAEDnB,KACE,kBAAC,OAAD;IACE,MAAK;IACL,cAAW;IACX,mBAAgB;IAChB,WAAU;IAEV,UAAA,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAAC,MAAD;OAAI,IAAG;OAA6B,WAAU;OAC3C,UAAArC,EAAG,iCAAiC,kBAAkB;MACrD,CAAA;MACJ,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA,EACC,uCACA,oFACF;MACC,CAAA;MACFkB,KACC,kBAAC,KAAD;OACE,MAAK;OACL,WAAU;OAET,UAAAA;MACA,CAAA;MAEL,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,UAAD;QACE,MAAK;QACL,SAASqC;QACT,WAAU;QAET,UAAAvD,EAAG,kCAAkC,eAAe;OAC/C,CAAA,GACR,kBAAC,UAAD;QACE,MAAK;QACL,SAASwD;QACT,WAAU;QAET,UAAAxD,EACC,yCACA,iBACF;OACM,CAAA,CACL;;KACF;;GACF,CAAA;EAGC;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"ExportTemplatesPage.js","names":["joinPath","base","path","ExportTemplatesPage","useExport","tr","useTr","templates","useExportTemplates","useDeleteExportTemplate","creating","useCreateExportTemplate","availableEntities","useAvailableEntities","navigationV2","useNavigationV2","label","useEntityLabel","hostProductSlug","useAppShell","selectableEntities","isExportEntityDisabled","isForeignProductEntity","deleteError","setDeleteError","useState","deletingTemplate","setDeletingTemplate","searchQuery","setSearchQuery","showCreateForm","setShowCreateForm","newTemplateName","setNewTemplateName","newTemplateDescription","setNewTemplateDescription","newTemplateEntityTypes","setNewTemplateEntityTypes","newTemplateFormat","setNewTemplateFormat","createError","setCreateError","templatePendingDelete","setTemplatePendingDelete","handleOpenCreate","handleCreateTemplate","createTemplate","err","toggleEntity","prev","entityType","e","filteredTemplates","useMemo","q","handleTemplateClick","basePath","templateId","handleDeleteTemplate","nativeImpact","closeDeleteConfirm","confirmDeleteTemplate","deleteTemplate","nativeNotify","pendingTemplateName","t","PageLayout","FileBox","CTAOverflowMenu","Plus","navigate","Sparkles","DownloadsTabs","PagePurpose","X","ThemedSelect","entity","cn","SpinnerIcon","Search","isLoading","SkeletonBlock","i","template","index","getFormatDisplayName","ChevronRight","IllustratedEmptyState","ConfirmDestructiveDialog","open"],"sources":["../../../src/export/pages/ExportTemplatesPage.tsx"],"sourcesContent":["import { useState, useMemo } from \"react\";\nimport { Search, X, FileBox, Plus, ChevronRight, Sparkles } from \"lucide-react\";\nimport {\n CTAOverflowMenu,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport {\n useExportTemplates,\n useDeleteExportTemplate,\n useCreateExportTemplate,\n useAvailableEntities,\n} from \"../hooks/useExportQueries\";\nimport { PageLayout } from \"../components/PageLayout\";\nimport { DownloadsTabs } from \"../components/DownloadsTabs\";\nimport { ConfirmDestructiveDialog } from \"../components/ConfirmDestructiveDialog\";\nimport { useNavigationV2 } from \"../navigation-v2/NavigationV2\";\nimport { useEntityLabel } from \"../hooks/useEntityLabel\";\nimport { useAppShell } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport {\n isExportEntityDisabled,\n isForeignProductEntity,\n} from \"../utils/disabledModules\";\nimport { getFormatDisplayName } from \"../constants/enums\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport type { ExportFormat } from \"../types\";\nimport { nativeImpact, nativeNotify } from \"../../utils/nativeBridge\";\nimport { SkeletonBlock, SpinnerIcon } from \"../components/loadingSystem\";\n\n/**\n * Helper to join paths correctly\n */\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\n/**\n * Export Templates Page\n * Template management list for reusable export configurations\n */\nexport function ExportTemplatesPage() {\n const { basePath = \"/\", navigate } = useExport();\n const tr = useTr();\n const { data: templates, isLoading } = useExportTemplates();\n const { deleteTemplate } = useDeleteExportTemplate();\n const { createTemplate, isPending: creating } = useCreateExportTemplate();\n const { data: availableEntities } = useAvailableEntities();\n const navigationV2 = useNavigationV2();\n const label = useEntityLabel(navigationV2);\n const { productSlug: hostProductSlug } = useAppShell();\n // The new-setup form offers only what \"New export\" itself can select in this\n // shell: not other products' entity types, not products whose export isn't\n // available yet, and not entity types the service marks disabled.\n const selectableEntities = availableEntities.filter(\n (e) =>\n e.enabled !== false &&\n !isExportEntityDisabled(e.entityType) &&\n !isForeignProductEntity(e.entityType, hostProductSlug),\n );\n const [deleteError, setDeleteError] = useState<string | null>(null);\n const [deletingTemplate, setDeletingTemplate] = useState(false);\n\n const [searchQuery, setSearchQuery] = useState(\"\");\n const [showCreateForm, setShowCreateForm] = useState(false);\n const [newTemplateName, setNewTemplateName] = useState(\"\");\n const [newTemplateDescription, setNewTemplateDescription] = useState(\"\");\n const [newTemplateEntityTypes, setNewTemplateEntityTypes] = useState<\n string[]\n >([]);\n const [newTemplateFormat, setNewTemplateFormat] =\n useState<ExportFormat>(\"CSV\");\n const [createError, setCreateError] = useState<string | null>(null);\n const [templatePendingDelete, setTemplatePendingDelete] = useState<\n string | null\n >(null);\n\n const handleOpenCreate = () => {\n setNewTemplateName(\"\");\n setNewTemplateDescription(\"\");\n setNewTemplateEntityTypes([]);\n setNewTemplateFormat(\"CSV\");\n setCreateError(null);\n setShowCreateForm(true);\n };\n\n const handleCreateTemplate = async () => {\n if (!newTemplateName.trim()) {\n setCreateError(\n tr(\n \"export.templates.form.errors.nameRequired\",\n \"Template name is required.\",\n ),\n );\n return;\n }\n if (newTemplateEntityTypes.length === 0) {\n setCreateError(\n tr(\n \"export.templates.form.errors.entityRequired\",\n \"Select at least one entity type.\",\n ),\n );\n return;\n }\n setCreateError(null);\n try {\n await createTemplate({\n name: newTemplateName.trim(),\n description: newTemplateDescription.trim() || undefined,\n entityTypes: newTemplateEntityTypes,\n format: newTemplateFormat,\n });\n setShowCreateForm(false);\n } catch (err) {\n setCreateError(\n err instanceof Error\n ? err.message\n : tr(\n \"export.templates.form.errors.createFailed\",\n \"Failed to create template.\",\n ),\n );\n }\n };\n\n const toggleEntity = (entityType: string) => {\n setNewTemplateEntityTypes((prev) =>\n prev.includes(entityType)\n ? prev.filter((e) => e !== entityType)\n : [...prev, entityType],\n );\n };\n\n // Client-side search filter\n const filteredTemplates = useMemo(() => {\n if (!searchQuery) return templates;\n const q = searchQuery.toLowerCase();\n return templates.filter(\n (t) =>\n t.name.toLowerCase().includes(q) ||\n t.entityTypes.some(\n (e) =>\n e.toLowerCase().includes(q) || label(e).toLowerCase().includes(q),\n ),\n );\n }, [templates, searchQuery, label]);\n\n const handleTemplateClick = (templateId: string) => {\n navigate?.(joinPath(basePath, `templates/${templateId}`));\n };\n\n const handleDeleteTemplate = async (\n e: React.MouseEvent,\n templateId: string,\n ) => {\n e.stopPropagation();\n nativeImpact(\"medium\");\n setTemplatePendingDelete(templateId);\n };\n\n const closeDeleteConfirm = () => {\n setTemplatePendingDelete(null);\n setDeleteError(null);\n };\n\n const confirmDeleteTemplate = async () => {\n if (!templatePendingDelete) return;\n setDeleteError(null);\n setDeletingTemplate(true);\n try {\n await deleteTemplate(templatePendingDelete);\n nativeNotify(\"success\");\n setTemplatePendingDelete(null);\n } catch (err) {\n nativeNotify(\"error\");\n // Say why and keep the confirm open, instead of closing it silently.\n setDeleteError(\n err instanceof Error && err.message\n ? err.message\n : tr(\n \"export.templates.delete.failed\",\n \"Couldn't delete this template. Try again.\",\n ),\n );\n } finally {\n setDeletingTemplate(false);\n }\n };\n\n const pendingTemplateName =\n templates.find((t) => t.id === templatePendingDelete)?.name ?? \"\";\n\n return (\n <PageLayout\n title={tr(\"export.templates.title\", \"Export Templates\")}\n subtitle={tr(\n \"export.templates.subtitle\",\n \"Reusable export configurations for common data exports\",\n )}\n icon={<FileBox size={24} />}\n headerActions={\n <CTAOverflowMenu\n primary={{\n label: tr(\"export.templates.actions.newTemplate\", \"New Template\"),\n icon: <Plus size={16} />,\n onSelect: handleOpenCreate,\n }}\n actions={[\n {\n label: tr(\"export.templates.actions.newExport\", \"New Export\"),\n icon: <Plus size={16} />,\n onSelect: () => navigate?.(joinPath(basePath, \"new\")),\n },\n ]}\n />\n }\n headerContent={\n <span 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\">\n <Sparkles size={12} />\n {navigationV2\n ? filteredTemplates.length === 1\n ? tr(\"export.templates.summary.one\", \"1 setup\")\n : tr(\"export.templates.summary.other\", \"{{count}} setups\", {\n count: filteredTemplates.length,\n })\n : tr(\n \"export.templates.summary.available\",\n \"{{count}} template{{suffix}} available\",\n {\n count: filteredTemplates.length,\n suffix: filteredTemplates.length !== 1 ? \"s\" : \"\",\n },\n )}\n </span>\n }\n >\n {navigationV2 && <DownloadsTabs />}\n {/* Page purpose — why templates exist */}\n <PagePurpose icon={<FileBox size={16} />}>\n {tr(\n \"export.templates.purpose\",\n \"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.\",\n )}\n </PagePurpose>\n\n {/* Create Template Form */}\n {showCreateForm && (\n <div className=\"border border-primary/30 rounded-xl p-6 bg-accent-wash space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-semibold text-lg\">\n {tr(\"export.templates.form.title\", \"New Template\")}\n </h3>\n <button\n type=\"button\"\n onClick={() => setShowCreateForm(false)}\n className=\"p-1.5 rounded-md hover:bg-accent\"\n >\n <X size={16} />\n </button>\n </div>\n {createError && (\n <p className=\"text-sm text-status-error-text bg-status-error-bg/10 rounded-lg px-3 py-2\">\n {createError}\n </p>\n )}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-1\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.name\", \"Name\")} *\n </label>\n <input\n type=\"text\"\n aria-label={tr(\"export.templates.form.fields.name\", \"Name\")}\n placeholder={tr(\n \"export.templates.form.fields.namePlaceholder\",\n \"e.g. Weekly Tags Export\",\n )}\n value={newTemplateName}\n onChange={(e) => setNewTemplateName(e.target.value)}\n 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\"\n />\n </div>\n <div className=\"space-y-1\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.format\", \"Format\")} *\n </label>\n <ThemedSelect\n value={newTemplateFormat}\n onChange={(e) =>\n setNewTemplateFormat(e.target.value as ExportFormat)\n }\n 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\"\n >\n <option value=\"CSV\">{tr(\"export.format.csv\", \"CSV\")}</option>\n <option value=\"JSON\">{tr(\"export.format.json\", \"JSON\")}</option>\n </ThemedSelect>\n </div>\n </div>\n <div className=\"space-y-1\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.description\", \"Description\")}\n </label>\n <input\n type=\"text\"\n aria-label={tr(\n \"export.templates.form.fields.description\",\n \"Description\",\n )}\n placeholder={tr(\n \"export.templates.form.fields.descriptionPlaceholder\",\n \"Optional description\",\n )}\n value={newTemplateDescription}\n onChange={(e) => setNewTemplateDescription(e.target.value)}\n 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\"\n />\n </div>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr(\"export.templates.form.fields.entityTypes\", \"Entity Types\")} *{\" \"}\n <span className=\"text-text-secondary font-normal\">\n {tr(\n \"export.templates.form.fields.entityTypesHint\",\n \"(select at least one)\",\n )}\n </span>\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {selectableEntities.map((entity) => (\n <button\n key={entity.entityType}\n type=\"button\"\n onClick={() => toggleEntity(entity.entityType)}\n className={cn(\n \"px-3 py-1.5 rounded-lg text-sm font-medium border-2 transition-all\",\n newTemplateEntityTypes.includes(entity.entityType)\n ? \"border-primary bg-action-primary-bg/10 text-primary\"\n : \"border-border-subtle bg-bg-surface hover:border-primary/50\",\n )}\n >\n {navigationV2 ? label(entity.entityType) : entity.displayName}\n </button>\n ))}\n </div>\n </div>\n <div className=\"flex gap-3 pt-2\">\n <button\n type=\"button\"\n onClick={handleCreateTemplate}\n disabled={creating}\n 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\"\n >\n {creating ? (\n <SpinnerIcon\n tone=\"current\"\n size={16}\n className=\"animate-spin\"\n />\n ) : (\n <Plus size={16} />\n )}\n {tr(\"export.templates.form.actions.create\", \"Create Template\")}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowCreateForm(false)}\n className=\"px-5 py-2.5 border-2 border-border-subtle rounded-lg hover:bg-accent transition-colors font-medium\"\n >\n {tr(\"export.templates.form.actions.cancel\", \"Cancel\")}\n </button>\n </div>\n </div>\n )}\n {/* Search */}\n <div className=\"relative group\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n aria-label={tr(\n \"export.templates.search.placeholder\",\n \"Search templates\",\n )}\n placeholder={tr(\n \"export.templates.search.placeholder\",\n \"Search templates...\",\n )}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n 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\"\n />\n {searchQuery && (\n <button\n type=\"button\"\n onClick={() => setSearchQuery(\"\")}\n 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\"\n >\n <X size={16} />\n </button>\n )}\n </div>\n\n {/* Loading */}\n {isLoading && (\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"border border-border-seam rounded-xl p-5\">\n <SkeletonBlock className=\"h-5 w-40 bg-bg-sunken rounded mb-3 animate-vc-shimmer\" />\n <SkeletonBlock className=\"h-3 w-full bg-bg-sunken rounded mb-2 animate-vc-shimmer\" />\n <div className=\"flex gap-2 mt-4\">\n <SkeletonBlock className=\"h-5 w-16 bg-bg-sunken rounded-full animate-vc-shimmer\" />\n <SkeletonBlock className=\"h-5 w-16 bg-bg-sunken rounded-full animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Templates Grid */}\n {!isLoading ? (\n filteredTemplates.length > 0 ? (\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n {filteredTemplates.map((template, index) => (\n <div\n key={template.id}\n role=\"button\"\n tabIndex={0}\n onClick={() => handleTemplateClick(template.id)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleTemplateClick(template.id);\n }\n }}\n className={cn(\n \"text-left group cursor-pointer border border-border-seam rounded-xl overflow-hidden bg-bg-surface\",\n \"hover:border-primary/40 shadow-[var(--shadow-pop)] transition-colors duration-200\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40\",\n \"animate-in fade-in-0\",\n )}\n style={{ animationDelay: `${index * 50}ms` }}\n >\n {/* Header */}\n <div className=\"p-4 border-b bg-bg-sunken/30\">\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10\">\n <FileBox size={20} className=\"text-primary\" />\n </div>\n <div>\n <h3 className=\"font-semibold\">{template.name}</h3>\n <p className=\"text-xs text-text-secondary\">\n {getFormatDisplayName(template.format)}\n {template.isDefault && (\n <span 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\">\n {tr(\"export.templates.card.default\", \"Default\")}\n </span>\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={(e) => handleDeleteTemplate(e, template.id)}\n className=\"p-1.5 rounded-md text-text-secondary hover:text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n aria-label={tr(\n \"export.templates.card.deleteAriaLabel\",\n \"Delete {{name}}\",\n { name: template.name },\n )}\n >\n <X size={14} />\n </button>\n <ChevronRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors mt-1\"\n />\n </div>\n </div>\n </div>\n\n {/* Body */}\n <div className=\"p-4\">\n {template.description && (\n <p className=\"text-sm text-text-secondary mb-3 line-clamp-2\">\n {template.description}\n </p>\n )}\n <div className=\"flex flex-wrap gap-1.5 overflow-hidden\">\n {template.entityTypes.slice(0, 6).map((entity) => (\n <span\n key={entity}\n className=\"inline-flex px-2 py-0.5 rounded text-xs font-medium bg-bg-sunken text-text-secondary max-w-full truncate\"\n >\n {label(entity)}\n </span>\n ))}\n {template.entityTypes.length > 6 && (\n <span className=\"inline-flex px-2 py-0.5 rounded text-xs font-medium bg-bg-sunken text-text-secondary\">\n {tr(\n \"export.templates.card.moreEntities\",\n \"+{{count}} more\",\n {\n count: template.entityTypes.length - 6,\n },\n )}\n </span>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={searchQuery ? \"empty-search\" : \"empty-data\"}\n title={\n searchQuery\n ? tr(\n \"export.templates.empty.filtered.title\",\n \"No matching templates\",\n )\n : tr(\"export.templates.empty.title\", \"No templates yet\")\n }\n description={\n searchQuery\n ? tr(\n \"export.templates.empty.filtered.description\",\n \"Try adjusting your search to find what you are looking for.\",\n )\n : tr(\n \"export.templates.empty.description\",\n \"Create a template to save reusable export configurations.\",\n )\n }\n action={\n searchQuery ? (\n <button\n type=\"button\"\n onClick={() => setSearchQuery(\"\")}\n 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\"\n >\n <X size={16} />\n {tr(\n \"export.templates.empty.filtered.actions.clear\",\n \"Clear Search\",\n )}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={handleOpenCreate}\n 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\"\n >\n <Plus size={16} />\n {tr(\n \"export.templates.empty.actions.newTemplate\",\n \"New Template\",\n )}\n </button>\n )\n }\n kind={searchQuery ? \"no-results\" : \"first-use\"}\n glassIllustration=\"documents\"\n />\n )\n ) : null}\n {navigationV2 ? (\n <ConfirmDestructiveDialog\n open={templatePendingDelete !== null}\n onOpenChange={(open) => {\n if (!open) closeDeleteConfirm();\n }}\n title={tr(\"export.templates.delete.named\", \"Delete “{{name}}”?\", {\n name: pendingTemplateName,\n })}\n description={tr(\n \"export.templates.delete.description\",\n \"This removes the saved export configuration. Existing export jobs are not deleted.\",\n )}\n confirmLabel={tr(\n \"export.templates.delete.confirmAction\",\n \"Delete Template\",\n )}\n keepLabel={tr(\"export.templates.delete.cancel\", \"Keep Template\")}\n busy={deletingTemplate}\n error={deleteError}\n onConfirm={() => void confirmDeleteTemplate()}\n />\n ) : (\n templatePendingDelete && (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"template-list-delete-title\"\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-bg-surface/80 backdrop-blur-sm p-4\"\n >\n <div className=\"w-full max-w-md rounded-xl border-2 border-border-subtle bg-bg-surface p-6 shadow-xl\">\n <h2 id=\"template-list-delete-title\" className=\"text-lg font-bold\">\n {tr(\"export.templates.delete.title\", \"Delete template?\")}\n </h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {tr(\n \"export.templates.delete.description\",\n \"This removes the saved export configuration. Existing export jobs are not deleted.\",\n )}\n </p>\n {deleteError && (\n <p\n role=\"alert\"\n className=\"mt-3 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\"\n >\n {deleteError}\n </p>\n )}\n <div className=\"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3\">\n <button\n type=\"button\"\n onClick={closeDeleteConfirm}\n className=\"px-4 py-2 rounded-lg border-2 border-border-subtle hover:bg-accent transition-colors font-medium\"\n >\n {tr(\"export.templates.delete.cancel\", \"Keep Template\")}\n </button>\n <button\n type=\"button\"\n onClick={confirmDeleteTemplate}\n 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\"\n >\n {tr(\n \"export.templates.delete.confirmAction\",\n \"Delete Template\",\n )}\n </button>\n </div>\n </div>\n </div>\n )\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,IAAMA,KAAY,GAAc,OACZC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,MACzCC,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA;AAQtD,SAAgBC,IAAsB;CACpC,IAAM,EAAE,cAAW,KAAK,gBAAaC,EAAU,GACzCC,IAAKC,GAAM,GACX,EAAE,MAAMC,GAAW,iBAAcC,GAAmB,GACpD,EAAE,uBAAmBC,GAAwB,GAC7C,EAAE,oBAAgB,WAAWC,MAAaC,GAAwB,GAClE,EAAE,MAAMC,MAAsBC,EAAqB,GACnDC,IAAeC,GAAgB,GAC/BC,IAAQC,GAAeH,CAAY,GACnC,EAAE,aAAaI,MAAoBC,GAAY,GAI/CC,IAAqBR,EAAkB,Q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L,SAASuC;KACT,WAAU;KAHZ,UAAA,CAKE,kBAACyB,GAAD,EAAM,MAAM,GAAK,CAAA,GAChBhE,EACC,8CACA,cACF,CACM;;IAGZ,MAAMuB,IAAc,eAAe;IACnC,mBAAkB;GACnB,CAAA;GAGJd,IACC,kBAAC0E,GAAD;IACE,MAAM9C,MAA0B;IAChC,eAAe,MAAS;KACtB,AAAK+C,KAAM7B,EAAmB;IAChC;IACA,OAAOvD,EAAG,iCAAiC,sBAAsB,EAC/D,MAAM2D,GACR,CAAC;IACD,aAAa3D,EACX,uCACA,oFACF;IACA,cAAcA,EACZ,yCACA,iBACF;IACA,WAAWA,EAAG,kCAAkC,eAAe;IAC/D,MAAMqB;IACN,OAAOH;IACP,iBAAiB,KAAKsC,EAAsB;GAC7C,CAAA,IAEDnB,KACE,kBAAC,OAAD;IACE,MAAK;IACL,cAAW;IACX,mBAAgB;IAChB,WAAU;IAEV,UAAA,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAAC,MAAD;OAAI,IAAG;OAA6B,WAAU;OAC3C,UAAArC,EAAG,iCAAiC,kBAAkB;MACrD,CAAA;MACJ,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA,EACC,uCACA,oFACF;MACC,CAAA;MACFkB,KACC,kBAAC,KAAD;OACE,MAAK;OACL,WAAU;OAET,UAAAA;MACA,CAAA;MAEL,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,UAAD;QACE,MAAK;QACL,SAASqC;QACT,WAAU;QAET,UAAAvD,EAAG,kCAAkC,eAAe;OAC/C,CAAA,GACR,kBAAC,UAAD;QACE,MAAK;QACL,SAASwD;QACT,WAAU;QAET,UAAAxD,EACC,yCACA,iBACF;OACM,CAAA,CACL;;KACF;;GACF,CAAA;EAGC;;AAEhB"}
|
|
@@ -7,249 +7,255 @@ import { useEntityLabel as c } from "../hooks/useEntityLabel.js";
|
|
|
7
7
|
import { useNavigationV2 as l } from "../navigation-v2/NavigationV2.js";
|
|
8
8
|
import { ConfirmDestructiveDialog as u } from "../components/ConfirmDestructiveDialog.js";
|
|
9
9
|
import { nativeImpact as d, nativeNotify as f } from "../../utils/nativeBridge.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { SectionLoaderOr as p, SpinnerIcon as m } from "../components/loadingSystem.js";
|
|
11
|
+
import { useState as h } from "react";
|
|
12
|
+
import { ArrowLeft as g, Clock as _, Download as v, FileBox as y, FileText as b, HardDrive as x, Play as S, Trash2 as C } from "lucide-react";
|
|
13
|
+
import { useParams as w } from "react-router";
|
|
14
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
15
|
+
import { CTAOverflowMenu as D, GlassCard as O, IllustratedEmptyState as k, NextSteps as A, ShowMore as j } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
// src/export/pages/TemplateDetailPage.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let { templateId:
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
className: "
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
var M = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
18
|
+
function N() {
|
|
19
|
+
let { templateId: N } = w(), { basePath: P = "/", navigate: F } = e(), I = s(), [L, R] = h(!1), { data: z, isLoading: B } = n(N), { deleteTemplate: V, isPending: H } = t(), U = l(), W = c(U), [G, K] = h(null);
|
|
20
|
+
if (B) return /* @__PURE__ */ T(p, {
|
|
21
|
+
label: I("export.templateDetail.loading", "Loading template details…"),
|
|
22
|
+
minHeight: "13.25rem",
|
|
23
|
+
today: /* @__PURE__ */ E("div", {
|
|
24
|
+
className: "flex flex-col items-center justify-center py-20",
|
|
25
|
+
children: [/* @__PURE__ */ T(m, {
|
|
26
|
+
size: 48,
|
|
27
|
+
className: "animate-spin text-primary"
|
|
28
|
+
}), /* @__PURE__ */ T("span", {
|
|
29
|
+
className: "mt-6 text-sm font-medium text-text-secondary",
|
|
30
|
+
children: I("export.templateDetail.loading", "Loading template details…")
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
28
33
|
});
|
|
29
|
-
if (!
|
|
34
|
+
if (!z) return /* @__PURE__ */ E(a, {
|
|
30
35
|
showHeader: !1,
|
|
31
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ E("div", {
|
|
32
37
|
className: "flex items-center gap-3 mb-6",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ T("button", {
|
|
34
39
|
type: "button",
|
|
35
|
-
onClick: () =>
|
|
36
|
-
"aria-label":
|
|
40
|
+
onClick: () => F?.(M(P, "templates")),
|
|
41
|
+
"aria-label": I("export.templateDetail.actions.backToTemplates", "Back to templates"),
|
|
37
42
|
className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200",
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
}), /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ T(g, { size: 20 })
|
|
44
|
+
}), /* @__PURE__ */ T("h1", {
|
|
40
45
|
className: "text-xl font-bold",
|
|
41
|
-
children:
|
|
46
|
+
children: I("export.templateDetail.notFound.title", "Template Not Found")
|
|
42
47
|
})]
|
|
43
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ T(k, {
|
|
44
49
|
illustration: "empty-data",
|
|
45
|
-
title:
|
|
46
|
-
description:
|
|
47
|
-
action: /* @__PURE__ */
|
|
50
|
+
title: I("export.templateDetail.notFound.heading", "Template not found"),
|
|
51
|
+
description: I("export.templateDetail.notFound.description", "The template you are looking for does not exist."),
|
|
52
|
+
action: /* @__PURE__ */ E("button", {
|
|
48
53
|
type: "button",
|
|
49
|
-
onClick: () =>
|
|
54
|
+
onClick: () => F?.(M(P, "templates")),
|
|
50
55
|
className: "inline-flex items-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors font-medium",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ T(g, { size: 18 }), I("export.templateDetail.actions.backToTemplates", "Back to Templates")]
|
|
52
57
|
}),
|
|
53
58
|
kind: "not-found"
|
|
54
59
|
})]
|
|
55
60
|
});
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
if (
|
|
60
|
-
d("medium"),
|
|
61
|
+
let q = () => {
|
|
62
|
+
F?.(M(P, `new?templateId=${N}`));
|
|
63
|
+
}, J = async () => {
|
|
64
|
+
if (N) {
|
|
65
|
+
d("medium"), K(null);
|
|
61
66
|
try {
|
|
62
|
-
await
|
|
67
|
+
await V(N), f("success"), F?.(M(P, "templates"));
|
|
63
68
|
} catch (e) {
|
|
64
|
-
f("error"),
|
|
69
|
+
f("error"), K(e instanceof Error && e.message ? e.message : I("export.templates.delete.failed", "Couldn't delete this template. Try again."));
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
label:
|
|
71
|
-
icon: /* @__PURE__ */
|
|
72
|
+
}, Y = () => {
|
|
73
|
+
R(!1), K(null);
|
|
74
|
+
}, X = z.isDefault ? [] : [{
|
|
75
|
+
label: I("export.templateDetail.actions.delete", "Delete Template"),
|
|
76
|
+
icon: /* @__PURE__ */ T(C, { size: 16 }),
|
|
72
77
|
intent: "destructive",
|
|
73
|
-
disabled:
|
|
74
|
-
onSelect: () =>
|
|
75
|
-
}],
|
|
78
|
+
disabled: H,
|
|
79
|
+
onSelect: () => R(!0)
|
|
80
|
+
}], Z = [{
|
|
76
81
|
id: "use",
|
|
77
|
-
label:
|
|
78
|
-
description:
|
|
79
|
-
icon: /* @__PURE__ */
|
|
80
|
-
onClick:
|
|
82
|
+
label: I("export.templateDetail.nextSteps.use.label", "Start an export from this template"),
|
|
83
|
+
description: I("export.templateDetail.nextSteps.use.description", "Pre-fills a new export with this template's entity types and format."),
|
|
84
|
+
icon: /* @__PURE__ */ T(S, { size: 16 }),
|
|
85
|
+
onClick: q
|
|
81
86
|
}, {
|
|
82
87
|
id: "browse",
|
|
83
|
-
label:
|
|
84
|
-
description:
|
|
85
|
-
icon: /* @__PURE__ */
|
|
86
|
-
onClick: () =>
|
|
88
|
+
label: I("export.templateDetail.nextSteps.browse.label", "Browse all templates"),
|
|
89
|
+
description: I("export.templateDetail.nextSteps.browse.description", "Manage your other saved export configurations."),
|
|
90
|
+
icon: /* @__PURE__ */ T(y, { size: 16 }),
|
|
91
|
+
onClick: () => F?.(M(P, "templates"))
|
|
87
92
|
}];
|
|
88
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ E(a, {
|
|
89
94
|
showHeader: !1,
|
|
90
95
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ T("div", {
|
|
92
97
|
className: "relative overflow-hidden rounded-xl bg-accent-wash border border-border-seam p-6 shadow-[var(--shadow-pop)]",
|
|
93
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ E("div", {
|
|
94
99
|
className: "relative z-10 flex flex-col sm:flex-row sm:items-center gap-4",
|
|
95
100
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ T("button", {
|
|
97
102
|
type: "button",
|
|
98
|
-
onClick: () =>
|
|
99
|
-
"aria-label":
|
|
103
|
+
onClick: () => F?.(M(P, "templates")),
|
|
104
|
+
"aria-label": I("export.templateDetail.actions.backToTemplates", "Back to templates"),
|
|
100
105
|
className: "p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 self-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
101
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ T(g, { size: 20 })
|
|
102
107
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ E("div", {
|
|
104
109
|
className: "flex items-center gap-3 flex-1 min-w-0",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ T("div", {
|
|
106
111
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
107
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ T(y, {
|
|
108
113
|
size: 24,
|
|
109
114
|
className: "text-primary"
|
|
110
115
|
})
|
|
111
|
-
}), /* @__PURE__ */
|
|
116
|
+
}), /* @__PURE__ */ E("div", {
|
|
112
117
|
className: "flex-1 min-w-0",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ T("h1", {
|
|
114
119
|
className: "text-xl sm:text-2xl font-bold truncate",
|
|
115
|
-
children:
|
|
116
|
-
}), /* @__PURE__ */
|
|
120
|
+
children: z.name
|
|
121
|
+
}), /* @__PURE__ */ T("p", {
|
|
117
122
|
className: "text-sm text-text-secondary mt-1",
|
|
118
|
-
children:
|
|
123
|
+
children: z.isDefault ? I("export.templateDetail.badge.default", "Default template") : I("export.templateDetail.badge.custom", "Custom template")
|
|
119
124
|
})]
|
|
120
125
|
})]
|
|
121
126
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ T("div", {
|
|
123
128
|
className: "flex-shrink-0",
|
|
124
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ T(D, {
|
|
125
130
|
primary: {
|
|
126
|
-
label:
|
|
127
|
-
icon: /* @__PURE__ */
|
|
128
|
-
onSelect:
|
|
131
|
+
label: I("export.templateDetail.actions.use", "Use Template"),
|
|
132
|
+
icon: /* @__PURE__ */ T(S, { size: 16 }),
|
|
133
|
+
onSelect: q
|
|
129
134
|
},
|
|
130
|
-
actions:
|
|
135
|
+
actions: X
|
|
131
136
|
})
|
|
132
137
|
})
|
|
133
138
|
]
|
|
134
139
|
})
|
|
135
140
|
}),
|
|
136
|
-
|
|
141
|
+
z.description && /* @__PURE__ */ T("div", {
|
|
137
142
|
className: "border border-border-seam rounded-xl p-5 bg-bg-surface",
|
|
138
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ T("p", {
|
|
139
144
|
className: "text-sm text-text-secondary",
|
|
140
|
-
children:
|
|
145
|
+
children: z.description
|
|
141
146
|
})
|
|
142
147
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ T("div", {
|
|
144
149
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
145
150
|
children: [
|
|
146
151
|
{
|
|
147
|
-
icon: /* @__PURE__ */
|
|
148
|
-
label:
|
|
149
|
-
value: i(
|
|
152
|
+
icon: /* @__PURE__ */ T(b, { size: 18 }),
|
|
153
|
+
label: I("export.templateDetail.info.format", "Format"),
|
|
154
|
+
value: i(z.format)
|
|
150
155
|
},
|
|
151
156
|
{
|
|
152
|
-
icon: /* @__PURE__ */
|
|
153
|
-
label:
|
|
154
|
-
value:
|
|
157
|
+
icon: /* @__PURE__ */ T(x, { size: 18 }),
|
|
158
|
+
label: I("export.templateDetail.info.archive", "Archive"),
|
|
159
|
+
value: U ? I("export.templateDetail.info.archiveEvery", "Every download is a ZIP file") : r("ZIP")
|
|
155
160
|
},
|
|
156
161
|
{
|
|
157
|
-
icon: /* @__PURE__ */
|
|
158
|
-
label:
|
|
159
|
-
value:
|
|
160
|
-
count:
|
|
161
|
-
suffix:
|
|
162
|
+
icon: /* @__PURE__ */ T(v, { size: 18 }),
|
|
163
|
+
label: I("export.templateDetail.info.entityTypes", "Entity Types"),
|
|
164
|
+
value: I("export.templateDetail.info.entityTypesCount", "{{count}} type{{suffix}}", {
|
|
165
|
+
count: z.entityTypes.length,
|
|
166
|
+
suffix: z.entityTypes.length === 1 ? "" : "s"
|
|
162
167
|
})
|
|
163
168
|
},
|
|
164
169
|
{
|
|
165
|
-
icon: /* @__PURE__ */
|
|
166
|
-
label:
|
|
167
|
-
value: new Date(
|
|
170
|
+
icon: /* @__PURE__ */ T(_, { size: 18 }),
|
|
171
|
+
label: I("export.templateDetail.info.lastUpdated", "Last Updated"),
|
|
172
|
+
value: new Date(z.updatedAt).toLocaleDateString()
|
|
168
173
|
}
|
|
169
|
-
].map((e) => /* @__PURE__ */
|
|
174
|
+
].map((e) => /* @__PURE__ */ E(O, {
|
|
170
175
|
treatment: "metric",
|
|
171
176
|
className: "p-4 border-border-seam",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ E("div", {
|
|
173
178
|
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
174
|
-
children: [e.icon, /* @__PURE__ */
|
|
179
|
+
children: [e.icon, /* @__PURE__ */ T("span", {
|
|
175
180
|
className: "text-xs font-medium",
|
|
176
181
|
children: e.label
|
|
177
182
|
})]
|
|
178
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ T("p", {
|
|
179
184
|
className: "font-bold text-lg tabular-nums",
|
|
180
185
|
children: e.value
|
|
181
186
|
})]
|
|
182
187
|
}, e.label))
|
|
183
188
|
}),
|
|
184
|
-
!
|
|
185
|
-
storageKey: `export-template-${
|
|
186
|
-
title:
|
|
187
|
-
steps:
|
|
189
|
+
!U && /* @__PURE__ */ T(A, {
|
|
190
|
+
storageKey: `export-template-${z.id}`,
|
|
191
|
+
title: I("export.templateDetail.nextSteps.title", "What's next"),
|
|
192
|
+
steps: Z
|
|
188
193
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
title:
|
|
191
|
-
description:
|
|
192
|
-
children: /* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ T(o, {
|
|
195
|
+
title: I("export.templateDetail.entityTypes.title", "Included Entity Types"),
|
|
196
|
+
description: I("export.templateDetail.entityTypes.description", "Data types that will be exported"),
|
|
197
|
+
children: /* @__PURE__ */ T(j, {
|
|
193
198
|
collapsedHeight: 96,
|
|
194
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ T("div", {
|
|
195
200
|
className: "flex flex-wrap gap-2",
|
|
196
|
-
children:
|
|
201
|
+
children: z.entityTypes.map((e) => /* @__PURE__ */ T("span", {
|
|
197
202
|
className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium border border-border-seam bg-bg-sunken/30",
|
|
198
|
-
children:
|
|
203
|
+
children: W(e)
|
|
199
204
|
}, e))
|
|
200
205
|
})
|
|
201
206
|
})
|
|
202
207
|
}),
|
|
203
|
-
|
|
204
|
-
open:
|
|
208
|
+
U ? /* @__PURE__ */ T(u, {
|
|
209
|
+
open: L,
|
|
205
210
|
onOpenChange: (e) => {
|
|
206
|
-
e ||
|
|
211
|
+
e || Y();
|
|
207
212
|
},
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
210
|
-
confirmLabel:
|
|
211
|
-
keepLabel:
|
|
212
|
-
busy:
|
|
213
|
-
error:
|
|
214
|
-
onConfirm: () => void
|
|
215
|
-
}) :
|
|
213
|
+
title: I("export.templates.delete.named", "Delete “{{name}}”?", { name: z.name }),
|
|
214
|
+
description: I("export.templateDetail.delete.description", "This removes the saved export configuration. Existing export jobs are not deleted."),
|
|
215
|
+
confirmLabel: I("export.templateDetail.delete.confirmAction", "Delete Template"),
|
|
216
|
+
keepLabel: I("export.templateDetail.delete.keep", "Keep Template"),
|
|
217
|
+
busy: H,
|
|
218
|
+
error: G,
|
|
219
|
+
onConfirm: () => void J()
|
|
220
|
+
}) : L && /* @__PURE__ */ T("div", {
|
|
216
221
|
role: "dialog",
|
|
217
222
|
"aria-modal": "true",
|
|
218
223
|
"aria-labelledby": "template-delete-title",
|
|
219
224
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-surface/80 backdrop-blur-sm p-4",
|
|
220
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ E("div", {
|
|
221
226
|
className: "w-full max-w-md rounded-xl border-2 border-border-subtle bg-bg-surface p-6 shadow-xl",
|
|
222
227
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ T("h2", {
|
|
224
229
|
id: "template-delete-title",
|
|
225
230
|
className: "text-lg font-bold",
|
|
226
|
-
children:
|
|
231
|
+
children: I("export.templateDetail.delete.title", "Delete template?")
|
|
227
232
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ T("p", {
|
|
229
234
|
className: "mt-2 text-sm text-text-secondary",
|
|
230
|
-
children:
|
|
235
|
+
children: I("export.templateDetail.delete.description", "This removes the saved export configuration. Existing export jobs are not deleted.")
|
|
231
236
|
}),
|
|
232
|
-
|
|
237
|
+
G && /* @__PURE__ */ T("p", {
|
|
233
238
|
role: "alert",
|
|
234
239
|
className: "mt-3 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
235
|
-
children:
|
|
240
|
+
children: G
|
|
236
241
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ E("div", {
|
|
238
243
|
className: "mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ T("button", {
|
|
240
245
|
type: "button",
|
|
241
|
-
onClick:
|
|
246
|
+
onClick: Y,
|
|
242
247
|
className: "px-4 py-2 rounded-lg border-2 border-border-subtle hover:bg-accent transition-colors font-medium",
|
|
243
|
-
children:
|
|
244
|
-
}), /* @__PURE__ */
|
|
248
|
+
children: I("export.templateDetail.delete.keep", "Keep Template")
|
|
249
|
+
}), /* @__PURE__ */ E("button", {
|
|
245
250
|
type: "button",
|
|
246
|
-
onClick:
|
|
247
|
-
disabled:
|
|
251
|
+
onClick: J,
|
|
252
|
+
disabled: H,
|
|
248
253
|
className: "inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90 transition-colors font-medium disabled:opacity-50",
|
|
249
|
-
children: [
|
|
254
|
+
children: [H ? /* @__PURE__ */ T(m, {
|
|
255
|
+
tone: "current",
|
|
250
256
|
size: 16,
|
|
251
257
|
className: "animate-spin"
|
|
252
|
-
}) : null,
|
|
258
|
+
}) : null, I("export.templateDetail.delete.confirmAction", "Delete Template")]
|
|
253
259
|
})]
|
|
254
260
|
})
|
|
255
261
|
]
|
|
@@ -258,6 +264,6 @@ function M() {
|
|
|
258
264
|
]
|
|
259
265
|
});
|
|
260
266
|
}
|
|
261
|
-
export {
|
|
267
|
+
export { N as TemplateDetailPage };
|
|
262
268
|
|
|
263
269
|
//# sourceMappingURL=TemplateDetailPage.js.map
|