@burdenoff/microfe-product 2026.624.3 → 2026.625.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/product/pages/ContentPageViewPage.js +25 -24
- package/dist/product/pages/ContentPageViewPage.js.map +1 -1
- package/dist/product/pages/ProductCatalogPage.js +69 -64
- package/dist/product/pages/ProductCatalogPage.js.map +1 -1
- package/dist/product/pages/ProductViewPage.js +91 -86
- package/dist/product/pages/ProductViewPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +7 -7
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js +2 -2
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +91 -89
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +2 -2
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +164 -159
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +2 -2
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +82 -80
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +2 -2
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +83 -79
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +4 -4
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +2 -2
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +71 -69
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +2 -2
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +80 -75
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductForm.js +8 -8
- package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductPlans.js +4 -4
- package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductCreatePage.js +2 -2
- package/dist/product-management/modules/products/pages/ProductCreatePage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductDetailPage.js +142 -140
- package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductEditPage.js +2 -2
- package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductsListPage.js +188 -179
- package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +3 -3
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js +2 -2
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +167 -175
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +2 -2
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +171 -168
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
- package/dist/product-management/shared/components/feedback/EmptyState.js +2 -20
- package/package.json +2 -2
- package/dist/product-management/shared/components/feedback/EmptyState.js.map +0 -1
|
@@ -11,52 +11,53 @@ import { AuditHistoryTab as f } from "../../../shared/components/AuditHistoryTab
|
|
|
11
11
|
import { ArrowLeft as p, Edit as m, FileText as h, Globe as g, Package as _, Trash2 as v } from "lucide-react";
|
|
12
12
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
13
|
import { useParams as S } from "react-router-dom";
|
|
14
|
+
import { CTAOverflowMenu as C, GradientText as w } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
//#region src/product-management/modules/content-pages/pages/ContentPageDetailPage.tsx
|
|
15
|
-
function
|
|
16
|
+
function T(e) {
|
|
16
17
|
return e.replace(/^### (.+)$/gm, "<h3 class=\"text-lg font-semibold mt-4 mb-2\">$1</h3>").replace(/^## (.+)$/gm, "<h2 class=\"text-xl font-semibold mt-5 mb-2\">$1</h2>").replace(/^# (.+)$/gm, "<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/`(.+?)`/g, "<code class=\"px-1.5 py-0.5 bg-bg-sunken rounded text-sm font-mono\">$1</code>").replace(/```[\s\S]*?```/g, (e) => `<pre class="bg-bg-sunken rounded-lg p-4 overflow-x-auto my-3"><code class="text-sm font-mono">${e.replace(/```\w*\n?/, "").replace(/\n?```$/, "")}</code></pre>`).replace(/\[(.+?)\]\((.+?)\)/g, "<a href=\"$2\" class=\"text-[var(--color-status-info)] underline\">$1</a>").replace(/^- (.+)$/gm, "<li class=\"ml-4 list-disc\">$1</li>").replace(/\n\n/g, "</p><p class=\"mb-3\">").replace(/\n/g, "<br/>");
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
let { id:
|
|
19
|
+
function E() {
|
|
20
|
+
let { id: E } = S(), { navigate: D, basePath: O = "/products" } = t(), k = `${O}/content-pages`, { contentPage: A, loading: j, error: M } = c(E), { deleteContentPage: N, loading: P } = l(), F = e(), { confirm: I, ConfirmDialog: L } = s(), R = async () => {
|
|
20
21
|
a("medium");
|
|
21
|
-
let e =
|
|
22
|
+
let e = F("contentPages.confirmDelete", "Are you sure you want to delete this content page?"), t = await i({
|
|
22
23
|
title: "Delete content page",
|
|
23
24
|
message: e,
|
|
24
25
|
okButtonTitle: "Delete",
|
|
25
26
|
cancelButtonTitle: "Cancel"
|
|
26
27
|
});
|
|
27
|
-
if (t === null ? await
|
|
28
|
+
if (t === null ? await I({
|
|
28
29
|
title: "Delete content page",
|
|
29
30
|
message: e,
|
|
30
31
|
okButtonTitle: "Delete",
|
|
31
32
|
cancelButtonTitle: "Cancel",
|
|
32
33
|
destructive: !0
|
|
33
34
|
}) : t) try {
|
|
34
|
-
await
|
|
35
|
+
await N(E), o("success"), D(k);
|
|
35
36
|
} catch (e) {
|
|
36
37
|
o("error"), console.error("Failed to delete content page:", e);
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
if (
|
|
40
|
+
if (j) return /* @__PURE__ */ b("div", {
|
|
40
41
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
41
|
-
children: /* @__PURE__ */ b(n, { message:
|
|
42
|
+
children: /* @__PURE__ */ b(n, { message: F("contentPages.loadingContentPage", "Loading content page...") })
|
|
42
43
|
});
|
|
43
|
-
if (
|
|
44
|
+
if (M || !A) return /* @__PURE__ */ b("div", {
|
|
44
45
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
45
46
|
children: /* @__PURE__ */ b(r, {
|
|
46
|
-
message:
|
|
47
|
+
message: M?.message || F("contentPages.contentPageNotFound", "Content page not found"),
|
|
47
48
|
action: {
|
|
48
|
-
label:
|
|
49
|
-
onClick: () =>
|
|
49
|
+
label: F("contentPages.backToContentPages", "Back to Content Pages"),
|
|
50
|
+
onClick: () => D(k)
|
|
50
51
|
}
|
|
51
52
|
})
|
|
52
53
|
});
|
|
53
|
-
let
|
|
54
|
+
let z = (e) => e ? new Date(e).toLocaleDateString("en-US", {
|
|
54
55
|
year: "numeric",
|
|
55
56
|
month: "long",
|
|
56
57
|
day: "numeric",
|
|
57
58
|
hour: "2-digit",
|
|
58
59
|
minute: "2-digit"
|
|
59
|
-
}) : "—",
|
|
60
|
+
}) : "—", B = A.seoTitle || A.seoDescription || A.seoKeywords;
|
|
60
61
|
return /* @__PURE__ */ x("div", {
|
|
61
62
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200",
|
|
62
63
|
children: [
|
|
@@ -64,46 +65,47 @@ function w() {
|
|
|
64
65
|
className: "mb-6",
|
|
65
66
|
children: [/* @__PURE__ */ x("button", {
|
|
66
67
|
type: "button",
|
|
67
|
-
onClick: () =>
|
|
68
|
+
onClick: () => D(k),
|
|
68
69
|
className: "\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n ",
|
|
69
70
|
children: [/* @__PURE__ */ b(p, { size: 20 }), /* @__PURE__ */ b("span", {
|
|
70
71
|
className: "text-sm font-medium",
|
|
71
|
-
children:
|
|
72
|
+
children: F("contentPages.backToContentPages", "Back to Content Pages")
|
|
72
73
|
})]
|
|
73
74
|
}), /* @__PURE__ */ x("div", {
|
|
74
|
-
className: "flex items-start justify-between",
|
|
75
|
+
className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",
|
|
75
76
|
children: [/* @__PURE__ */ x("div", {
|
|
76
77
|
className: "flex items-center gap-4",
|
|
77
78
|
children: [/* @__PURE__ */ b("div", {
|
|
78
|
-
className: "size-16 rounded-
|
|
79
|
+
className: "size-16 rounded-card bg-[var(--color-status-info-subtle)] flex items-center justify-center",
|
|
79
80
|
children: /* @__PURE__ */ b(h, {
|
|
80
81
|
size: 32,
|
|
81
82
|
className: "text-[var(--color-status-info)]"
|
|
82
83
|
})
|
|
83
84
|
}), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("div", {
|
|
84
|
-
className: "flex items-center gap-3 mb-2",
|
|
85
|
+
className: "flex flex-wrap items-center gap-3 mb-2",
|
|
85
86
|
children: [/* @__PURE__ */ b("h1", {
|
|
86
|
-
className: "text-3xl font-
|
|
87
|
-
children:
|
|
88
|
-
}), /* @__PURE__ */ b(u, { isPublished:
|
|
87
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
88
|
+
children: /* @__PURE__ */ b(w, { children: A.title })
|
|
89
|
+
}), /* @__PURE__ */ b(u, { isPublished: A.isPublished })]
|
|
89
90
|
}), /* @__PURE__ */ x("p", {
|
|
90
|
-
className: "text-text-secondary",
|
|
91
|
-
children: ["/",
|
|
91
|
+
className: "text-text-secondary font-mono",
|
|
92
|
+
children: ["/", A.slug]
|
|
92
93
|
})] })]
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
}), /* @__PURE__ */ b(C, {
|
|
95
|
+
primary: {
|
|
96
|
+
label: F("contentPages.editPage", "Edit Page"),
|
|
97
|
+
onSelect: () => D(`${k}/${E}/edit`),
|
|
98
|
+
icon: /* @__PURE__ */ b(m, { className: "size-4" })
|
|
99
|
+
},
|
|
100
|
+
actions: [{
|
|
101
|
+
label: F("contentPages.delete", "Delete"),
|
|
102
|
+
onSelect: () => {
|
|
103
|
+
R();
|
|
104
|
+
},
|
|
105
|
+
intent: "destructive",
|
|
106
|
+
disabled: P,
|
|
107
|
+
icon: /* @__PURE__ */ b(v, { className: "size-4" })
|
|
108
|
+
}]
|
|
107
109
|
})]
|
|
108
110
|
})]
|
|
109
111
|
}),
|
|
@@ -111,77 +113,77 @@ function w() {
|
|
|
111
113
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
112
114
|
children: [
|
|
113
115
|
/* @__PURE__ */ x("div", {
|
|
114
|
-
className: "lg:col-span-2 bg-surface border border-
|
|
116
|
+
className: "lg:col-span-2 bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]",
|
|
115
117
|
children: [/* @__PURE__ */ b("h2", {
|
|
116
118
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
117
|
-
children:
|
|
119
|
+
children: F("contentPages.contentPreview", "Content Preview")
|
|
118
120
|
}), /* @__PURE__ */ b("div", {
|
|
119
121
|
className: "prose prose-sm max-w-none text-text-secondary leading-relaxed",
|
|
120
|
-
dangerouslySetInnerHTML: { __html:
|
|
122
|
+
dangerouslySetInnerHTML: { __html: A.contentFormat === "markdown" ? T(A.content) : A.content }
|
|
121
123
|
})]
|
|
122
124
|
}),
|
|
123
125
|
/* @__PURE__ */ x("div", {
|
|
124
|
-
className: "bg-surface border border-
|
|
126
|
+
className: "bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]",
|
|
125
127
|
children: [/* @__PURE__ */ b("h2", {
|
|
126
128
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
127
|
-
children:
|
|
129
|
+
children: F("contentPages.metadata", "Metadata")
|
|
128
130
|
}), /* @__PURE__ */ x("dl", {
|
|
129
131
|
className: "space-y-3",
|
|
130
132
|
children: [
|
|
131
133
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
132
134
|
className: "text-sm font-medium text-text-secondary",
|
|
133
|
-
children:
|
|
135
|
+
children: F("contentPages.slug", "Slug")
|
|
134
136
|
}), /* @__PURE__ */ b("dd", {
|
|
135
137
|
className: "text-sm text-text-primary mt-1 font-mono",
|
|
136
|
-
children:
|
|
138
|
+
children: A.slug
|
|
137
139
|
})] }),
|
|
138
140
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
139
141
|
className: "text-sm font-medium text-text-secondary",
|
|
140
|
-
children:
|
|
142
|
+
children: F("contentPages.version", "Version")
|
|
141
143
|
}), /* @__PURE__ */ x("dd", {
|
|
142
144
|
className: "text-sm text-text-primary mt-1 font-mono",
|
|
143
|
-
children: ["v",
|
|
145
|
+
children: ["v", A.version]
|
|
144
146
|
})] }),
|
|
145
147
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
146
148
|
className: "text-sm font-medium text-text-secondary",
|
|
147
|
-
children:
|
|
149
|
+
children: F("contentPages.contentFormat", "Content Format")
|
|
148
150
|
}), /* @__PURE__ */ b("dd", {
|
|
149
151
|
className: "text-sm text-text-primary mt-1 capitalize",
|
|
150
|
-
children:
|
|
152
|
+
children: A.contentFormat
|
|
151
153
|
})] }),
|
|
152
154
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
153
155
|
className: "text-sm font-medium text-text-secondary",
|
|
154
|
-
children:
|
|
156
|
+
children: F("contentPages.sortOrder", "Sort Order")
|
|
155
157
|
}), /* @__PURE__ */ b("dd", {
|
|
156
158
|
className: "text-sm text-text-primary mt-1 font-mono",
|
|
157
|
-
children:
|
|
159
|
+
children: A.sortOrder
|
|
158
160
|
})] }),
|
|
159
161
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
160
162
|
className: "text-sm font-medium text-text-secondary",
|
|
161
|
-
children:
|
|
163
|
+
children: F("contentPages.created", "Created")
|
|
162
164
|
}), /* @__PURE__ */ b("dd", {
|
|
163
165
|
className: "text-sm text-text-primary mt-1",
|
|
164
|
-
children:
|
|
166
|
+
children: z(A.createdAt)
|
|
165
167
|
})] }),
|
|
166
168
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
167
169
|
className: "text-sm font-medium text-text-secondary",
|
|
168
|
-
children:
|
|
170
|
+
children: F("contentPages.lastUpdated", "Last Updated")
|
|
169
171
|
}), /* @__PURE__ */ b("dd", {
|
|
170
172
|
className: "text-sm text-text-primary mt-1",
|
|
171
|
-
children:
|
|
173
|
+
children: z(A.updatedAt)
|
|
172
174
|
})] }),
|
|
173
|
-
|
|
175
|
+
A.lastUpdated && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
174
176
|
className: "text-sm font-medium text-text-secondary",
|
|
175
|
-
children:
|
|
177
|
+
children: F("contentPages.contentLastUpdated", "Content Last Updated")
|
|
176
178
|
}), /* @__PURE__ */ b("dd", {
|
|
177
179
|
className: "text-sm text-text-primary mt-1",
|
|
178
|
-
children:
|
|
180
|
+
children: z(A.lastUpdated)
|
|
179
181
|
})] })
|
|
180
182
|
]
|
|
181
183
|
})]
|
|
182
184
|
}),
|
|
183
|
-
|
|
184
|
-
className: "bg-surface border border-
|
|
185
|
+
B && /* @__PURE__ */ x("div", {
|
|
186
|
+
className: "bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]",
|
|
185
187
|
children: [/* @__PURE__ */ x("div", {
|
|
186
188
|
className: "flex items-center gap-2 mb-4",
|
|
187
189
|
children: [/* @__PURE__ */ b(g, {
|
|
@@ -189,33 +191,33 @@ function w() {
|
|
|
189
191
|
className: "text-text-secondary"
|
|
190
192
|
}), /* @__PURE__ */ b("h2", {
|
|
191
193
|
className: "text-lg font-semibold text-text-primary",
|
|
192
|
-
children:
|
|
194
|
+
children: F("contentPages.seoInformation", "SEO Information")
|
|
193
195
|
})]
|
|
194
196
|
}), /* @__PURE__ */ x("dl", {
|
|
195
197
|
className: "space-y-3",
|
|
196
198
|
children: [
|
|
197
|
-
|
|
199
|
+
A.seoTitle && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
198
200
|
className: "text-sm font-medium text-text-secondary",
|
|
199
|
-
children:
|
|
201
|
+
children: F("contentPages.seoTitle", "SEO Title")
|
|
200
202
|
}), /* @__PURE__ */ b("dd", {
|
|
201
203
|
className: "text-sm text-text-primary mt-1",
|
|
202
|
-
children:
|
|
204
|
+
children: A.seoTitle
|
|
203
205
|
})] }),
|
|
204
|
-
|
|
206
|
+
A.seoDescription && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
205
207
|
className: "text-sm font-medium text-text-secondary",
|
|
206
|
-
children:
|
|
208
|
+
children: F("contentPages.seoDescription", "SEO Description")
|
|
207
209
|
}), /* @__PURE__ */ b("dd", {
|
|
208
210
|
className: "text-sm text-text-primary mt-1",
|
|
209
|
-
children:
|
|
211
|
+
children: A.seoDescription
|
|
210
212
|
})] }),
|
|
211
|
-
|
|
213
|
+
A.seoKeywords && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
212
214
|
className: "text-sm font-medium text-text-secondary",
|
|
213
|
-
children:
|
|
215
|
+
children: F("contentPages.seoKeywords", "SEO Keywords")
|
|
214
216
|
}), /* @__PURE__ */ b("dd", {
|
|
215
217
|
className: "text-sm text-text-primary mt-1",
|
|
216
218
|
children: /* @__PURE__ */ b("div", {
|
|
217
219
|
className: "flex flex-wrap gap-1.5 mt-1",
|
|
218
|
-
children:
|
|
220
|
+
children: A.seoKeywords.split(",").map((e) => /* @__PURE__ */ b("span", {
|
|
219
221
|
className: "\n inline-flex px-2 py-0.5\n bg-bg-sunken\n text-text-secondary\n rounded-md text-xs font-medium\n ",
|
|
220
222
|
children: e.trim()
|
|
221
223
|
}, e.trim()))
|
|
@@ -224,8 +226,8 @@ function w() {
|
|
|
224
226
|
]
|
|
225
227
|
})]
|
|
226
228
|
}),
|
|
227
|
-
|
|
228
|
-
className: "bg-surface border border-
|
|
229
|
+
A.productId && /* @__PURE__ */ x("div", {
|
|
230
|
+
className: "bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]",
|
|
229
231
|
children: [/* @__PURE__ */ x("div", {
|
|
230
232
|
className: "flex items-center gap-2 mb-4",
|
|
231
233
|
children: [/* @__PURE__ */ b(_, {
|
|
@@ -233,55 +235,55 @@ function w() {
|
|
|
233
235
|
className: "text-text-secondary"
|
|
234
236
|
}), /* @__PURE__ */ b("h2", {
|
|
235
237
|
className: "text-lg font-semibold text-text-primary",
|
|
236
|
-
children:
|
|
238
|
+
children: F("contentPages.productAssociation", "Product Association")
|
|
237
239
|
})]
|
|
238
240
|
}), /* @__PURE__ */ x("dl", {
|
|
239
241
|
className: "space-y-3",
|
|
240
242
|
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
241
243
|
className: "text-sm font-medium text-text-secondary",
|
|
242
|
-
children:
|
|
244
|
+
children: F("contentPages.productId", "Product ID")
|
|
243
245
|
}), /* @__PURE__ */ b("dd", {
|
|
244
246
|
className: "text-sm text-text-primary mt-1 font-mono",
|
|
245
|
-
children:
|
|
246
|
-
})] }),
|
|
247
|
+
children: A.productId
|
|
248
|
+
})] }), A.product && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
247
249
|
className: "text-sm font-medium text-text-secondary",
|
|
248
|
-
children:
|
|
250
|
+
children: F("contentPages.productName", "Product Name")
|
|
249
251
|
}), /* @__PURE__ */ b("dd", {
|
|
250
252
|
className: "text-sm text-text-primary mt-1",
|
|
251
|
-
children:
|
|
253
|
+
children: A.product.name
|
|
252
254
|
})] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
253
255
|
className: "text-sm font-medium text-text-secondary",
|
|
254
|
-
children:
|
|
256
|
+
children: F("contentPages.productSlug", "Product Slug")
|
|
255
257
|
}), /* @__PURE__ */ x("dd", {
|
|
256
258
|
className: "text-sm text-text-primary mt-1 font-mono",
|
|
257
|
-
children: ["/",
|
|
259
|
+
children: ["/", A.product.slug]
|
|
258
260
|
})] })] })]
|
|
259
261
|
})]
|
|
260
262
|
}),
|
|
261
|
-
|
|
262
|
-
className: "bg-surface border border-
|
|
263
|
+
A.tags && A.tags.length > 0 && /* @__PURE__ */ x("div", {
|
|
264
|
+
className: "bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1",
|
|
263
265
|
children: [/* @__PURE__ */ b("h2", {
|
|
264
266
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
265
|
-
children:
|
|
266
|
-
}), /* @__PURE__ */ b(d, { tags:
|
|
267
|
+
children: F("contentPages.tags", "Tags")
|
|
268
|
+
}), /* @__PURE__ */ b(d, { tags: A.tags })]
|
|
267
269
|
}),
|
|
268
270
|
/* @__PURE__ */ x("div", {
|
|
269
|
-
className: "lg:col-span-2 bg-surface border border-
|
|
271
|
+
className: "lg:col-span-2 bg-bg-surface border border-border-seam rounded-card shadow-elevation-1",
|
|
270
272
|
children: [/* @__PURE__ */ b("h2", {
|
|
271
273
|
className: "text-lg font-semibold text-text-primary p-6 pb-0",
|
|
272
|
-
children:
|
|
274
|
+
children: F("contentPages.activityHistory", "Activity History")
|
|
273
275
|
}), /* @__PURE__ */ b(f, {
|
|
274
|
-
resourceId:
|
|
276
|
+
resourceId: A.id,
|
|
275
277
|
resourceType: "ProductContentPage"
|
|
276
278
|
})]
|
|
277
279
|
})
|
|
278
280
|
]
|
|
279
281
|
}),
|
|
280
|
-
|
|
282
|
+
L
|
|
281
283
|
]
|
|
282
284
|
});
|
|
283
285
|
}
|
|
284
286
|
//#endregion
|
|
285
|
-
export {
|
|
287
|
+
export { E as ContentPageDetailPage };
|
|
286
288
|
|
|
287
289
|
//# sourceMappingURL=ContentPageDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft, Edit, Trash2, FileText, Globe, Package } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useDeleteContentPage } from '../hooks/useContentPages';\nimport { ContentPageStatusBadge } from '../components/ContentPageStatusBadge';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { TagList } from '../../../shared/components/TagList';\nimport { AuditHistoryTab } from '../../../shared/components/AuditHistoryTab';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\n/**\n * Simple markdown renderer for content preview\n * Converts basic markdown syntax to HTML\n */\nfunction renderMarkdown(content: string): string {\n return (\n content\n // Headers\n .replace(/^### (.+)$/gm, '<h3 class=\"text-lg font-semibold mt-4 mb-2\">$1</h3>')\n .replace(/^## (.+)$/gm, '<h2 class=\"text-xl font-semibold mt-5 mb-2\">$1</h2>')\n .replace(/^# (.+)$/gm, '<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>')\n // Bold and italic\n .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n // Inline code\n .replace(\n /`(.+?)`/g,\n '<code class=\"px-1.5 py-0.5 bg-bg-sunken rounded text-sm font-mono\">$1</code>'\n )\n // Code blocks\n .replace(/```[\\s\\S]*?```/g, (match) => {\n const code = match.replace(/```\\w*\\n?/, '').replace(/\\n?```$/, '');\n return `<pre class=\"bg-bg-sunken rounded-lg p-4 overflow-x-auto my-3\"><code class=\"text-sm font-mono\">${code}</code></pre>`;\n })\n // Links\n .replace(\n /\\[(.+?)\\]\\((.+?)\\)/g,\n '<a href=\"$2\" class=\"text-[var(--color-status-info)] underline\">$1</a>'\n )\n // Unordered lists\n .replace(/^- (.+)$/gm, '<li class=\"ml-4 list-disc\">$1</li>')\n // Paragraphs (double newline)\n .replace(/\\n\\n/g, '</p><p class=\"mb-3\">')\n // Single newlines\n .replace(/\\n/g, '<br/>')\n );\n}\n\n/**\n * Content Page Detail Page\n * Shows comprehensive content page information\n */\nexport function ContentPageDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading, error } = useContentPage(id!);\n const { deleteContentPage, loading: deleteLoading } = useDeleteContentPage();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const message = tr(\n 'contentPages.confirmDelete',\n 'Are you sure you want to delete this content page?'\n );\n const native = await nativeConfirm({\n title: 'Delete content page',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Delete content page',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n destructive: true,\n })\n : native;\n if (!ok) return;\n\n try {\n await deleteContentPage(id!);\n void nativeNotify('success');\n navigate(contentPagesBasePath);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete content page:', error);\n }\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (error || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n error?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n const formatDate = (dateString: string | null) => {\n if (!dateString) return '—';\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n };\n\n const hasSeo = contentPage.seoTitle || contentPage.seoDescription || contentPage.seoKeywords;\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={() => navigate(contentPagesBasePath)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backToContentPages', 'Back to Content Pages')}\n </span>\n </button>\n\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-16 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center\">\n <FileText size={32} className=\"text-[var(--color-status-info)]\" />\n </div>\n\n <div>\n <div className=\"flex items-center gap-3 mb-2\">\n <h1 className=\"text-3xl font-bold text-text-primary\">{contentPage.title}</h1>\n <ContentPageStatusBadge isPublished={contentPage.isPublished} />\n </div>\n <p className=\"text-text-secondary\">/{contentPage.slug}</p>\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(`${contentPagesBasePath}/${id}/edit`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n \"\n >\n <Edit size={16} />\n Edit Page\n </button>\n\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={deleteLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-status-error-subtle)]\n text-[var(--color-status-error)]\n border border-[var(--color-status-error-border)]\n rounded-lg\n hover:opacity-80\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Trash2 size={16} />\n Delete\n </button>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Content Preview */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.contentPreview', 'Content Preview')}\n </h2>\n <div\n className=\"prose prose-sm max-w-none text-text-secondary leading-relaxed\"\n dangerouslySetInnerHTML={{\n __html:\n contentPage.contentFormat === 'markdown'\n ? renderMarkdown(contentPage.content)\n : contentPage.content,\n }}\n />\n </div>\n\n {/* Metadata */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.metadata', 'Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.slug', 'Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.slug}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.version', 'Version')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">v{contentPage.version}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentFormat', 'Content Format')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 capitalize\">\n {contentPage.contentFormat}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.sortOrder', 'Sort Order')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.sortOrder}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.created', 'Created')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.createdAt)}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.lastUpdated', 'Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.updatedAt)}\n </dd>\n </div>\n {contentPage.lastUpdated && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentLastUpdated', 'Content Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.lastUpdated)}\n </dd>\n </div>\n )}\n </dl>\n </div>\n\n {/* SEO Information */}\n {hasSeo && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Globe size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.seoInformation', 'SEO Information')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n {contentPage.seoTitle && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoTitle', 'SEO Title')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoTitle}</dd>\n </div>\n )}\n {contentPage.seoDescription && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoDescription', 'SEO Description')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoDescription}</dd>\n </div>\n )}\n {contentPage.seoKeywords && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoKeywords', 'SEO Keywords')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n <div className=\"flex flex-wrap gap-1.5 mt-1\">\n {contentPage.seoKeywords.split(',').map((keyword) => (\n <span\n key={keyword.trim()}\n className=\"\n inline-flex px-2 py-0.5\n bg-bg-sunken\n text-text-secondary\n rounded-md text-xs font-medium\n \"\n >\n {keyword.trim()}\n </span>\n ))}\n </div>\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* Product Association */}\n {contentPage.productId && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Package size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.productAssociation', 'Product Association')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productId', 'Product ID')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n {contentPage.productId}\n </dd>\n </div>\n {contentPage.product && (\n <>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productName', 'Product Name')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.product.name}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productSlug', 'Product Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n /{contentPage.product.slug}\n </dd>\n </div>\n </>\n )}\n </dl>\n </div>\n )}\n\n {/* Tags */}\n {contentPage.tags && contentPage.tags.length > 0 && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.tags', 'Tags')}\n </h2>\n <TagList tags={contentPage.tags} />\n </div>\n )}\n\n {/* Activity History */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary p-6 pb-0\">\n {tr('contentPages.activityHistory', 'Activity History')}\n </h2>\n <AuditHistoryTab resourceId={contentPage.id} resourceType=\"ProductContentPage\" />\n </div>\n </div>\n {ConfirmDialog}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAS,EAAe,GAAyB;AAC/C,QACE,EAEG,QAAQ,gBAAgB,wDAAsD,CAC9E,QAAQ,eAAe,wDAAsD,CAC7E,QAAQ,cAAc,qDAAmD,CAEzE,QAAQ,kBAAkB,sBAAsB,CAChD,QAAQ,cAAc,cAAc,CAEpC,QACC,YACA,iFACD,CAEA,QAAQ,oBAAoB,MAEpB,iGADM,EAAM,QAAQ,aAAa,GAAG,CAAC,QAAQ,WAAW,GACyC,CAAK,eAC7G,CAED,QACC,uBACA,4EACD,CAEA,QAAQ,cAAc,uCAAqC,CAE3D,QAAQ,SAAS,yBAAuB,CAExC,QAAQ,OAAO,QAAQ;;AAQ9B,SAAgB,IAAwB;CACtC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAuB,GAAG,EAAS,iBACnC,EAAE,gBAAa,YAAS,aAAU,EAAe,EAAI,EACrD,EAAE,sBAAmB,SAAS,MAAkB,GAAsB,EACtE,IAAK,GAAO,EACZ,EAAE,YAAS,qBAAkB,GAAkB,EAE/C,IAAe,YAAY;AAC1B,IAAa,SAAS;EAC3B,IAAM,IAAU,EACd,8BACA,qDACD,EACK,IAAS,MAAM,EAAc;GACjC,OAAO;GACP;GACA,eAAe;GACf,mBAAmB;GACpB,CAAC;AAEA,YAAW,OACP,MAAM,EAAQ;GACZ,OAAO;GACP;GACA,eAAe;GACf,mBAAmB;GACnB,aAAa;GACd,CAAC,GACF,EAGN,KAAI;AA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U;kBACX,EAAG,4BAA4B,eAAe;QAC5C,CAAA,EACL,kBAAC,MAAD;QAAI,WAAU;kBAAkC,EAAY,QAAQ;QAAU,CAAA,CAC1E,EAAA,CAAA,EACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAG,4BAA4B,eAAe;QAC5C,CAAA,EACL,kBAAC,MAAD;QAAI,WAAU;kBAAd,CAAyD,KACrD,EAAY,QAAQ,KACnB;UACD,EAAA,CAAA,CACL,EAAA,CAAA,CAEF;SACD;;KAIP,EAAY,QAAQ,EAAY,KAAK,SAAS,KAC7C,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAG,qBAAqB,OAAO;OAC7B,CAAA,EACL,kBAAC,GAAD,EAAS,MAAM,EAAY,MAAQ,CAAA,CAC/B;;KAIR,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAG,gCAAgC,mBAAmB;OACpD,CAAA,EACL,kBAAC,GAAD;OAAiB,YAAY,EAAY;OAAI,cAAa;OAAuB,CAAA,CAC7E;;KACF;;GACL;GACG"}
|
|
1
|
+
{"version":3,"file":"ContentPageDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft, Edit, Trash2, FileText, Globe, Package } from 'lucide-react';\nimport { CTAOverflowMenu, GradientText } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useDeleteContentPage } from '../hooks/useContentPages';\nimport { ContentPageStatusBadge } from '../components/ContentPageStatusBadge';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { TagList } from '../../../shared/components/TagList';\nimport { AuditHistoryTab } from '../../../shared/components/AuditHistoryTab';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\n/**\n * Simple markdown renderer for content preview\n * Converts basic markdown syntax to HTML\n */\nfunction renderMarkdown(content: string): string {\n return (\n content\n // Headers\n .replace(/^### (.+)$/gm, '<h3 class=\"text-lg font-semibold mt-4 mb-2\">$1</h3>')\n .replace(/^## (.+)$/gm, '<h2 class=\"text-xl font-semibold mt-5 mb-2\">$1</h2>')\n .replace(/^# (.+)$/gm, '<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>')\n // Bold and italic\n .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n // Inline code\n .replace(\n /`(.+?)`/g,\n '<code class=\"px-1.5 py-0.5 bg-bg-sunken rounded text-sm font-mono\">$1</code>'\n )\n // Code blocks\n .replace(/```[\\s\\S]*?```/g, (match) => {\n const code = match.replace(/```\\w*\\n?/, '').replace(/\\n?```$/, '');\n return `<pre class=\"bg-bg-sunken rounded-lg p-4 overflow-x-auto my-3\"><code class=\"text-sm font-mono\">${code}</code></pre>`;\n })\n // Links\n .replace(\n /\\[(.+?)\\]\\((.+?)\\)/g,\n '<a href=\"$2\" class=\"text-[var(--color-status-info)] underline\">$1</a>'\n )\n // Unordered lists\n .replace(/^- (.+)$/gm, '<li class=\"ml-4 list-disc\">$1</li>')\n // Paragraphs (double newline)\n .replace(/\\n\\n/g, '</p><p class=\"mb-3\">')\n // Single newlines\n .replace(/\\n/g, '<br/>')\n );\n}\n\n/**\n * Content Page Detail Page\n * Shows comprehensive content page information\n */\nexport function ContentPageDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading, error } = useContentPage(id!);\n const { deleteContentPage, loading: deleteLoading } = useDeleteContentPage();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const message = tr(\n 'contentPages.confirmDelete',\n 'Are you sure you want to delete this content page?'\n );\n const native = await nativeConfirm({\n title: 'Delete content page',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Delete content page',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n destructive: true,\n })\n : native;\n if (!ok) return;\n\n try {\n await deleteContentPage(id!);\n void nativeNotify('success');\n navigate(contentPagesBasePath);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete content page:', error);\n }\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (error || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n error?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n const formatDate = (dateString: string | null) => {\n if (!dateString) return '—';\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n };\n\n const hasSeo = contentPage.seoTitle || contentPage.seoDescription || contentPage.seoKeywords;\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={() => navigate(contentPagesBasePath)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backToContentPages', 'Back to Content Pages')}\n </span>\n </button>\n\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-16 rounded-card bg-[var(--color-status-info-subtle)] flex items-center justify-center\">\n <FileText size={32} className=\"text-[var(--color-status-info)]\" />\n </div>\n\n <div>\n <div className=\"flex flex-wrap items-center gap-3 mb-2\">\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n <GradientText>{contentPage.title}</GradientText>\n </h1>\n <ContentPageStatusBadge isPublished={contentPage.isPublished} />\n </div>\n <p className=\"text-text-secondary font-mono\">/{contentPage.slug}</p>\n </div>\n </div>\n\n <CTAOverflowMenu\n primary={{\n label: tr('contentPages.editPage', 'Edit Page'),\n onSelect: () => navigate(`${contentPagesBasePath}/${id}/edit`),\n icon: <Edit className=\"size-4\" />,\n }}\n actions={[\n {\n label: tr('contentPages.delete', 'Delete'),\n onSelect: () => {\n void handleDelete();\n },\n intent: 'destructive',\n disabled: deleteLoading,\n icon: <Trash2 className=\"size-4\" />,\n },\n ]}\n />\n </div>\n </div>\n\n {/* Content */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Content Preview */}\n <div className=\"lg:col-span-2 bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.contentPreview', 'Content Preview')}\n </h2>\n <div\n className=\"prose prose-sm max-w-none text-text-secondary leading-relaxed\"\n dangerouslySetInnerHTML={{\n __html:\n contentPage.contentFormat === 'markdown'\n ? renderMarkdown(contentPage.content)\n : contentPage.content,\n }}\n />\n </div>\n\n {/* Metadata */}\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.metadata', 'Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.slug', 'Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.slug}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.version', 'Version')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">v{contentPage.version}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentFormat', 'Content Format')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 capitalize\">\n {contentPage.contentFormat}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.sortOrder', 'Sort Order')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.sortOrder}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.created', 'Created')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.createdAt)}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.lastUpdated', 'Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.updatedAt)}\n </dd>\n </div>\n {contentPage.lastUpdated && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentLastUpdated', 'Content Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.lastUpdated)}\n </dd>\n </div>\n )}\n </dl>\n </div>\n\n {/* SEO Information */}\n {hasSeo && (\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Globe size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.seoInformation', 'SEO Information')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n {contentPage.seoTitle && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoTitle', 'SEO Title')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoTitle}</dd>\n </div>\n )}\n {contentPage.seoDescription && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoDescription', 'SEO Description')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoDescription}</dd>\n </div>\n )}\n {contentPage.seoKeywords && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoKeywords', 'SEO Keywords')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n <div className=\"flex flex-wrap gap-1.5 mt-1\">\n {contentPage.seoKeywords.split(',').map((keyword) => (\n <span\n key={keyword.trim()}\n className=\"\n inline-flex px-2 py-0.5\n bg-bg-sunken\n text-text-secondary\n rounded-md text-xs font-medium\n \"\n >\n {keyword.trim()}\n </span>\n ))}\n </div>\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* Product Association */}\n {contentPage.productId && (\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Package size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.productAssociation', 'Product Association')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productId', 'Product ID')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n {contentPage.productId}\n </dd>\n </div>\n {contentPage.product && (\n <>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productName', 'Product Name')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.product.name}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productSlug', 'Product Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n /{contentPage.product.slug}\n </dd>\n </div>\n </>\n )}\n </dl>\n </div>\n )}\n\n {/* Tags */}\n {contentPage.tags && contentPage.tags.length > 0 && (\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.tags', 'Tags')}\n </h2>\n <TagList tags={contentPage.tags} />\n </div>\n )}\n\n {/* Activity History */}\n <div className=\"lg:col-span-2 bg-bg-surface border border-border-seam rounded-card shadow-elevation-1\">\n <h2 className=\"text-lg font-semibold text-text-primary p-6 pb-0\">\n {tr('contentPages.activityHistory', 'Activity History')}\n </h2>\n <AuditHistoryTab resourceId={contentPage.id} resourceType=\"ProductContentPage\" />\n </div>\n </div>\n {ConfirmDialog}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAS,EAAe,GAAyB;AAC/C,QACE,EAEG,QAAQ,gBAAgB,wDAAsD,CAC9E,QAAQ,eAAe,wDAAsD,CAC7E,QAAQ,cAAc,qDAAmD,CAEzE,QAAQ,kBAAkB,sBAAsB,CAChD,QAAQ,cAAc,cAAc,CAEpC,QACC,YACA,iFACD,CAEA,QAAQ,oBAAoB,MAEpB,iGADM,EAAM,QAAQ,aAAa,GAAG,CAAC,QAAQ,WAAW,GACyC,CAAK,eAC7G,CAED,QACC,uBACA,4EACD,CAEA,QAAQ,cAAc,uCAAqC,CAE3D,QAAQ,SAAS,yBAAuB,C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,mBAAmB;OACpD,CAAA,EACL,kBAAC,GAAD;OAAiB,YAAY,EAAY;OAAI,cAAa;OAAuB,CAAA,CAC7E;;KACF;;GACL;GACG"}
|
|
@@ -51,7 +51,7 @@ function f() {
|
|
|
51
51
|
})]
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ l("h1", {
|
|
54
|
-
className: "text-3xl font-
|
|
54
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2",
|
|
55
55
|
children: C("contentPages.editContentPage", "Edit Content Page")
|
|
56
56
|
}),
|
|
57
57
|
/* @__PURE__ */ l("p", {
|
|
@@ -70,7 +70,7 @@ function f() {
|
|
|
70
70
|
/* @__PURE__ */ l("div", {
|
|
71
71
|
className: "max-w-2xl",
|
|
72
72
|
children: /* @__PURE__ */ l("div", {
|
|
73
|
-
className: "bg-surface border border-
|
|
73
|
+
className: "bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1",
|
|
74
74
|
children: /* @__PURE__ */ l(o, {
|
|
75
75
|
contentPage: g,
|
|
76
76
|
onSubmit: w,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageEditPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useUpdateContentPage } from '../hooks/useContentPages';\nimport { ContentPageForm } from '../components/ContentPageForm';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateContentPageInput } from '../types';\n\nexport function ContentPageEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading: fetchLoading, error: fetchError } = useContentPage(id!);\n const { updateContentPage, loading: updateLoading } = useUpdateContentPage();\n const [error, setError] = useState<string | null>(null);\n const tr = useTr();\n\n const handleSubmit = async (data: UpdateContentPageInput) => {\n if (!id) return;\n\n try {\n setError(null);\n await updateContentPage(id, data);\n navigate(`${contentPagesBasePath}/${id}`);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to update content page';\n setError(message);\n console.error('Failed to update content page:', err);\n }\n };\n\n const handleCancel = () => {\n navigate(`${contentPagesBasePath}/${id}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (fetchError || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n fetchError?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backTo', 'Back to')} {contentPage.title}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-
|
|
1
|
+
{"version":3,"file":"ContentPageEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageEditPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useUpdateContentPage } from '../hooks/useContentPages';\nimport { ContentPageForm } from '../components/ContentPageForm';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateContentPageInput } from '../types';\n\nexport function ContentPageEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading: fetchLoading, error: fetchError } = useContentPage(id!);\n const { updateContentPage, loading: updateLoading } = useUpdateContentPage();\n const [error, setError] = useState<string | null>(null);\n const tr = useTr();\n\n const handleSubmit = async (data: UpdateContentPageInput) => {\n if (!id) return;\n\n try {\n setError(null);\n await updateContentPage(id, data);\n navigate(`${contentPagesBasePath}/${id}`);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to update content page';\n setError(message);\n console.error('Failed to update content page:', err);\n }\n };\n\n const handleCancel = () => {\n navigate(`${contentPagesBasePath}/${id}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (fetchError || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n fetchError?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backTo', 'Back to')} {contentPage.title}\n </span>\n </button>\n\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n {tr('contentPages.editContentPage', 'Edit Content Page')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('contentPages.editContentPageSubtitle', 'Update content page information')}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error-border)] rounded-lg\">\n <p className=\"text-sm text-[var(--color-status-error)]\">{error}</p>\n </div>\n )}\n\n <div className=\"max-w-2xl\">\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1\">\n <ContentPageForm\n contentPage={contentPage}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n loading={updateLoading}\n />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,IAAsB;CACpC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAuB,GAAG,EAAS,iBACnC,EAAE,gBAAa,SAAS,GAAc,OAAO,MAAe,EAAe,EAAI,EAC/E,EAAE,sBAAmB,SAAS,MAAkB,GAAsB,EACtE,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,IAAK,GAAO,EAEZ,IAAe,OAAO,MAAiC;AACtD,QAEL,KAAI;AAGF,GAFA,EAAS,KAAK,EACd,MAAM,EAAkB,GAAI,EAAK,EACjC,EAAS,GAAG,EAAqB,GAAG,IAAK;WAClC,GAAK;AAGZ,GADA,EADgB,aAAe,QAAQ,EAAI,UAAU,gCACpC,EACjB,QAAQ,MAAM,kCAAkC,EAAI;;IAIlD,UAAqB;AACzB,IAAS,GAAG,EAAqB,GAAG,IAAK;;AA2B3C,QAxBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAc,SAAS,EAAG,mCAAmC,0BAA0B,EAAI,CAAA;EACvF,CAAA,GAIN,KAAc,CAAC,IAEf,kBAAC,OAAD;EAAK,WA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