@burdenoff/microfe-product 2026.518.2 → 2026.519.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/generated/global-operations.d.ts +304 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +200 -83
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +123 -0
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +114 -114
- package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -1
- package/dist/product-management/ProductManagementRoot.d.ts.map +1 -1
- package/dist/product-management/ProductManagementRoot.js +34 -26
- package/dist/product-management/ProductManagementRoot.js.map +1 -1
- package/dist/product-management/ProductManagementRoutes.d.ts.map +1 -1
- package/dist/product-management/ProductManagementRoutes.js +52 -20
- package/dist/product-management/ProductManagementRoutes.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +5 -0
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +4 -0
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.d.ts +10 -0
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +467 -0
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -0
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.d.ts +58 -0
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.js +69 -0
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.js.map +1 -0
- package/dist/product-management/modules/press-kit/index.d.ts +14 -0
- package/dist/product-management/modules/press-kit/index.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.d.ts +2 -0
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +69 -0
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.d.ts +2 -0
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +193 -0
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.d.ts +2 -0
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +87 -0
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.d.ts +2 -0
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +311 -0
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -0
- package/dist/product-management/modules/press-kit/schemas/index.d.ts +58 -0
- package/dist/product-management/modules/press-kit/schemas/index.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/schemas/index.js +51 -0
- package/dist/product-management/modules/press-kit/schemas/index.js.map +1 -0
- package/dist/product-management/modules/press-kit/types/index.d.ts +73 -0
- package/dist/product-management/modules/press-kit/types/index.d.ts.map +1 -0
- package/dist/product-management/modules/press-kit/types/index.js +14 -0
- package/dist/product-management/modules/press-kit/types/index.js.map +1 -0
- package/dist/product-management/modules/products/components/ProductPlans.d.ts.map +1 -1
- package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
+
import { useProductConsole as t } from "../../../providers/ProductConsoleProvider.js";
|
|
3
|
+
import { LoadingState as n } from "../../../shared/components/feedback/LoadingState.js";
|
|
4
|
+
import { ErrorState as r } from "../../../shared/components/feedback/ErrorState.js";
|
|
5
|
+
import { SearchInput as i } from "../../../shared/components/input/SearchInput.js";
|
|
6
|
+
import { exportToCsv as a } from "../../../shared/utils/exportUtils.js";
|
|
7
|
+
import { nativeConfirm as o, nativeImpact as s, nativeNotify as c } from "../../../../utils/nativeBridge.js";
|
|
8
|
+
import { useDeletePressKitAsset as l, usePressKitAssets as u } from "../hooks/usePressKitAssets.js";
|
|
9
|
+
import { useState as d } from "react";
|
|
10
|
+
import { Download as f, Eye as p, FileText as m, Plus as h, RefreshCw as g, SquarePen as _, Trash2 as v } from "lucide-react";
|
|
11
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
12
|
+
import { PermissionGate as x } from "@burdenoff/fe-libs/shared/components";
|
|
13
|
+
//#region src/product-management/modules/press-kit/pages/PressKitListPage.tsx
|
|
14
|
+
var S = [
|
|
15
|
+
{
|
|
16
|
+
label: "All",
|
|
17
|
+
category: ""
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: "Logos",
|
|
21
|
+
category: "LOGO"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Banners",
|
|
25
|
+
category: "BANNER"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "Screenshots",
|
|
29
|
+
category: "SCREENSHOT"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "Brochures",
|
|
33
|
+
category: "BROCHURE"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: "Documents",
|
|
37
|
+
category: "DOCUMENT"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: "Press Releases",
|
|
41
|
+
category: "PRESS_RELEASE"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: "Brand Guides",
|
|
45
|
+
category: "BRAND_GUIDE"
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
function C(e) {
|
|
49
|
+
return e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB` : "—";
|
|
50
|
+
}
|
|
51
|
+
function w() {
|
|
52
|
+
let { navigate: w, basePath: T = "/products" } = t(), E = `${T}/press-kit`, [D, O] = d(""), k = e(), [A, j] = d({}), { assets: M, loading: N, error: P, refetch: F } = u(void 0, {
|
|
53
|
+
...A,
|
|
54
|
+
search: D || void 0
|
|
55
|
+
}, { limit: 50 }), { deletePressKitAsset: I, loading: L } = l(), R = async (e) => {
|
|
56
|
+
s("medium");
|
|
57
|
+
let t = k("pressKit.confirmDelete", "Delete this press kit asset?"), n = await o({
|
|
58
|
+
title: "Delete press kit asset",
|
|
59
|
+
message: t,
|
|
60
|
+
okButtonTitle: "Delete",
|
|
61
|
+
cancelButtonTitle: "Cancel"
|
|
62
|
+
});
|
|
63
|
+
if (n === null ? window.confirm(t) : n) try {
|
|
64
|
+
if (!(await I(e)).data?.deletePressKitAsset) {
|
|
65
|
+
c("error"), console.error("Press kit asset delete returned false:", e);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
c("success"), F();
|
|
69
|
+
} catch (e) {
|
|
70
|
+
c("error"), console.error("Failed to delete press kit asset:", e);
|
|
71
|
+
}
|
|
72
|
+
}, z = (e) => e ? new Date(e).toLocaleDateString("en-US", {
|
|
73
|
+
year: "numeric",
|
|
74
|
+
month: "short",
|
|
75
|
+
day: "numeric"
|
|
76
|
+
}) : "—";
|
|
77
|
+
return N ? /* @__PURE__ */ y("div", {
|
|
78
|
+
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
79
|
+
children: /* @__PURE__ */ y(n, { message: k("pressKit.loadingAssets", "Loading press kit assets...") })
|
|
80
|
+
}) : P ? /* @__PURE__ */ y("div", {
|
|
81
|
+
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
82
|
+
children: /* @__PURE__ */ y(r, {
|
|
83
|
+
message: P.message,
|
|
84
|
+
action: {
|
|
85
|
+
label: k("productCommon.retry", "Retry"),
|
|
86
|
+
onClick: () => F()
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
}) : /* @__PURE__ */ b("div", {
|
|
90
|
+
className: "min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300",
|
|
91
|
+
children: [/* @__PURE__ */ b("div", {
|
|
92
|
+
className: "mb-6",
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ b("div", {
|
|
95
|
+
className: "flex items-center justify-between mb-4",
|
|
96
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
|
|
97
|
+
className: "text-3xl font-bold text-text-primary mb-2",
|
|
98
|
+
children: k("pressKit.title", "Press Kit")
|
|
99
|
+
}), /* @__PURE__ */ y("p", {
|
|
100
|
+
className: "text-text-secondary",
|
|
101
|
+
children: k("pressKit.subtitle", "Manage downloadable press & media assets")
|
|
102
|
+
})] }), /* @__PURE__ */ y(x, {
|
|
103
|
+
role: "super_admin",
|
|
104
|
+
children: /* @__PURE__ */ b("button", {
|
|
105
|
+
onClick: () => w(`${E}/new`),
|
|
106
|
+
className: "inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium",
|
|
107
|
+
children: [/* @__PURE__ */ y(h, { size: 20 }), k("pressKit.newAsset", "New Asset")]
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ y("div", {
|
|
112
|
+
className: "flex flex-wrap gap-1 border-b border-default pb-px",
|
|
113
|
+
children: S.map((e) => /* @__PURE__ */ y("button", {
|
|
114
|
+
type: "button",
|
|
115
|
+
onClick: () => j({
|
|
116
|
+
...A,
|
|
117
|
+
category: e.category || void 0
|
|
118
|
+
}),
|
|
119
|
+
className: `px-4 py-2 rounded-t-lg text-sm font-medium transition-all border-b-2 ${(A.category ?? "") === e.category ? "border-[var(--color-action-primary-bg)] text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"}`,
|
|
120
|
+
children: e.label
|
|
121
|
+
}, e.label))
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ b("div", {
|
|
124
|
+
className: "flex gap-4",
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ y(i, {
|
|
127
|
+
value: D,
|
|
128
|
+
onChange: O,
|
|
129
|
+
placeholder: k("pressKit.searchPlaceholder", "Search press kit assets..."),
|
|
130
|
+
className: "flex-1"
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ y("button", {
|
|
133
|
+
onClick: () => F(),
|
|
134
|
+
className: "inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200",
|
|
135
|
+
children: /* @__PURE__ */ y(g, { size: 18 })
|
|
136
|
+
}),
|
|
137
|
+
M.length > 0 && /* @__PURE__ */ y("button", {
|
|
138
|
+
onClick: () => a("press-kit-assets", M.map((e) => ({
|
|
139
|
+
id: e.id,
|
|
140
|
+
slug: e.slug,
|
|
141
|
+
title: e.title,
|
|
142
|
+
category: e.category,
|
|
143
|
+
fileUrl: e.fileUrl,
|
|
144
|
+
mimeType: e.mimeType ?? "",
|
|
145
|
+
visibility: e.visibility,
|
|
146
|
+
sortOrder: e.sortOrder,
|
|
147
|
+
productId: e.productId,
|
|
148
|
+
updatedAt: e.updatedAt
|
|
149
|
+
}))),
|
|
150
|
+
className: "inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200",
|
|
151
|
+
title: k("pressKit.exportCsv", "Export as CSV"),
|
|
152
|
+
children: /* @__PURE__ */ y(f, { size: 18 })
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}), M.length === 0 ? /* @__PURE__ */ b("div", {
|
|
158
|
+
className: "bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-300",
|
|
159
|
+
children: [/* @__PURE__ */ y("p", {
|
|
160
|
+
className: "text-text-secondary mb-4",
|
|
161
|
+
children: k("pressKit.noAssetsFound", "No press kit assets found")
|
|
162
|
+
}), /* @__PURE__ */ y(x, {
|
|
163
|
+
role: "super_admin",
|
|
164
|
+
children: /* @__PURE__ */ b("button", {
|
|
165
|
+
onClick: () => w(`${E}/new`),
|
|
166
|
+
className: "inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium",
|
|
167
|
+
children: [/* @__PURE__ */ y(h, { size: 20 }), k("pressKit.newAsset", "New Asset")]
|
|
168
|
+
})
|
|
169
|
+
})]
|
|
170
|
+
}) : /* @__PURE__ */ y("div", {
|
|
171
|
+
className: "bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)] overflow-hidden",
|
|
172
|
+
children: /* @__PURE__ */ b("table", {
|
|
173
|
+
className: "w-full",
|
|
174
|
+
children: [/* @__PURE__ */ y("thead", {
|
|
175
|
+
className: "bg-muted border-b border-default",
|
|
176
|
+
children: /* @__PURE__ */ b("tr", { children: [
|
|
177
|
+
/* @__PURE__ */ y("th", {
|
|
178
|
+
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
179
|
+
children: k("pressKit.columnAsset", "Asset")
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ y("th", {
|
|
182
|
+
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
183
|
+
children: k("pressKit.columnCategory", "Category")
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ y("th", {
|
|
186
|
+
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
187
|
+
children: k("pressKit.columnFile", "File")
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ y("th", {
|
|
190
|
+
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
191
|
+
children: k("pressKit.columnVisibility", "Visibility")
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ y("th", {
|
|
194
|
+
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
195
|
+
children: k("pressKit.columnUpdated", "Updated")
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ y("th", {
|
|
198
|
+
className: "text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
199
|
+
children: k("pressKit.columnActions", "Actions")
|
|
200
|
+
})
|
|
201
|
+
] })
|
|
202
|
+
}), /* @__PURE__ */ y("tbody", {
|
|
203
|
+
className: "divide-y divide-[var(--color-border-default)]",
|
|
204
|
+
children: M.map((e) => /* @__PURE__ */ b("tr", {
|
|
205
|
+
className: "hover:bg-muted transition-all duration-200 cursor-pointer",
|
|
206
|
+
onClick: () => w(`${E}/${e.id}`),
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ y("td", {
|
|
209
|
+
className: "px-6 py-4",
|
|
210
|
+
children: /* @__PURE__ */ b("div", {
|
|
211
|
+
className: "flex items-center gap-3",
|
|
212
|
+
children: [/* @__PURE__ */ y("div", {
|
|
213
|
+
className: "w-10 h-10 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center overflow-hidden",
|
|
214
|
+
children: e.thumbnailUrl ? /* @__PURE__ */ y("img", {
|
|
215
|
+
src: e.thumbnailUrl,
|
|
216
|
+
alt: "",
|
|
217
|
+
className: "w-full h-full object-cover"
|
|
218
|
+
}) : /* @__PURE__ */ y(m, {
|
|
219
|
+
size: 20,
|
|
220
|
+
className: "text-[var(--color-status-info)]"
|
|
221
|
+
})
|
|
222
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
223
|
+
className: "font-medium text-text-primary",
|
|
224
|
+
children: e.title
|
|
225
|
+
}), /* @__PURE__ */ b("p", {
|
|
226
|
+
className: "text-xs text-text-tertiary font-mono",
|
|
227
|
+
children: ["/", e.slug]
|
|
228
|
+
})] })]
|
|
229
|
+
})
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ y("td", {
|
|
232
|
+
className: "px-6 py-4",
|
|
233
|
+
children: /* @__PURE__ */ y("span", {
|
|
234
|
+
className: "text-xs font-medium px-2 py-1 rounded-full bg-[var(--color-status-info-subtle)] text-[var(--color-status-info)]",
|
|
235
|
+
children: e.category.replace(/_/g, " ")
|
|
236
|
+
})
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ y("td", {
|
|
239
|
+
className: "px-6 py-4",
|
|
240
|
+
children: /* @__PURE__ */ b("span", {
|
|
241
|
+
className: "text-sm text-text-secondary",
|
|
242
|
+
children: [
|
|
243
|
+
(e.mimeType ?? "file").split("/").pop(),
|
|
244
|
+
" · ",
|
|
245
|
+
C(e.fileSize)
|
|
246
|
+
]
|
|
247
|
+
})
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ y("td", {
|
|
250
|
+
className: "px-6 py-4",
|
|
251
|
+
children: /* @__PURE__ */ y("span", {
|
|
252
|
+
className: "text-sm text-text-secondary",
|
|
253
|
+
children: e.visibility
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ y("td", {
|
|
257
|
+
className: "px-6 py-4",
|
|
258
|
+
children: /* @__PURE__ */ y("span", {
|
|
259
|
+
className: "text-sm text-text-secondary",
|
|
260
|
+
children: z(e.updatedAt)
|
|
261
|
+
})
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ y("td", {
|
|
264
|
+
className: "px-6 py-4",
|
|
265
|
+
children: /* @__PURE__ */ b("div", {
|
|
266
|
+
className: "flex items-center justify-end gap-2",
|
|
267
|
+
onClick: (e) => e.stopPropagation(),
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ y("a", {
|
|
270
|
+
href: e.fileUrl,
|
|
271
|
+
target: "_blank",
|
|
272
|
+
rel: "noopener noreferrer",
|
|
273
|
+
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
274
|
+
title: k("pressKit.download", "Download"),
|
|
275
|
+
children: /* @__PURE__ */ y(f, { size: 18 })
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ y("button", {
|
|
278
|
+
onClick: () => w(`${E}/${e.id}`),
|
|
279
|
+
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
280
|
+
title: k("pressKit.viewDetails", "View details"),
|
|
281
|
+
children: /* @__PURE__ */ y(p, { size: 18 })
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ b(x, {
|
|
284
|
+
role: "super_admin",
|
|
285
|
+
children: [/* @__PURE__ */ y("button", {
|
|
286
|
+
onClick: () => w(`${E}/${e.id}/edit`),
|
|
287
|
+
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
288
|
+
title: k("pressKit.edit", "Edit"),
|
|
289
|
+
children: /* @__PURE__ */ y(_, { size: 18 })
|
|
290
|
+
}), /* @__PURE__ */ y("button", {
|
|
291
|
+
onClick: () => R(e.id),
|
|
292
|
+
disabled: L,
|
|
293
|
+
className: "p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50",
|
|
294
|
+
title: k("pressKit.delete", "Delete"),
|
|
295
|
+
children: /* @__PURE__ */ y(v, { size: 18 })
|
|
296
|
+
})]
|
|
297
|
+
})
|
|
298
|
+
]
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
}, e.id))
|
|
303
|
+
})]
|
|
304
|
+
})
|
|
305
|
+
})]
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
//#endregion
|
|
309
|
+
export { w as PressKitListPage };
|
|
310
|
+
|
|
311
|
+
//# sourceMappingURL=PressKitListPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PressKitListPage.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/pages/PressKitListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Download, FileText, Plus, Eye, SquarePen, Trash2, RefreshCw } from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { usePressKitAssets, useDeletePressKitAsset } from '../hooks/usePressKitAssets';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { exportToCsv } from '../../../shared/utils/exportUtils';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { PressKitAssetFilterInput, PressKitAssetCategory } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/** Category tabs — each filters the list server-side by category ('' = All). */\nconst CATEGORY_TABS: { label: string; category: string }[] = [\n { label: 'All', category: '' },\n { label: 'Logos', category: 'LOGO' },\n { label: 'Banners', category: 'BANNER' },\n { label: 'Screenshots', category: 'SCREENSHOT' },\n { label: 'Brochures', category: 'BROCHURE' },\n { label: 'Documents', category: 'DOCUMENT' },\n { label: 'Press Releases', category: 'PRESS_RELEASE' },\n { label: 'Brand Guides', category: 'BRAND_GUIDE' },\n];\n\nfunction formatBytes(bytes: number | null): string {\n if (!bytes) return '—';\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n}\n\nexport function PressKitListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const pressKitBasePath = `${basePath}/press-kit`;\n const [searchQuery, setSearchQuery] = useState('');\n const tr = useTr();\n const [filter, setFilter] = useState<PressKitAssetFilterInput>({});\n\n const { assets, loading, error, refetch } = usePressKitAssets(\n undefined,\n { ...filter, search: searchQuery || undefined },\n { limit: 50 }\n );\n\n const { deletePressKitAsset, loading: deleteLoading } = useDeletePressKitAsset();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('pressKit.confirmDelete', 'Delete this press kit asset?');\n const native = await nativeConfirm({\n title: 'Delete press kit asset',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n // `deletePressKitAsset` returns `Boolean!`. A throw covers hard failures\n // (network, auth, validation); the explicit `false` branch covers\n // soft-failure cases where the resolver resolved but the asset wasn't\n // actually removed — so we don't show a misleading success toast.\n const result = await deletePressKitAsset(id);\n if (!result.data?.deletePressKitAsset) {\n void nativeNotify('error');\n console.error('Press kit asset delete returned false:', id);\n return;\n }\n void nativeNotify('success');\n refetch();\n } catch (err) {\n void nativeNotify('error');\n console.error('Failed to delete press kit asset:', err);\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: 'short',\n day: 'numeric',\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('pressKit.loadingAssets', 'Loading press kit assets...')} />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\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-300\">\n <div className=\"mb-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <div>\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('pressKit.title', 'Press Kit')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('pressKit.subtitle', 'Manage downloadable press & media assets')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/new`)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium\"\n >\n <Plus size={20} />\n {tr('pressKit.newAsset', 'New Asset')}\n </button>\n </PermissionGate>\n </div>\n\n {/* Category tabs */}\n <div className=\"flex flex-wrap gap-1 border-b border-default pb-px\">\n {CATEGORY_TABS.map((t) => {\n const active = (filter.category ?? '') === t.category;\n return (\n <button\n key={t.label}\n type=\"button\"\n onClick={() =>\n setFilter({\n ...filter,\n category: (t.category || undefined) as PressKitAssetCategory | undefined,\n })\n }\n className={`px-4 py-2 rounded-t-lg text-sm font-medium transition-all border-b-2 ${\n active\n ? 'border-[var(--color-action-primary-bg)] text-text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n }`}\n >\n {t.label}\n </button>\n );\n })}\n </div>\n\n <div className=\"flex gap-4\">\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('pressKit.searchPlaceholder', 'Search press kit assets...')}\n className=\"flex-1\"\n />\n\n <button\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200\"\n >\n <RefreshCw size={18} />\n </button>\n\n {assets.length > 0 && (\n <button\n onClick={() =>\n exportToCsv(\n 'press-kit-assets',\n assets.map((a) => ({\n id: a.id,\n slug: a.slug,\n title: a.title,\n category: a.category,\n fileUrl: a.fileUrl,\n mimeType: a.mimeType ?? '',\n visibility: a.visibility,\n sortOrder: a.sortOrder,\n productId: a.productId,\n updatedAt: a.updatedAt,\n }))\n )\n }\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.exportCsv', 'Export as CSV')}\n >\n <Download size={18} />\n </button>\n )}\n </div>\n </div>\n\n {assets.length === 0 ? (\n <div className=\"bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-300\">\n <p className=\"text-text-secondary mb-4\">\n {tr('pressKit.noAssetsFound', 'No press kit assets found')}\n </p>\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/new`)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium\"\n >\n <Plus size={20} />\n {tr('pressKit.newAsset', 'New Asset')}\n </button>\n </PermissionGate>\n </div>\n ) : (\n <div className=\"bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)] overflow-hidden\">\n <table className=\"w-full\">\n <thead className=\"bg-muted border-b border-default\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnAsset', 'Asset')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnFile', 'File')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnVisibility', 'Visibility')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnUpdated', 'Updated')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-[var(--color-border-default)]\">\n {assets.map((asset) => (\n <tr\n key={asset.id}\n className=\"hover:bg-muted transition-all duration-200 cursor-pointer\"\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}`)}\n >\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-10 h-10 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center overflow-hidden\">\n {asset.thumbnailUrl ? (\n <img\n src={asset.thumbnailUrl}\n alt=\"\"\n className=\"w-full h-full object-cover\"\n />\n ) : (\n <FileText size={20} className=\"text-[var(--color-status-info)]\" />\n )}\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">{asset.title}</p>\n <p className=\"text-xs text-text-tertiary font-mono\">/{asset.slug}</p>\n </div>\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-xs font-medium px-2 py-1 rounded-full bg-[var(--color-status-info-subtle)] text-[var(--color-status-info)]\">\n {asset.category.replace(/_/g, ' ')}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">\n {(asset.mimeType ?? 'file').split('/').pop()} · {formatBytes(asset.fileSize)}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">{asset.visibility}</span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">\n {formatDate(asset.updatedAt)}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <div\n className=\"flex items-center justify-end gap-2\"\n onClick={(e) => e.stopPropagation()}\n >\n <a\n href={asset.fileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.download', 'Download')}\n >\n <Download size={18} />\n </a>\n <button\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n onClick={() => handleDelete(asset.id)}\n disabled={deleteLoading}\n className=\"p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50\"\n title={tr('pressKit.delete', 'Delete')}\n >\n <Trash2 size={18} />\n </button>\n </PermissionGate>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,IAAuD;CAC3D;EAAE,OAAO;EAAO,UAAU;EAAI;CAC9B;EAAE,OAAO;EAAS,UAAU;EAAQ;CACpC;EAAE,OAAO;EAAW,UAAU;EAAU;CACxC;EAAE,OAAO;EAAe,UAAU;EAAc;CAChD;EAAE,OAAO;EAAa,UAAU;EAAY;CAC5C;EAAE,OAAO;EAAa,UAAU;EAAY;CAC5C;EAAE,OAAO;EAAkB,UAAU;EAAiB;CACtD;EAAE,OAAO;EAAgB,UAAU;EAAe;CACnD;AAED,SAAS,EAAY,GAA8B;AAIjD,QAHK,IACD,IAAQ,OAAa,GAAG,EAAM,MAC9B,IAAQ,OAAO,OAAa,IAAI,IAAQ,MAAM,QAAQ,EAAE,CAAC,OACtD,IAAI,IAAQ,OAAO,MAAM,QAAQ,EAAE,CAAC,OAHxB;;AAMrB,SAAgB,IAAmB;CACjC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAmB,GAAG,EAAS,aAC/B,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,IAAK,GAAO,EACZ,CAAC,GAAQ,KAAa,EAAmC,EAAE,CAAC,EAE5D,EAAE,WAAQ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OAAO,EAAG,iBAAiB,OAAO;sBAElC,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;YAChB,CAAA,EACT,kBAAC,UAAD;YACE,eAAe,EAAa,EAAM,GAAG;YACrC,UAAU;YACV,WAAU;YACV,OAAO,EAAG,mBAAmB,SAAS;sBAEtC,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;YACb,CAAA,CACM;;UACb;;QACH,CAAA;OACF;QAjFE,EAAM,GAiFR,CACL;KACI,CAAA,CACF;;GACJ,CAAA,CAEJ"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createPressKitAssetSchema: z.ZodObject<{
|
|
3
|
+
productId: z.ZodString;
|
|
4
|
+
category: z.ZodEnum<{
|
|
5
|
+
LOGO: "LOGO";
|
|
6
|
+
BANNER: "BANNER";
|
|
7
|
+
SCREENSHOT: "SCREENSHOT";
|
|
8
|
+
BROCHURE: "BROCHURE";
|
|
9
|
+
DOCUMENT: "DOCUMENT";
|
|
10
|
+
PRESS_RELEASE: "PRESS_RELEASE";
|
|
11
|
+
BRAND_GUIDE: "BRAND_GUIDE";
|
|
12
|
+
}>;
|
|
13
|
+
title: z.ZodString;
|
|
14
|
+
slug: z.ZodString;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
fileUrl: z.ZodString;
|
|
17
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
18
|
+
fileSize: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
20
|
+
thumbnailUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
|
21
|
+
version: z.ZodOptional<z.ZodString>;
|
|
22
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
PUBLIC: "PUBLIC";
|
|
25
|
+
AUTHENTICATED: "AUTHENTICATED";
|
|
26
|
+
INTERNAL: "INTERNAL";
|
|
27
|
+
}>>;
|
|
28
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const updatePressKitAssetSchema: z.ZodObject<{
|
|
31
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
LOGO: "LOGO";
|
|
33
|
+
BANNER: "BANNER";
|
|
34
|
+
SCREENSHOT: "SCREENSHOT";
|
|
35
|
+
BROCHURE: "BROCHURE";
|
|
36
|
+
DOCUMENT: "DOCUMENT";
|
|
37
|
+
PRESS_RELEASE: "PRESS_RELEASE";
|
|
38
|
+
BRAND_GUIDE: "BRAND_GUIDE";
|
|
39
|
+
}>>;
|
|
40
|
+
title: z.ZodOptional<z.ZodString>;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
fileUrl: z.ZodOptional<z.ZodString>;
|
|
43
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
44
|
+
fileSize: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
46
|
+
thumbnailUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
|
47
|
+
version: z.ZodOptional<z.ZodString>;
|
|
48
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
PUBLIC: "PUBLIC";
|
|
51
|
+
AUTHENTICATED: "AUTHENTICATED";
|
|
52
|
+
INTERNAL: "INTERNAL";
|
|
53
|
+
}>>;
|
|
54
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type CreatePressKitAssetFormData = z.infer<typeof createPressKitAssetSchema>;
|
|
57
|
+
export type UpdatePressKitAssetFormData = z.infer<typeof updatePressKitAssetSchema>;
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;iBAapC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACpF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _enum as e, array as t, literal as n, number as r, object as i, string as a } from "../../../../node_modules/zod/v4/classic/schemas.js";
|
|
2
|
+
//#region src/product-management/modules/press-kit/schemas/index.ts
|
|
3
|
+
var o = e([
|
|
4
|
+
"LOGO",
|
|
5
|
+
"BANNER",
|
|
6
|
+
"SCREENSHOT",
|
|
7
|
+
"BROCHURE",
|
|
8
|
+
"DOCUMENT",
|
|
9
|
+
"PRESS_RELEASE",
|
|
10
|
+
"BRAND_GUIDE"
|
|
11
|
+
]), s = i({
|
|
12
|
+
productId: a().min(1, "Product is required"),
|
|
13
|
+
category: o,
|
|
14
|
+
title: a().min(2, "Title must be at least 2 characters").max(200, "Title must not exceed 200 characters").trim(),
|
|
15
|
+
slug: a().min(2, "Slug must be at least 2 characters").max(100, "Slug must not exceed 100 characters").regex(/^[a-z0-9-]+$/, "Slug must contain only lowercase letters, numbers, and hyphens").trim(),
|
|
16
|
+
description: a().max(1e3, "Description must not exceed 1000 characters").optional(),
|
|
17
|
+
fileUrl: a().url("Must be a valid URL"),
|
|
18
|
+
fileName: a().max(255).optional(),
|
|
19
|
+
fileSize: r().int().min(0).optional(),
|
|
20
|
+
mimeType: a().max(120).optional(),
|
|
21
|
+
thumbnailUrl: a().url("Must be a valid URL").or(n("")).optional(),
|
|
22
|
+
version: a().max(40).optional(),
|
|
23
|
+
tags: t(a()).optional(),
|
|
24
|
+
visibility: e([
|
|
25
|
+
"PUBLIC",
|
|
26
|
+
"AUTHENTICATED",
|
|
27
|
+
"INTERNAL"
|
|
28
|
+
]).optional(),
|
|
29
|
+
sortOrder: r().int().min(0).optional()
|
|
30
|
+
}), c = i({
|
|
31
|
+
category: o.optional(),
|
|
32
|
+
title: a().min(2).max(200).trim().optional(),
|
|
33
|
+
description: a().max(1e3).optional(),
|
|
34
|
+
fileUrl: a().url("Must be a valid URL").optional(),
|
|
35
|
+
fileName: a().max(255).optional(),
|
|
36
|
+
fileSize: r().int().min(0).optional(),
|
|
37
|
+
mimeType: a().max(120).optional(),
|
|
38
|
+
thumbnailUrl: a().url("Must be a valid URL").or(n("")).optional(),
|
|
39
|
+
version: a().max(40).optional(),
|
|
40
|
+
tags: t(a()).optional(),
|
|
41
|
+
visibility: e([
|
|
42
|
+
"PUBLIC",
|
|
43
|
+
"AUTHENTICATED",
|
|
44
|
+
"INTERNAL"
|
|
45
|
+
]).optional(),
|
|
46
|
+
sortOrder: r().int().min(0).optional()
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { s as createPressKitAssetSchema, c as updatePressKitAssetSchema };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Press Kit Asset Validation Schemas\n * Aligned with backend ProductPressKitAsset schema\n */\n\nconst categoryEnum = z.enum([\n 'LOGO',\n 'BANNER',\n 'SCREENSHOT',\n 'BROCHURE',\n 'DOCUMENT',\n 'PRESS_RELEASE',\n 'BRAND_GUIDE',\n]);\n\nexport const createPressKitAssetSchema = z.object({\n productId: z.string().min(1, 'Product is required'),\n category: categoryEnum,\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim(),\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim(),\n description: z.string().max(1000, 'Description must not exceed 1000 characters').optional(),\n fileUrl: z.string().url('Must be a valid URL'),\n fileName: z.string().max(255).optional(),\n fileSize: z.number().int().min(0).optional(),\n mimeType: z.string().max(120).optional(),\n thumbnailUrl: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n version: z.string().max(40).optional(),\n tags: z.array(z.string()).optional(),\n visibility: z.enum(['PUBLIC', 'AUTHENTICATED', 'INTERNAL']).optional(),\n sortOrder: z.number().int().min(0).optional(),\n});\n\nexport const updatePressKitAssetSchema = z.object({\n category: categoryEnum.optional(),\n title: z.string().min(2).max(200).trim().optional(),\n description: z.string().max(1000).optional(),\n fileUrl: z.string().url('Must be a valid URL').optional(),\n fileName: z.string().max(255).optional(),\n fileSize: z.number().int().min(0).optional(),\n mimeType: z.string().max(120).optional(),\n thumbnailUrl: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n version: z.string().max(40).optional(),\n tags: z.array(z.string()).optional(),\n visibility: z.enum(['PUBLIC', 'AUTHENTICATED', 'INTERNAL']).optional(),\n sortOrder: z.number().int().min(0).optional(),\n});\n\nexport type CreatePressKitAssetFormData = z.infer<typeof createPressKitAssetSchema>;\nexport type UpdatePressKitAssetFormData = z.infer<typeof updatePressKitAssetSchema>;\n"],"mappings":";;AAOA,IAAM,IAAe,EAAO;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,EAEW,IAA4B,EAAS;CAChD,WAAW,GAAU,CAAC,IAAI,GAAG,sBAAsB;CACnD,UAAU;CACV,OAAO,GACI,CACR,IAAI,GAAG,s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MAAM,EAAQ,GAAU,CAAC,CAAC,UAAU;CACpC,YAAY,EAAO;EAAC;EAAU;EAAiB;EAAW,CAAC,CAAC,UAAU;CACtE,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC9C,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Press Kit Module Types
|
|
3
|
+
* Aligned with backend ProductPressKitAsset schema
|
|
4
|
+
*/
|
|
5
|
+
export type ContentVisibility = 'PUBLIC' | 'AUTHENTICATED' | 'INTERNAL';
|
|
6
|
+
export type PressKitAssetCategory = 'LOGO' | 'BANNER' | 'SCREENSHOT' | 'BROCHURE' | 'DOCUMENT' | 'PRESS_RELEASE' | 'BRAND_GUIDE';
|
|
7
|
+
export interface ProductPressKitAsset {
|
|
8
|
+
id: string;
|
|
9
|
+
productId: string;
|
|
10
|
+
category: PressKitAssetCategory;
|
|
11
|
+
title: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
description: string | null;
|
|
14
|
+
fileUrl: string;
|
|
15
|
+
fileName: string | null;
|
|
16
|
+
fileSize: number | null;
|
|
17
|
+
mimeType: string | null;
|
|
18
|
+
thumbnailUrl: string | null;
|
|
19
|
+
version: string | null;
|
|
20
|
+
tags: string[];
|
|
21
|
+
visibility: ContentVisibility;
|
|
22
|
+
sortOrder: number;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
product?: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
slug: string;
|
|
29
|
+
} | null;
|
|
30
|
+
}
|
|
31
|
+
export interface PressKitAssetFilterInput {
|
|
32
|
+
search?: string;
|
|
33
|
+
category?: PressKitAssetCategory;
|
|
34
|
+
visibility?: ContentVisibility;
|
|
35
|
+
tag?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface CreatePressKitAssetInput {
|
|
38
|
+
productId: string;
|
|
39
|
+
category: PressKitAssetCategory;
|
|
40
|
+
title: string;
|
|
41
|
+
slug: string;
|
|
42
|
+
description?: string | null;
|
|
43
|
+
fileUrl: string;
|
|
44
|
+
fileName?: string | null;
|
|
45
|
+
fileSize?: number | null;
|
|
46
|
+
mimeType?: string | null;
|
|
47
|
+
thumbnailUrl?: string | null;
|
|
48
|
+
version?: string | null;
|
|
49
|
+
tags?: string[];
|
|
50
|
+
visibility?: ContentVisibility;
|
|
51
|
+
sortOrder?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface UpdatePressKitAssetInput {
|
|
54
|
+
category?: PressKitAssetCategory;
|
|
55
|
+
title?: string;
|
|
56
|
+
description?: string | null;
|
|
57
|
+
fileUrl?: string;
|
|
58
|
+
fileName?: string | null;
|
|
59
|
+
fileSize?: number | null;
|
|
60
|
+
mimeType?: string | null;
|
|
61
|
+
thumbnailUrl?: string | null;
|
|
62
|
+
version?: string | null;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
visibility?: ContentVisibility;
|
|
65
|
+
sortOrder?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface PressKitAssetsConnection {
|
|
68
|
+
items: ProductPressKitAsset[];
|
|
69
|
+
total: number;
|
|
70
|
+
hasMore: boolean;
|
|
71
|
+
}
|
|
72
|
+
export declare const PRESS_KIT_CATEGORIES: PressKitAssetCategory[];
|
|
73
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,eAAe,GAAG,UAAU,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,UAAU,GACV,eAAe,GACf,aAAa,CAAC;AAElB,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAA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
|
|
10
|
+
];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as PRESS_KIT_CATEGORIES };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/types/index.ts"],"sourcesContent":["/**\n * Press Kit Module Types\n * Aligned with backend ProductPressKitAsset schema\n */\n\nexport type ContentVisibility = 'PUBLIC' | 'AUTHENTICATED' | 'INTERNAL';\n\nexport type PressKitAssetCategory =\n | 'LOGO'\n | 'BANNER'\n | 'SCREENSHOT'\n | 'BROCHURE'\n | 'DOCUMENT'\n | 'PRESS_RELEASE'\n | 'BRAND_GUIDE';\n\nexport interface ProductPressKitAsset {\n id: string;\n productId: string;\n category: PressKitAssetCategory;\n title: string;\n slug: string;\n description: string | null;\n fileUrl: string;\n fileName: string | null;\n fileSize: number | null;\n mimeType: string | null;\n thumbnailUrl: string | null;\n version: string | null;\n tags: string[];\n visibility: ContentVisibility;\n sortOrder: number;\n createdAt: string;\n updatedAt: string;\n product?: { id: string; name: string; slug: string } | null;\n}\n\nexport interface PressKitAssetFilterInput {\n search?: string;\n category?: PressKitAssetCategory;\n visibility?: ContentVisibility;\n tag?: string;\n}\n\n// Nullable string fields accept `null` to match the GraphQL schema\n// (`String` without `!`). On Update, a `null` value explicitly clears\n// the field; on Create, `null` and absence are equivalent. Without\n// `null` in these types, callers cannot send an explicit clear from\n// the form's edit mode — see `PressKitAssetForm.handleSubmit`.\nexport interface CreatePressKitAssetInput {\n productId: string;\n category: PressKitAssetCategory;\n title: string;\n slug: string;\n description?: string | null;\n fileUrl: string;\n fileName?: string | null;\n fileSize?: number | null;\n mimeType?: string | null;\n thumbnailUrl?: string | null;\n version?: string | null;\n tags?: string[];\n visibility?: ContentVisibility;\n sortOrder?: number;\n}\n\nexport interface UpdatePressKitAssetInput {\n category?: PressKitAssetCategory;\n title?: string;\n description?: string | null;\n fileUrl?: string;\n fileName?: string | null;\n fileSize?: number | null;\n mimeType?: string | null;\n thumbnailUrl?: string | null;\n version?: string | null;\n tags?: string[];\n visibility?: ContentVisibility;\n sortOrder?: number;\n}\n\nexport interface PressKitAssetsConnection {\n items: ProductPressKitAsset[];\n total: number;\n hasMore: boolean;\n}\n\nexport const PRESS_KIT_CATEGORIES: PressKitAssetCategory[] = [\n 'LOGO',\n 'BANNER',\n 'SCREENSHOT',\n 'BROCHURE',\n 'DOCUMENT',\n 'PRESS_RELEASE',\n 'BRAND_GUIDE',\n];\n"],"mappings":";AAuFA,IAAa,IAAgD;CAC3D;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductPlans.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/products/components/ProductPlans.tsx"],"names":[],"mappings":"AA8HA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,QAAgB,GACjB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ProductPlans.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/products/components/ProductPlans.tsx"],"names":[],"mappings":"AA8HA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,QAAgB,GACjB,EAAE,iBAAiB,2CA0oBnB"}
|