@burdenoff/microfe-admin 2026.626.1 → 2026.720.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/admin/AdminRoot.js +2 -2
- package/dist/admin/AdminRoot.js.map +1 -1
- package/dist/admin/AdminRoutes.js +130 -78
- package/dist/admin/AdminRoutes.js.map +1 -1
- package/dist/admin/components/ConfirmDialog.js.map +1 -1
- package/dist/admin/components/DataTable.js.map +1 -1
- package/dist/admin/components/MarkdownEditor.js +116 -0
- package/dist/admin/components/MarkdownEditor.js.map +1 -0
- package/dist/admin/components/index.js +1 -0
- package/dist/admin/constants/featureFlags.js +12 -0
- package/dist/admin/constants/featureFlags.js.map +1 -0
- package/dist/admin/pages/AuditLogsPage.js.map +1 -1
- package/dist/admin/pages/CommunicationsPage.js.map +1 -1
- package/dist/admin/pages/ContentPagesPage.js +197 -197
- package/dist/admin/pages/ContentPagesPage.js.map +1 -1
- package/dist/admin/pages/DashboardPage.js +5 -5
- package/dist/admin/pages/FeatureFlagsPage.js.map +1 -1
- package/dist/admin/pages/ReferralsPage.js.map +1 -1
- package/dist/admin/pages/RolesPermissionsPage.js.map +1 -1
- package/dist/admin/pages/SREPage.js.map +1 -1
- package/dist/admin/pages/SandboxSettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage.js +6 -6
- package/dist/admin/pages/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SyncFailuresPage.js.map +1 -1
- package/dist/admin/pages/TenantDetailPage.js +169 -157
- package/dist/admin/pages/TenantDetailPage.js.map +1 -1
- package/dist/admin/pages/TenantFormRoutePage.js +75 -74
- package/dist/admin/pages/TenantFormRoutePage.js.map +1 -1
- package/dist/admin/pages/TenantsListPage.js +169 -157
- package/dist/admin/pages/TenantsListPage.js.map +1 -1
- package/dist/admin/pages/UsersListPage.js +5 -5
- package/package.json +2 -2
|
@@ -2,21 +2,22 @@ import { useToast as e } from "../components/Toast.js";
|
|
|
2
2
|
import { useAdminPermissions as t } from "../hooks/useAdminPermissions.js";
|
|
3
3
|
import { Badge as n, Button as r, EmptyState as i, Input as a } from "../components/ui.js";
|
|
4
4
|
import { PageLayout as ee } from "../components/PageLayout.js";
|
|
5
|
-
import { formatDate as
|
|
6
|
-
import { DataTable as
|
|
7
|
-
import { FormRow as
|
|
8
|
-
import { DeleteConfirmDialog as
|
|
9
|
-
import { RowActions as
|
|
10
|
-
import { PermissionGuard as
|
|
5
|
+
import { formatDate as te } from "../utils/formatters.js";
|
|
6
|
+
import { DataTable as ne, Pagination as re } from "../components/DataTable.js";
|
|
7
|
+
import { FormRow as o, FormSection as s, FormSheet as ie, FormSheetFooter as ae } from "../components/FormSheet.js";
|
|
8
|
+
import { DeleteConfirmDialog as oe } from "../components/ConfirmDialog.js";
|
|
9
|
+
import { RowActions as se, createRowActions as ce } from "../components/RowActions.js";
|
|
10
|
+
import { PermissionGuard as le } from "../components/PermissionGuard.js";
|
|
11
|
+
import { MarkdownEditor as ue } from "../components/MarkdownEditor.js";
|
|
11
12
|
import "../components/index.js";
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { FileText as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { EmphasisPanel as
|
|
16
|
-
import { gql as
|
|
17
|
-
import { useApolloClient as
|
|
13
|
+
import { useCallback as c, useEffect as l, useRef as de, useState as u } from "react";
|
|
14
|
+
import { FileText as d, Plus as fe, Search as pe } from "lucide-react";
|
|
15
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
16
|
+
import { EmphasisPanel as me, PagePurpose as he } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
import { gql as m } from "@apollo/client";
|
|
18
|
+
import { useApolloClient as ge } from "@apollo/client/react";
|
|
18
19
|
//#region src/admin/pages/ContentPagesPage.tsx
|
|
19
|
-
var
|
|
20
|
+
var h = 20, g = [
|
|
20
21
|
{
|
|
21
22
|
value: "blog",
|
|
22
23
|
label: "Blog",
|
|
@@ -32,11 +33,11 @@ var g = 20, _ = [
|
|
|
32
33
|
label: "Changelog",
|
|
33
34
|
category: "Changelog"
|
|
34
35
|
}
|
|
35
|
-
],
|
|
36
|
+
], _ = {
|
|
36
37
|
blog: "default",
|
|
37
38
|
"case-study": "secondary",
|
|
38
39
|
changelog: "outline"
|
|
39
|
-
},
|
|
40
|
+
}, _e = m`
|
|
40
41
|
query AdminContentListProducts($limit: Int, $offset: Int) {
|
|
41
42
|
platformProducts(limit: $limit, offset: $offset) {
|
|
42
43
|
items {
|
|
@@ -46,7 +47,7 @@ var g = 20, _ = [
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
`,
|
|
50
|
+
`, ve = m`
|
|
50
51
|
query AdminContentPages(
|
|
51
52
|
$productId: String
|
|
52
53
|
$filter: ContentPageFilterInput
|
|
@@ -76,25 +77,25 @@ var g = 20, _ = [
|
|
|
76
77
|
total
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
`,
|
|
80
|
+
`, ye = m`
|
|
80
81
|
mutation AdminCreateContentPage($input: CreateContentPageInput!) {
|
|
81
82
|
createContentPage(input: $input) {
|
|
82
83
|
id
|
|
83
84
|
slug
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
`,
|
|
87
|
+
`, be = m`
|
|
87
88
|
mutation AdminUpdateContentPage($id: ID!, $input: UpdateContentPageInput!) {
|
|
88
89
|
updateContentPage(id: $id, input: $input) {
|
|
89
90
|
id
|
|
90
91
|
slug
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
`,
|
|
94
|
+
`, xe = m`
|
|
94
95
|
mutation AdminDeleteContentPage($id: ID!) {
|
|
95
96
|
deleteContentPage(id: $id)
|
|
96
97
|
}
|
|
97
|
-
`,
|
|
98
|
+
`, v = {
|
|
98
99
|
productId: "",
|
|
99
100
|
type: "blog",
|
|
100
101
|
slug: "",
|
|
@@ -108,24 +109,24 @@ var g = 20, _ = [
|
|
|
108
109
|
featured: !1,
|
|
109
110
|
isPublished: !0
|
|
110
111
|
};
|
|
111
|
-
function
|
|
112
|
+
function Se(e) {
|
|
112
113
|
return e.includes("changelog") ? "changelog" : e.includes("case-study") ? "case-study" : "blog";
|
|
113
114
|
}
|
|
114
|
-
var
|
|
115
|
-
function
|
|
116
|
-
let { canViewProducts:
|
|
117
|
-
|
|
115
|
+
var y = "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50";
|
|
116
|
+
function b() {
|
|
117
|
+
let { canViewProducts: m, canManageProducts: b, isLoading: x } = t(), S = ge(), C = e(), [w, Ce] = u([]), [T, E] = u(""), [D, we] = u(""), [O, k] = u(""), [A, Te] = u(""), [j, M] = u(1), N = de(0);
|
|
118
|
+
l(() => {
|
|
118
119
|
let e = setTimeout(() => {
|
|
119
|
-
|
|
120
|
+
Te(O), M(1);
|
|
120
121
|
}, 300);
|
|
121
122
|
return () => clearTimeout(e);
|
|
122
|
-
}, [
|
|
123
|
-
let [
|
|
124
|
-
|
|
123
|
+
}, [O]);
|
|
124
|
+
let [P, Ee] = u([]), [F, De] = u(0), [I, L] = u(!1), [R, z] = u(null), [Oe, B] = u(!1), [V, H] = u(null), [U, W] = u(v), [ke, G] = u(!1), [K, q] = u(null), [J, Y] = u(!1), X = x || !m;
|
|
125
|
+
l(() => {
|
|
125
126
|
if (X) return;
|
|
126
127
|
let e = !0;
|
|
127
|
-
return
|
|
128
|
-
query:
|
|
128
|
+
return S.query({
|
|
129
|
+
query: _e,
|
|
129
130
|
variables: {
|
|
130
131
|
limit: 100,
|
|
131
132
|
offset: 0
|
|
@@ -134,60 +135,60 @@ function x() {
|
|
|
134
135
|
}).then((t) => {
|
|
135
136
|
if (!e) return;
|
|
136
137
|
let n = t.data?.platformProducts?.items ?? [];
|
|
137
|
-
|
|
138
|
+
Ce(n), E((e) => e || n[0]?.id || "");
|
|
138
139
|
}).catch((t) => {
|
|
139
140
|
e && z(t instanceof Error ? t.message : "Failed to load products");
|
|
140
141
|
}), () => {
|
|
141
142
|
e = !1;
|
|
142
143
|
};
|
|
143
|
-
}, [
|
|
144
|
-
let Z =
|
|
145
|
-
if (X || !
|
|
146
|
-
let e = ++
|
|
144
|
+
}, [S, X]);
|
|
145
|
+
let Z = c(async () => {
|
|
146
|
+
if (X || !T) return;
|
|
147
|
+
let e = ++N.current;
|
|
147
148
|
L(!0);
|
|
148
149
|
try {
|
|
149
|
-
let t = await
|
|
150
|
-
query:
|
|
150
|
+
let t = await S.query({
|
|
151
|
+
query: ve,
|
|
151
152
|
variables: {
|
|
152
|
-
productId:
|
|
153
|
+
productId: T,
|
|
153
154
|
filter: {
|
|
154
|
-
...
|
|
155
|
-
...
|
|
155
|
+
...A ? { search: A } : {},
|
|
156
|
+
...D ? { tag: D } : {}
|
|
156
157
|
},
|
|
157
|
-
limit:
|
|
158
|
-
offset: (
|
|
158
|
+
limit: h,
|
|
159
|
+
offset: (j - 1) * h
|
|
159
160
|
},
|
|
160
161
|
fetchPolicy: "network-only"
|
|
161
162
|
});
|
|
162
|
-
if (e !==
|
|
163
|
-
|
|
163
|
+
if (e !== N.current) return;
|
|
164
|
+
Ee(t.data?.contentPages?.items ?? []), De(t.data?.contentPages?.total ?? 0), z(null);
|
|
164
165
|
} catch (t) {
|
|
165
|
-
if (e !==
|
|
166
|
+
if (e !== N.current) return;
|
|
166
167
|
z(t instanceof Error ? t.message : "Failed to load content pages");
|
|
167
168
|
} finally {
|
|
168
|
-
e ===
|
|
169
|
+
e === N.current && L(!1);
|
|
169
170
|
}
|
|
170
171
|
}, [
|
|
171
|
-
|
|
172
|
+
S,
|
|
172
173
|
X,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
T,
|
|
175
|
+
A,
|
|
176
|
+
D,
|
|
177
|
+
j
|
|
177
178
|
]);
|
|
178
|
-
|
|
179
|
+
l(() => {
|
|
179
180
|
Z();
|
|
180
181
|
}, [Z]);
|
|
181
|
-
let
|
|
182
|
+
let Ae = Math.ceil(F / h), je = c(() => {
|
|
182
183
|
H(null), W({
|
|
183
|
-
...
|
|
184
|
-
productId:
|
|
185
|
-
type:
|
|
184
|
+
...v,
|
|
185
|
+
productId: T,
|
|
186
|
+
type: D || "blog"
|
|
186
187
|
}), B(!0);
|
|
187
|
-
}, [
|
|
188
|
+
}, [T, D]), Me = c((e) => {
|
|
188
189
|
H(e), W({
|
|
189
190
|
productId: e.productId ?? "",
|
|
190
|
-
type:
|
|
191
|
+
type: Se(e.tags),
|
|
191
192
|
slug: e.slug,
|
|
192
193
|
title: e.title,
|
|
193
194
|
excerpt: e.excerpt ?? "",
|
|
@@ -199,23 +200,23 @@ function x() {
|
|
|
199
200
|
featured: e.featured,
|
|
200
201
|
isPublished: e.isPublished
|
|
201
202
|
}), B(!0);
|
|
202
|
-
}, []),
|
|
203
|
+
}, []), Ne = c(async () => {
|
|
203
204
|
let e = [
|
|
204
205
|
!U.title.trim() && "Title",
|
|
205
206
|
!U.slug.trim() && "Slug",
|
|
206
207
|
!U.content.trim() && "Content"
|
|
207
208
|
].filter(Boolean);
|
|
208
209
|
if (e.length) {
|
|
209
|
-
|
|
210
|
+
C.error(`${e.join(", ")} ${e.length > 1 ? "are" : "is"} required`);
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
212
213
|
let t = U.thumbnail.trim();
|
|
213
214
|
if (t && !/^(https?:\/\/|\/\/|\/)/i.test(t)) {
|
|
214
|
-
|
|
215
|
+
C.error("Thumbnail must be an http(s) URL or an absolute path");
|
|
215
216
|
return;
|
|
216
217
|
}
|
|
217
218
|
G(!0);
|
|
218
|
-
let n =
|
|
219
|
+
let n = g.find((e) => e.value === U.type), r = V ? null : void 0, i = {
|
|
219
220
|
title: U.title.trim(),
|
|
220
221
|
content: U.content,
|
|
221
222
|
contentFormat: "markdown",
|
|
@@ -228,14 +229,14 @@ function x() {
|
|
|
228
229
|
isPublished: U.isPublished
|
|
229
230
|
};
|
|
230
231
|
try {
|
|
231
|
-
V ? (await
|
|
232
|
-
mutation:
|
|
232
|
+
V ? (await S.mutate({
|
|
233
|
+
mutation: be,
|
|
233
234
|
variables: {
|
|
234
235
|
id: V.id,
|
|
235
236
|
input: i
|
|
236
237
|
}
|
|
237
|
-
}),
|
|
238
|
-
mutation:
|
|
238
|
+
}), C.success("Content page updated")) : (await S.mutate({
|
|
239
|
+
mutation: ye,
|
|
239
240
|
variables: { input: {
|
|
240
241
|
...i,
|
|
241
242
|
visibility: "PUBLIC",
|
|
@@ -244,28 +245,28 @@ function x() {
|
|
|
244
245
|
productId: U.productId || void 0,
|
|
245
246
|
slug: U.slug.trim().replace(/-+/g, "-").replace(/^-+|-+$/g, "")
|
|
246
247
|
} }
|
|
247
|
-
}),
|
|
248
|
+
}), C.success("Content page created")), B(!1), await Z();
|
|
248
249
|
} catch (e) {
|
|
249
|
-
|
|
250
|
+
C.error(e instanceof Error ? e.message : "Failed to save content page");
|
|
250
251
|
} finally {
|
|
251
252
|
G(!1);
|
|
252
253
|
}
|
|
253
254
|
}, [
|
|
254
255
|
U,
|
|
255
256
|
V,
|
|
257
|
+
S,
|
|
256
258
|
C,
|
|
257
|
-
w,
|
|
258
259
|
Z
|
|
259
|
-
]),
|
|
260
|
+
]), Pe = c(async () => {
|
|
260
261
|
if (!(!K || J)) {
|
|
261
262
|
Y(!0);
|
|
262
263
|
try {
|
|
263
|
-
await
|
|
264
|
-
mutation:
|
|
264
|
+
await S.mutate({
|
|
265
|
+
mutation: xe,
|
|
265
266
|
variables: { id: K.id }
|
|
266
|
-
}),
|
|
267
|
+
}), C.success("Content page deleted"), q(null), P.length === 1 && j > 1 ? M((e) => e - 1) : await Z();
|
|
267
268
|
} catch (e) {
|
|
268
|
-
|
|
269
|
+
C.error(e instanceof Error ? e.message : "Failed to delete content page");
|
|
269
270
|
} finally {
|
|
270
271
|
Y(!1);
|
|
271
272
|
}
|
|
@@ -273,21 +274,21 @@ function x() {
|
|
|
273
274
|
}, [
|
|
274
275
|
K,
|
|
275
276
|
J,
|
|
277
|
+
S,
|
|
276
278
|
C,
|
|
277
|
-
w,
|
|
278
279
|
Z,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
]),
|
|
280
|
+
P.length,
|
|
281
|
+
j
|
|
282
|
+
]), Fe = [
|
|
282
283
|
{
|
|
283
284
|
key: "title",
|
|
284
285
|
header: "Title",
|
|
285
|
-
render: (e) => /* @__PURE__ */
|
|
286
|
+
render: (e) => /* @__PURE__ */ p("div", {
|
|
286
287
|
className: "min-w-0",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ f("div", {
|
|
288
289
|
className: "font-medium text-foreground",
|
|
289
290
|
children: e.title
|
|
290
|
-
}), /* @__PURE__ */
|
|
291
|
+
}), /* @__PURE__ */ f("div", {
|
|
291
292
|
className: "truncate text-xs text-muted-foreground",
|
|
292
293
|
children: e.slug
|
|
293
294
|
})]
|
|
@@ -298,9 +299,9 @@ function x() {
|
|
|
298
299
|
header: "Type",
|
|
299
300
|
width: "120px",
|
|
300
301
|
render: (e) => {
|
|
301
|
-
let t =
|
|
302
|
-
return /* @__PURE__ */
|
|
303
|
-
variant: t ?
|
|
302
|
+
let t = g.find((t) => e.tags.includes(t.value));
|
|
303
|
+
return /* @__PURE__ */ f(n, {
|
|
304
|
+
variant: t ? _[t.value] : "outline",
|
|
304
305
|
className: "text-xs capitalize",
|
|
305
306
|
children: t?.label ?? "Other"
|
|
306
307
|
});
|
|
@@ -310,13 +311,13 @@ function x() {
|
|
|
310
311
|
key: "status",
|
|
311
312
|
header: "Status",
|
|
312
313
|
width: "110px",
|
|
313
|
-
render: (e) => /* @__PURE__ */
|
|
314
|
+
render: (e) => /* @__PURE__ */ p("div", {
|
|
314
315
|
className: "flex items-center gap-1",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ f(n, {
|
|
316
317
|
variant: e.isPublished ? "default" : "outline",
|
|
317
318
|
className: "text-xs",
|
|
318
319
|
children: e.isPublished ? "Published" : "Draft"
|
|
319
|
-
}), e.featured && /* @__PURE__ */
|
|
320
|
+
}), e.featured && /* @__PURE__ */ f(n, {
|
|
320
321
|
variant: "secondary",
|
|
321
322
|
className: "text-xs",
|
|
322
323
|
children: "Featured"
|
|
@@ -327,192 +328,192 @@ function x() {
|
|
|
327
328
|
key: "updatedAt",
|
|
328
329
|
header: "Updated",
|
|
329
330
|
width: "110px",
|
|
330
|
-
render: (e) =>
|
|
331
|
+
render: (e) => te(e.updatedAt)
|
|
331
332
|
},
|
|
332
333
|
{
|
|
333
334
|
key: "actions",
|
|
334
335
|
header: "",
|
|
335
336
|
width: "60px",
|
|
336
337
|
align: "right",
|
|
337
|
-
render: (e) => /* @__PURE__ */
|
|
338
|
-
onEdit:
|
|
339
|
-
onDelete:
|
|
338
|
+
render: (e) => /* @__PURE__ */ f(se, { actions: ce({
|
|
339
|
+
onEdit: b ? () => Me(e) : void 0,
|
|
340
|
+
onDelete: b ? () => q(e) : void 0
|
|
340
341
|
}) })
|
|
341
342
|
}
|
|
342
|
-
], Q = "content-page-form", $ = !!V && !
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
allowed:
|
|
345
|
-
isLoading:
|
|
343
|
+
], Q = "content-page-form", $ = !!V && !g.some((e) => V.tags.includes(e.value));
|
|
344
|
+
return /* @__PURE__ */ p(le, {
|
|
345
|
+
allowed: m,
|
|
346
|
+
isLoading: x,
|
|
346
347
|
pageTitle: "Content",
|
|
347
348
|
denyMessage: "You don't have permission to manage content pages.",
|
|
348
349
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ f(ee, {
|
|
350
351
|
title: "Content",
|
|
351
352
|
gradientWord: "Content",
|
|
352
|
-
description: `Blog posts, case studies, and changelog entries${
|
|
353
|
-
actions: /* @__PURE__ */
|
|
354
|
-
onClick:
|
|
355
|
-
disabled: !
|
|
356
|
-
children: [/* @__PURE__ */
|
|
353
|
+
description: `Blog posts, case studies, and changelog entries${F ? ` · ${F} total` : ""}`,
|
|
354
|
+
actions: /* @__PURE__ */ p(r, {
|
|
355
|
+
onClick: je,
|
|
356
|
+
disabled: !b || !T,
|
|
357
|
+
children: [/* @__PURE__ */ f(fe, { className: "mr-2 h-4 w-4" }), "New Content"]
|
|
357
358
|
}),
|
|
358
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ p("div", {
|
|
359
360
|
className: "space-y-4",
|
|
360
361
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ f(he, { children: "Manage the marketing and product content that powers each product's public site — blog posts, case studies and changelog entries. Pick a product, then draft, edit and publish the stories that show up on its website." }),
|
|
363
|
+
/* @__PURE__ */ p(me, {
|
|
363
364
|
className: "flex items-center gap-4 p-5",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ f("div", {
|
|
365
366
|
className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg/15 text-action-primary-bg",
|
|
366
|
-
children: /* @__PURE__ */
|
|
367
|
-
}), /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ f(d, { className: "h-6 w-6" })
|
|
368
|
+
}), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("div", {
|
|
368
369
|
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
369
|
-
children:
|
|
370
|
-
}), /* @__PURE__ */
|
|
370
|
+
children: F
|
|
371
|
+
}), /* @__PURE__ */ f("p", {
|
|
371
372
|
className: "text-sm text-text-secondary",
|
|
372
373
|
children: "content entries for this product"
|
|
373
374
|
})] })]
|
|
374
375
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ p("div", {
|
|
376
377
|
className: "flex flex-wrap items-center gap-3",
|
|
377
378
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ p("select", {
|
|
379
380
|
"aria-label": "Filter by product",
|
|
380
|
-
className: `${
|
|
381
|
-
value:
|
|
381
|
+
className: `${y} max-w-xs`,
|
|
382
|
+
value: T,
|
|
382
383
|
onChange: (e) => {
|
|
383
|
-
|
|
384
|
+
M(1), E(e.target.value);
|
|
384
385
|
},
|
|
385
|
-
children: [
|
|
386
|
+
children: [w.length === 0 && /* @__PURE__ */ f("option", {
|
|
386
387
|
value: "",
|
|
387
388
|
children: "Loading products…"
|
|
388
|
-
}),
|
|
389
|
+
}), w.map((e) => /* @__PURE__ */ f("option", {
|
|
389
390
|
value: e.id,
|
|
390
391
|
children: e.name
|
|
391
392
|
}, e.id))]
|
|
392
393
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ p("select", {
|
|
394
395
|
"aria-label": "Filter by content type",
|
|
395
|
-
className: `${
|
|
396
|
-
value:
|
|
396
|
+
className: `${y} max-w-[180px]`,
|
|
397
|
+
value: D,
|
|
397
398
|
onChange: (e) => {
|
|
398
|
-
|
|
399
|
+
M(1), we(e.target.value);
|
|
399
400
|
},
|
|
400
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ f("option", {
|
|
401
402
|
value: "",
|
|
402
403
|
children: "All types"
|
|
403
|
-
}),
|
|
404
|
+
}), g.map((e) => /* @__PURE__ */ f("option", {
|
|
404
405
|
value: e.value,
|
|
405
406
|
children: e.label
|
|
406
407
|
}, e.value))]
|
|
407
408
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ p("div", {
|
|
409
410
|
className: "relative max-w-sm flex-1",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ f(pe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ f(a, {
|
|
411
412
|
placeholder: "Search content...",
|
|
412
|
-
value:
|
|
413
|
-
onChange: (e) =>
|
|
413
|
+
value: O,
|
|
414
|
+
onChange: (e) => k(e.target.value),
|
|
414
415
|
className: "pl-9"
|
|
415
416
|
})]
|
|
416
417
|
})
|
|
417
418
|
]
|
|
418
419
|
}),
|
|
419
|
-
R && /* @__PURE__ */
|
|
420
|
+
R && /* @__PURE__ */ f("div", {
|
|
420
421
|
className: "rounded-md border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",
|
|
421
422
|
children: R
|
|
422
423
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
columns:
|
|
425
|
-
data:
|
|
424
|
+
/* @__PURE__ */ f(ne, {
|
|
425
|
+
columns: Fe,
|
|
426
|
+
data: P,
|
|
426
427
|
keyExtractor: (e) => e.id,
|
|
427
|
-
loading:
|
|
428
|
-
emptyState: /* @__PURE__ */
|
|
428
|
+
loading: I,
|
|
429
|
+
emptyState: /* @__PURE__ */ f(i, {
|
|
429
430
|
illustration: "empty-files",
|
|
430
|
-
icon: /* @__PURE__ */
|
|
431
|
+
icon: /* @__PURE__ */ f(d, { className: "h-8 w-8" }),
|
|
431
432
|
title: "No content yet",
|
|
432
433
|
description: "Create a blog post, case study, or changelog entry to get started."
|
|
433
434
|
})
|
|
434
435
|
}),
|
|
435
|
-
|
|
436
|
-
page:
|
|
437
|
-
totalPages:
|
|
438
|
-
totalItems:
|
|
439
|
-
pageSize:
|
|
440
|
-
onPageChange:
|
|
436
|
+
F > h && /* @__PURE__ */ f(re, {
|
|
437
|
+
page: j,
|
|
438
|
+
totalPages: Ae,
|
|
439
|
+
totalItems: F,
|
|
440
|
+
pageSize: h,
|
|
441
|
+
onPageChange: M
|
|
441
442
|
})
|
|
442
443
|
]
|
|
443
444
|
})
|
|
444
445
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
open:
|
|
446
|
+
/* @__PURE__ */ f(ie, {
|
|
447
|
+
open: Oe,
|
|
447
448
|
onClose: () => B(!1),
|
|
448
449
|
title: V ? "Edit content" : "New content",
|
|
449
|
-
footer: /* @__PURE__ */
|
|
450
|
+
footer: /* @__PURE__ */ f(ae, {
|
|
450
451
|
formId: Q,
|
|
451
|
-
isSubmitting:
|
|
452
|
+
isSubmitting: ke,
|
|
452
453
|
submitLabel: V ? "Save changes" : "Create",
|
|
453
454
|
onCancel: () => B(!1)
|
|
454
455
|
}),
|
|
455
|
-
children: /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ p("form", {
|
|
456
457
|
id: Q,
|
|
457
458
|
onSubmit: (e) => {
|
|
458
|
-
e.preventDefault(),
|
|
459
|
+
e.preventDefault(), Ne();
|
|
459
460
|
},
|
|
460
461
|
className: "space-y-6",
|
|
461
462
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ p(s, {
|
|
463
464
|
title: "Basics",
|
|
464
465
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ p(o, {
|
|
466
467
|
cols: 2,
|
|
467
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ p("label", {
|
|
468
469
|
className: "space-y-1.5",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ f("span", {
|
|
470
471
|
className: "text-sm font-medium",
|
|
471
472
|
children: "Type"
|
|
472
|
-
}), /* @__PURE__ */
|
|
473
|
-
className:
|
|
473
|
+
}), /* @__PURE__ */ p("select", {
|
|
474
|
+
className: y,
|
|
474
475
|
value: $ ? "__other" : U.type,
|
|
475
476
|
disabled: !!V,
|
|
476
477
|
onChange: (e) => W((t) => ({
|
|
477
478
|
...t,
|
|
478
479
|
type: e.target.value
|
|
479
480
|
})),
|
|
480
|
-
children: [$ && /* @__PURE__ */
|
|
481
|
+
children: [$ && /* @__PURE__ */ f("option", {
|
|
481
482
|
value: "__other",
|
|
482
483
|
children: "Other"
|
|
483
|
-
}),
|
|
484
|
+
}), g.map((e) => /* @__PURE__ */ f("option", {
|
|
484
485
|
value: e.value,
|
|
485
486
|
children: e.label
|
|
486
487
|
}, e.value))]
|
|
487
488
|
})]
|
|
488
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ p("label", {
|
|
489
490
|
className: "space-y-1.5",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
491
|
+
children: [/* @__PURE__ */ f("span", {
|
|
491
492
|
className: "text-sm font-medium",
|
|
492
493
|
children: "Product"
|
|
493
|
-
}), /* @__PURE__ */
|
|
494
|
-
className:
|
|
494
|
+
}), /* @__PURE__ */ f("select", {
|
|
495
|
+
className: y,
|
|
495
496
|
value: U.productId,
|
|
496
497
|
disabled: !!V,
|
|
497
498
|
onChange: (e) => W((t) => ({
|
|
498
499
|
...t,
|
|
499
500
|
productId: e.target.value
|
|
500
501
|
})),
|
|
501
|
-
children:
|
|
502
|
+
children: w.map((e) => /* @__PURE__ */ f("option", {
|
|
502
503
|
value: e.id,
|
|
503
504
|
children: e.name
|
|
504
505
|
}, e.id))
|
|
505
506
|
})]
|
|
506
507
|
})]
|
|
507
508
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ p(o, {
|
|
509
510
|
cols: 2,
|
|
510
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ p("label", {
|
|
511
512
|
className: "space-y-1.5",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ f("span", {
|
|
513
514
|
className: "text-sm font-medium",
|
|
514
515
|
children: "Title"
|
|
515
|
-
}), /* @__PURE__ */
|
|
516
|
+
}), /* @__PURE__ */ f(a, {
|
|
516
517
|
value: U.title,
|
|
517
518
|
onChange: (e) => W((t) => ({
|
|
518
519
|
...t,
|
|
@@ -520,12 +521,12 @@ function x() {
|
|
|
520
521
|
})),
|
|
521
522
|
placeholder: "A clear, descriptive title"
|
|
522
523
|
})]
|
|
523
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ p("label", {
|
|
524
525
|
className: "space-y-1.5",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ f("span", {
|
|
526
527
|
className: "text-sm font-medium",
|
|
527
528
|
children: "Slug"
|
|
528
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ f(a, {
|
|
529
530
|
value: U.slug,
|
|
530
531
|
disabled: !!V,
|
|
531
532
|
onChange: (e) => W((t) => ({
|
|
@@ -536,13 +537,13 @@ function x() {
|
|
|
536
537
|
})]
|
|
537
538
|
})]
|
|
538
539
|
}),
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ p("label", {
|
|
540
541
|
className: "block space-y-1.5",
|
|
541
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ f("span", {
|
|
542
543
|
className: "text-sm font-medium",
|
|
543
544
|
children: "Excerpt"
|
|
544
|
-
}), /* @__PURE__ */
|
|
545
|
-
className: `${
|
|
545
|
+
}), /* @__PURE__ */ f("textarea", {
|
|
546
|
+
className: `${y} h-16 py-2`,
|
|
546
547
|
value: U.excerpt,
|
|
547
548
|
onChange: (e) => W((t) => ({
|
|
548
549
|
...t,
|
|
@@ -553,32 +554,31 @@ function x() {
|
|
|
553
554
|
})
|
|
554
555
|
]
|
|
555
556
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ f(s, {
|
|
557
558
|
title: "Content",
|
|
558
|
-
description: "Markdown supported (headings, lists, links, bold).",
|
|
559
|
-
children: /* @__PURE__ */
|
|
559
|
+
description: "Markdown supported (headings, lists, links, bold). Use the toolbar to insert common syntax.",
|
|
560
|
+
children: /* @__PURE__ */ f(ue, {
|
|
560
561
|
"aria-label": "Content",
|
|
561
|
-
className: `${b} h-64 py-2 font-mono text-xs`,
|
|
562
562
|
value: U.content,
|
|
563
563
|
onChange: (e) => W((t) => ({
|
|
564
564
|
...t,
|
|
565
|
-
content: e
|
|
565
|
+
content: e
|
|
566
566
|
})),
|
|
567
567
|
placeholder: "## Heading\n\nWrite your content in markdown..."
|
|
568
568
|
})
|
|
569
569
|
}),
|
|
570
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ p(s, {
|
|
571
571
|
title: "Meta",
|
|
572
572
|
children: [
|
|
573
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ p(o, {
|
|
574
574
|
cols: 3,
|
|
575
575
|
children: [
|
|
576
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ p("label", {
|
|
577
577
|
className: "space-y-1.5",
|
|
578
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ f("span", {
|
|
579
579
|
className: "text-sm font-medium",
|
|
580
580
|
children: "Author"
|
|
581
|
-
}), /* @__PURE__ */
|
|
581
|
+
}), /* @__PURE__ */ f(a, {
|
|
582
582
|
value: U.author,
|
|
583
583
|
onChange: (e) => W((t) => ({
|
|
584
584
|
...t,
|
|
@@ -587,12 +587,12 @@ function x() {
|
|
|
587
587
|
placeholder: "The Team"
|
|
588
588
|
})]
|
|
589
589
|
}),
|
|
590
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ p("label", {
|
|
591
591
|
className: "space-y-1.5",
|
|
592
|
-
children: [/* @__PURE__ */
|
|
592
|
+
children: [/* @__PURE__ */ f("span", {
|
|
593
593
|
className: "text-sm font-medium",
|
|
594
594
|
children: "Published date"
|
|
595
|
-
}), /* @__PURE__ */
|
|
595
|
+
}), /* @__PURE__ */ f(a, {
|
|
596
596
|
type: "date",
|
|
597
597
|
value: U.publishedAt,
|
|
598
598
|
onChange: (e) => W((t) => ({
|
|
@@ -601,12 +601,12 @@ function x() {
|
|
|
601
601
|
}))
|
|
602
602
|
})]
|
|
603
603
|
}),
|
|
604
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ p("label", {
|
|
605
605
|
className: "space-y-1.5",
|
|
606
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ f("span", {
|
|
607
607
|
className: "text-sm font-medium",
|
|
608
608
|
children: "Reading time (min)"
|
|
609
|
-
}), /* @__PURE__ */
|
|
609
|
+
}), /* @__PURE__ */ f(a, {
|
|
610
610
|
type: "number",
|
|
611
611
|
min: 0,
|
|
612
612
|
value: U.readingTime,
|
|
@@ -618,12 +618,12 @@ function x() {
|
|
|
618
618
|
})
|
|
619
619
|
]
|
|
620
620
|
}),
|
|
621
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ p("label", {
|
|
622
622
|
className: "block space-y-1.5",
|
|
623
|
-
children: [/* @__PURE__ */
|
|
623
|
+
children: [/* @__PURE__ */ f("span", {
|
|
624
624
|
className: "text-sm font-medium",
|
|
625
625
|
children: "Thumbnail URL"
|
|
626
|
-
}), /* @__PURE__ */
|
|
626
|
+
}), /* @__PURE__ */ f(a, {
|
|
627
627
|
value: U.thumbnail,
|
|
628
628
|
onChange: (e) => W((t) => ({
|
|
629
629
|
...t,
|
|
@@ -632,11 +632,11 @@ function x() {
|
|
|
632
632
|
placeholder: "https://…/image.png"
|
|
633
633
|
})]
|
|
634
634
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ p("div", {
|
|
636
636
|
className: "flex items-center gap-6 pt-1",
|
|
637
|
-
children: [/* @__PURE__ */
|
|
637
|
+
children: [/* @__PURE__ */ p("label", {
|
|
638
638
|
className: "flex items-center gap-2 text-sm",
|
|
639
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ f("input", {
|
|
640
640
|
type: "checkbox",
|
|
641
641
|
checked: U.featured,
|
|
642
642
|
onChange: (e) => W((t) => ({
|
|
@@ -644,9 +644,9 @@ function x() {
|
|
|
644
644
|
featured: e.target.checked
|
|
645
645
|
}))
|
|
646
646
|
}), "Featured"]
|
|
647
|
-
}), /* @__PURE__ */
|
|
647
|
+
}), /* @__PURE__ */ p("label", {
|
|
648
648
|
className: "flex items-center gap-2 text-sm",
|
|
649
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ f("input", {
|
|
650
650
|
type: "checkbox",
|
|
651
651
|
checked: U.isPublished,
|
|
652
652
|
onChange: (e) => W((t) => ({
|
|
@@ -661,10 +661,10 @@ function x() {
|
|
|
661
661
|
]
|
|
662
662
|
})
|
|
663
663
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ f(oe, {
|
|
665
665
|
open: !!K,
|
|
666
666
|
onClose: () => q(null),
|
|
667
|
-
onConfirm:
|
|
667
|
+
onConfirm: Pe,
|
|
668
668
|
itemName: K?.title ?? "this content page",
|
|
669
669
|
itemType: "content page",
|
|
670
670
|
loading: J
|
|
@@ -673,6 +673,6 @@ function x() {
|
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
//#endregion
|
|
676
|
-
export {
|
|
676
|
+
export { b as ContentPagesPage };
|
|
677
677
|
|
|
678
678
|
//# sourceMappingURL=ContentPagesPage.js.map
|