@burdenoff/microfe-product 2026.518.3 → 2026.519.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/global-operations.d.ts +36 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +126 -109
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +105 -19
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +281 -218
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.d.ts +16 -1
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.js +49 -14
- package/dist/product-management/modules/press-kit/hooks/usePressKitAssets.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,101 +2,124 @@ import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
|
2
2
|
import { useProducts as t } from "../../products/hooks/useProducts.js";
|
|
3
3
|
import { ZodError as n } from "../../../../node_modules/zod/v4/classic/errors.js";
|
|
4
4
|
import { TagInput as r } from "../../../shared/components/input/TagInput.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { useCreatePressKitAssetUpload as i } from "../hooks/usePressKitAssets.js";
|
|
6
|
+
import { PRESS_KIT_CATEGORIES as a } from "../types/index.js";
|
|
7
|
+
import { createPressKitAssetSchema as o, updatePressKitAssetSchema as s } from "../schemas/index.js";
|
|
8
|
+
import { useRef as c, useState as l } from "react";
|
|
9
|
+
import { Loader2 as u, UploadCloud as d } from "lucide-react";
|
|
10
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
11
|
//#region src/product-management/modules/press-kit/components/PressKitAssetForm.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
productId:
|
|
15
|
-
category:
|
|
16
|
-
title:
|
|
17
|
-
slug:
|
|
18
|
-
description:
|
|
19
|
-
fileUrl:
|
|
20
|
-
fileName:
|
|
21
|
-
fileSize:
|
|
22
|
-
mimeType:
|
|
23
|
-
thumbnailUrl:
|
|
24
|
-
version:
|
|
25
|
-
visibility:
|
|
26
|
-
sortOrder:
|
|
27
|
-
}), [
|
|
12
|
+
var h = "\n w-full px-3 py-2 bg-surface border border-default rounded-lg\n text-text-primary placeholder:text-text-tertiary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n disabled:bg-muted disabled:cursor-not-allowed transition-all duration-200\n";
|
|
13
|
+
function g({ asset: g, onSubmit: v, onCancel: y, loading: b }) {
|
|
14
|
+
let x = e(), S = !!g, { products: C } = t(void 0, { limit: 100 }), [w, T] = l({
|
|
15
|
+
productId: g?.productId || "",
|
|
16
|
+
category: g?.category || "LOGO",
|
|
17
|
+
title: g?.title || "",
|
|
18
|
+
slug: g?.slug || "",
|
|
19
|
+
description: g?.description || "",
|
|
20
|
+
fileUrl: g?.fileUrl || "",
|
|
21
|
+
fileName: g?.fileName || "",
|
|
22
|
+
fileSize: g?.fileSize ?? null,
|
|
23
|
+
mimeType: g?.mimeType || "",
|
|
24
|
+
thumbnailUrl: g?.thumbnailUrl || "",
|
|
25
|
+
version: g?.version || "",
|
|
26
|
+
visibility: g?.visibility ?? "PUBLIC",
|
|
27
|
+
sortOrder: g?.sortOrder ?? 0
|
|
28
|
+
}), [E, D] = l(g?.tags ?? []), [O, k] = l({}), { uploadFile: A, uploading: j } = i(), [M, N] = l(null), P = c(null), F = async (e) => {
|
|
29
|
+
if (e) {
|
|
30
|
+
N(null);
|
|
31
|
+
try {
|
|
32
|
+
if (!w.productId) {
|
|
33
|
+
N(x("pressKit.uploadNeedsProduct", "Select a product first"));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let t = await A(e, w.productId, w.category);
|
|
37
|
+
T((e) => ({
|
|
38
|
+
...e,
|
|
39
|
+
fileUrl: t.fileUrl,
|
|
40
|
+
fileName: t.fileName,
|
|
41
|
+
fileSize: t.fileSize,
|
|
42
|
+
mimeType: t.mimeType
|
|
43
|
+
}));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
N(e instanceof Error ? e.message : "Upload failed");
|
|
46
|
+
} finally {
|
|
47
|
+
P.current && (P.current.value = "");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, I = () => {
|
|
28
51
|
try {
|
|
29
|
-
let e =
|
|
30
|
-
return t.description || delete t.description, t.fileName || delete t.fileName, t.fileSize ?? delete t.fileSize, t.mimeType || delete t.mimeType, t.thumbnailUrl || delete t.thumbnailUrl, t.version || delete t.version, e.parse(t),
|
|
52
|
+
let e = S ? s : o, t = { ...w };
|
|
53
|
+
return t.description || delete t.description, t.fileName || delete t.fileName, t.fileSize ?? delete t.fileSize, t.mimeType || delete t.mimeType, t.thumbnailUrl || delete t.thumbnailUrl, t.version || delete t.version, e.parse(t), k({}), !0;
|
|
31
54
|
} catch (e) {
|
|
32
55
|
if (e instanceof n) {
|
|
33
56
|
let t = {};
|
|
34
57
|
e.issues.forEach((e) => {
|
|
35
58
|
t[e.path.join(".")] = e.message;
|
|
36
|
-
}),
|
|
59
|
+
}), k(t);
|
|
37
60
|
}
|
|
38
61
|
return !1;
|
|
39
62
|
}
|
|
40
63
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ m("form", {
|
|
42
65
|
onSubmit: async (e) => {
|
|
43
|
-
if (e.preventDefault(), !
|
|
44
|
-
let t = (e) =>
|
|
45
|
-
category:
|
|
46
|
-
title:
|
|
47
|
-
description: t(
|
|
48
|
-
fileUrl:
|
|
49
|
-
fileName: t(
|
|
50
|
-
fileSize: ((e) =>
|
|
51
|
-
mimeType: t(
|
|
52
|
-
thumbnailUrl: t(
|
|
53
|
-
version: t(
|
|
54
|
-
tags:
|
|
55
|
-
visibility:
|
|
56
|
-
sortOrder: typeof
|
|
66
|
+
if (e.preventDefault(), !I()) return;
|
|
67
|
+
let t = (e) => S ? e.trim() === "" ? null : e : e || void 0, n = {
|
|
68
|
+
category: w.category,
|
|
69
|
+
title: w.title,
|
|
70
|
+
description: t(w.description),
|
|
71
|
+
fileUrl: w.fileUrl,
|
|
72
|
+
fileName: t(w.fileName),
|
|
73
|
+
fileSize: ((e) => S ? e : e ?? void 0)(w.fileSize),
|
|
74
|
+
mimeType: t(w.mimeType),
|
|
75
|
+
thumbnailUrl: t(w.thumbnailUrl),
|
|
76
|
+
version: t(w.version),
|
|
77
|
+
tags: E,
|
|
78
|
+
visibility: w.visibility,
|
|
79
|
+
sortOrder: typeof w.sortOrder == "string" ? parseInt(w.sortOrder, 10) || 0 : w.sortOrder
|
|
57
80
|
};
|
|
58
|
-
await
|
|
81
|
+
await v(S ? n : {
|
|
59
82
|
...n,
|
|
60
|
-
productId:
|
|
61
|
-
slug:
|
|
83
|
+
productId: w.productId,
|
|
84
|
+
slug: w.slug
|
|
62
85
|
});
|
|
63
86
|
},
|
|
64
87
|
className: "space-y-6 animate-in fade-in duration-300",
|
|
65
88
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ m("div", {
|
|
67
90
|
className: "space-y-4",
|
|
68
91
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ p("h3", {
|
|
70
93
|
className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
|
|
71
|
-
children:
|
|
94
|
+
children: x("pressKit.basicInformation", "Basic Information")
|
|
72
95
|
}),
|
|
73
|
-
!
|
|
74
|
-
/* @__PURE__ */
|
|
96
|
+
!S && /* @__PURE__ */ m("div", { children: [
|
|
97
|
+
/* @__PURE__ */ m("label", {
|
|
75
98
|
htmlFor: "productId",
|
|
76
99
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
77
100
|
children: [
|
|
78
|
-
|
|
101
|
+
x("pressKit.fieldProduct", "Product"),
|
|
79
102
|
" ",
|
|
80
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ p("span", {
|
|
81
104
|
className: "text-[var(--color-status-error)]",
|
|
82
105
|
children: "*"
|
|
83
106
|
})
|
|
84
107
|
]
|
|
85
108
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ m("select", {
|
|
87
110
|
id: "productId",
|
|
88
|
-
value:
|
|
89
|
-
onChange: (e) =>
|
|
90
|
-
...
|
|
111
|
+
value: w.productId,
|
|
112
|
+
onChange: (e) => T({
|
|
113
|
+
...w,
|
|
91
114
|
productId: e.target.value
|
|
92
115
|
}),
|
|
93
|
-
className:
|
|
94
|
-
disabled:
|
|
116
|
+
className: h,
|
|
117
|
+
disabled: b,
|
|
95
118
|
required: !0,
|
|
96
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ p("option", {
|
|
97
120
|
value: "",
|
|
98
|
-
children:
|
|
99
|
-
}),
|
|
121
|
+
children: x("pressKit.selectProduct", "Select a product…")
|
|
122
|
+
}), C.map((e) => /* @__PURE__ */ m("option", {
|
|
100
123
|
value: e.id,
|
|
101
124
|
children: [
|
|
102
125
|
e.name,
|
|
@@ -106,260 +129,300 @@ function f({ asset: f, onSubmit: m, onCancel: h, loading: g }) {
|
|
|
106
129
|
]
|
|
107
130
|
}, e.id))]
|
|
108
131
|
}),
|
|
109
|
-
|
|
132
|
+
O.productId && /* @__PURE__ */ p("p", {
|
|
110
133
|
className: "text-sm text-[var(--color-status-error)] mt-1",
|
|
111
|
-
children:
|
|
134
|
+
children: O.productId
|
|
112
135
|
})
|
|
113
136
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
|
|
115
138
|
htmlFor: "category",
|
|
116
139
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
117
140
|
children: [
|
|
118
|
-
|
|
141
|
+
x("pressKit.fieldCategory", "Category"),
|
|
119
142
|
" ",
|
|
120
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ p("span", {
|
|
121
144
|
className: "text-[var(--color-status-error)]",
|
|
122
145
|
children: "*"
|
|
123
146
|
})
|
|
124
147
|
]
|
|
125
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ p("select", {
|
|
126
149
|
id: "category",
|
|
127
|
-
value:
|
|
128
|
-
onChange: (e) =>
|
|
129
|
-
...
|
|
150
|
+
value: w.category,
|
|
151
|
+
onChange: (e) => T({
|
|
152
|
+
...w,
|
|
130
153
|
category: e.target.value
|
|
131
154
|
}),
|
|
132
|
-
className:
|
|
133
|
-
disabled:
|
|
134
|
-
children:
|
|
155
|
+
className: h,
|
|
156
|
+
disabled: b,
|
|
157
|
+
children: a.map((e) => /* @__PURE__ */ p("option", {
|
|
135
158
|
value: e,
|
|
136
159
|
children: e.replace(/_/g, " ")
|
|
137
160
|
}, e))
|
|
138
161
|
})] }),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ m("div", { children: [
|
|
163
|
+
/* @__PURE__ */ m("label", {
|
|
141
164
|
htmlFor: "title",
|
|
142
165
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
143
166
|
children: [
|
|
144
|
-
|
|
167
|
+
x("pressKit.fieldTitle", "Title"),
|
|
145
168
|
" ",
|
|
146
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ p("span", {
|
|
147
170
|
className: "text-[var(--color-status-error)]",
|
|
148
171
|
children: "*"
|
|
149
172
|
})
|
|
150
173
|
]
|
|
151
174
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ p("input", {
|
|
153
176
|
id: "title",
|
|
154
177
|
type: "text",
|
|
155
|
-
value:
|
|
178
|
+
value: w.title,
|
|
156
179
|
onChange: (e) => {
|
|
157
180
|
let t = e.target.value;
|
|
158
|
-
|
|
181
|
+
T((e) => ({
|
|
159
182
|
...e,
|
|
160
183
|
title: t,
|
|
161
|
-
slug: !
|
|
184
|
+
slug: !S && (!e.slug || e.slug === _(e.title)) ? _(t) : e.slug
|
|
162
185
|
}));
|
|
163
186
|
},
|
|
164
|
-
className:
|
|
165
|
-
placeholder:
|
|
166
|
-
disabled:
|
|
187
|
+
className: h,
|
|
188
|
+
placeholder: x("pressKit.titlePlaceholder", "e.g. Logo — Dark"),
|
|
189
|
+
disabled: b,
|
|
167
190
|
required: !0
|
|
168
191
|
}),
|
|
169
|
-
|
|
192
|
+
O.title && /* @__PURE__ */ p("p", {
|
|
170
193
|
className: "text-sm text-[var(--color-status-error)] mt-1",
|
|
171
|
-
children:
|
|
194
|
+
children: O.title
|
|
172
195
|
})
|
|
173
196
|
] }),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ m("div", { children: [
|
|
198
|
+
/* @__PURE__ */ m("label", {
|
|
176
199
|
htmlFor: "slug",
|
|
177
200
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
178
201
|
children: [
|
|
179
|
-
|
|
202
|
+
x("pressKit.fieldSlug", "Slug"),
|
|
180
203
|
" ",
|
|
181
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ p("span", {
|
|
182
205
|
className: "text-[var(--color-status-error)]",
|
|
183
206
|
children: "*"
|
|
184
207
|
})
|
|
185
208
|
]
|
|
186
209
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ p("input", {
|
|
188
211
|
id: "slug",
|
|
189
212
|
type: "text",
|
|
190
|
-
value:
|
|
191
|
-
onChange: (e) =>
|
|
192
|
-
...
|
|
213
|
+
value: w.slug,
|
|
214
|
+
onChange: (e) => T({
|
|
215
|
+
...w,
|
|
193
216
|
slug: e.target.value.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "")
|
|
194
217
|
}),
|
|
195
|
-
className:
|
|
218
|
+
className: h,
|
|
196
219
|
placeholder: "logo-dark",
|
|
197
|
-
disabled:
|
|
198
|
-
required: !
|
|
220
|
+
disabled: b || S,
|
|
221
|
+
required: !S
|
|
199
222
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ p("p", {
|
|
201
224
|
className: "text-xs text-text-tertiary mt-1",
|
|
202
|
-
children:
|
|
225
|
+
children: x("pressKit.slugHint", "Lowercase, numbers, hyphens. Cannot change after creation.")
|
|
203
226
|
}),
|
|
204
|
-
|
|
227
|
+
O.slug && /* @__PURE__ */ p("p", {
|
|
205
228
|
className: "text-sm text-[var(--color-status-error)] mt-1",
|
|
206
|
-
children:
|
|
229
|
+
children: O.slug
|
|
207
230
|
})
|
|
208
231
|
] }),
|
|
209
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
210
233
|
htmlFor: "description",
|
|
211
234
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
212
|
-
children:
|
|
213
|
-
}), /* @__PURE__ */
|
|
235
|
+
children: x("pressKit.fieldDescription", "Description")
|
|
236
|
+
}), /* @__PURE__ */ p("textarea", {
|
|
214
237
|
id: "description",
|
|
215
|
-
value:
|
|
216
|
-
onChange: (e) =>
|
|
217
|
-
...
|
|
238
|
+
value: w.description,
|
|
239
|
+
onChange: (e) => T({
|
|
240
|
+
...w,
|
|
218
241
|
description: e.target.value
|
|
219
242
|
}),
|
|
220
243
|
rows: 3,
|
|
221
|
-
className:
|
|
222
|
-
placeholder:
|
|
223
|
-
disabled:
|
|
244
|
+
className: h,
|
|
245
|
+
placeholder: x("pressKit.descriptionPlaceholder", "Short description / usage notes"),
|
|
246
|
+
disabled: b
|
|
224
247
|
})] })
|
|
225
248
|
]
|
|
226
249
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ m("div", {
|
|
228
251
|
className: "space-y-4 pt-4 border-t border-default",
|
|
229
252
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ p("h3", {
|
|
231
254
|
className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
|
|
232
|
-
children:
|
|
255
|
+
children: x("pressKit.fileSection", "File")
|
|
233
256
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ p("p", {
|
|
235
258
|
className: "text-xs text-text-tertiary",
|
|
236
|
-
children:
|
|
259
|
+
children: x("pressKit.fileUploadHint", "Upload the file (drag & drop or click), or paste a public CDN/file URL below.")
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ m("div", {
|
|
262
|
+
onClick: () => {
|
|
263
|
+
b || j || P.current?.click();
|
|
264
|
+
},
|
|
265
|
+
onDragOver: (e) => e.preventDefault(),
|
|
266
|
+
onDrop: (e) => {
|
|
267
|
+
e.preventDefault(), !(b || j) && F(e.dataTransfer.files?.[0]);
|
|
268
|
+
},
|
|
269
|
+
className: `flex flex-col items-center justify-center gap-2 px-4 py-6 border-2 border-dashed border-default rounded-lg transition-colors ${b || j ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:border-[var(--color-border-focus)]"}`,
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ p("input", {
|
|
272
|
+
ref: P,
|
|
273
|
+
type: "file",
|
|
274
|
+
className: "hidden",
|
|
275
|
+
disabled: b || j,
|
|
276
|
+
onChange: (e) => void F(e.target.files?.[0])
|
|
277
|
+
}),
|
|
278
|
+
j ? /* @__PURE__ */ m("span", {
|
|
279
|
+
className: "inline-flex items-center gap-2 text-sm text-text-secondary",
|
|
280
|
+
children: [/* @__PURE__ */ p(u, {
|
|
281
|
+
size: 16,
|
|
282
|
+
className: "animate-spin"
|
|
283
|
+
}), x("pressKit.uploading", "Uploading…")]
|
|
284
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
|
|
285
|
+
size: 22,
|
|
286
|
+
className: "text-text-tertiary"
|
|
287
|
+
}), /* @__PURE__ */ p("span", {
|
|
288
|
+
className: "text-sm text-text-secondary",
|
|
289
|
+
children: x("pressKit.uploadCta", "Drag & drop a file, or click to choose")
|
|
290
|
+
})] }),
|
|
291
|
+
w.fileUrl && !j && /* @__PURE__ */ p("span", {
|
|
292
|
+
className: "text-xs text-[var(--color-status-success)] break-all",
|
|
293
|
+
children: w.fileName || w.fileUrl
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
}),
|
|
297
|
+
M && /* @__PURE__ */ p("p", {
|
|
298
|
+
className: "text-sm text-[var(--color-status-error)]",
|
|
299
|
+
children: M
|
|
237
300
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ m("div", { children: [
|
|
302
|
+
/* @__PURE__ */ m("label", {
|
|
240
303
|
htmlFor: "fileUrl",
|
|
241
304
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
242
305
|
children: [
|
|
243
|
-
|
|
306
|
+
x("pressKit.fieldFileUrl", "File URL"),
|
|
244
307
|
" ",
|
|
245
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ p("span", {
|
|
246
309
|
className: "text-[var(--color-status-error)]",
|
|
247
310
|
children: "*"
|
|
248
311
|
})
|
|
249
312
|
]
|
|
250
313
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ p("input", {
|
|
252
315
|
id: "fileUrl",
|
|
253
316
|
type: "url",
|
|
254
|
-
value:
|
|
255
|
-
onChange: (e) =>
|
|
256
|
-
...
|
|
317
|
+
value: w.fileUrl,
|
|
318
|
+
onChange: (e) => T({
|
|
319
|
+
...w,
|
|
257
320
|
fileUrl: e.target.value
|
|
258
321
|
}),
|
|
259
|
-
className:
|
|
322
|
+
className: h,
|
|
260
323
|
placeholder: "https://cdn.example.com/press/logo-dark.svg",
|
|
261
|
-
disabled:
|
|
324
|
+
disabled: b,
|
|
262
325
|
required: !0
|
|
263
326
|
}),
|
|
264
|
-
|
|
327
|
+
O.fileUrl && /* @__PURE__ */ p("p", {
|
|
265
328
|
className: "text-sm text-[var(--color-status-error)] mt-1",
|
|
266
|
-
children:
|
|
329
|
+
children: O.fileUrl
|
|
267
330
|
})
|
|
268
331
|
] }),
|
|
269
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ m("div", {
|
|
270
333
|
className: "grid grid-cols-2 gap-4",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
272
335
|
htmlFor: "fileName",
|
|
273
336
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
274
|
-
children:
|
|
275
|
-
}), /* @__PURE__ */
|
|
337
|
+
children: x("pressKit.fieldFileName", "File Name")
|
|
338
|
+
}), /* @__PURE__ */ p("input", {
|
|
276
339
|
id: "fileName",
|
|
277
340
|
type: "text",
|
|
278
|
-
value:
|
|
279
|
-
onChange: (e) =>
|
|
280
|
-
...
|
|
341
|
+
value: w.fileName,
|
|
342
|
+
onChange: (e) => T({
|
|
343
|
+
...w,
|
|
281
344
|
fileName: e.target.value
|
|
282
345
|
}),
|
|
283
|
-
className:
|
|
346
|
+
className: h,
|
|
284
347
|
placeholder: "logo-dark.svg",
|
|
285
|
-
disabled:
|
|
286
|
-
})] }), /* @__PURE__ */
|
|
348
|
+
disabled: b
|
|
349
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
287
350
|
htmlFor: "mimeType",
|
|
288
351
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
289
|
-
children:
|
|
290
|
-
}), /* @__PURE__ */
|
|
352
|
+
children: x("pressKit.fieldMimeType", "MIME Type")
|
|
353
|
+
}), /* @__PURE__ */ p("input", {
|
|
291
354
|
id: "mimeType",
|
|
292
355
|
type: "text",
|
|
293
|
-
value:
|
|
294
|
-
onChange: (e) =>
|
|
295
|
-
...
|
|
356
|
+
value: w.mimeType,
|
|
357
|
+
onChange: (e) => T({
|
|
358
|
+
...w,
|
|
296
359
|
mimeType: e.target.value
|
|
297
360
|
}),
|
|
298
|
-
className:
|
|
361
|
+
className: h,
|
|
299
362
|
placeholder: "image/svg+xml",
|
|
300
|
-
disabled:
|
|
363
|
+
disabled: b
|
|
301
364
|
})] })]
|
|
302
365
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ m("div", {
|
|
304
367
|
className: "grid grid-cols-2 gap-4",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
306
369
|
htmlFor: "fileSize",
|
|
307
370
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
308
|
-
children:
|
|
309
|
-
}), /* @__PURE__ */
|
|
371
|
+
children: x("pressKit.fieldFileSize", "File Size (bytes)")
|
|
372
|
+
}), /* @__PURE__ */ p("input", {
|
|
310
373
|
id: "fileSize",
|
|
311
374
|
type: "number",
|
|
312
375
|
min: 0,
|
|
313
|
-
value:
|
|
376
|
+
value: w.fileSize ?? "",
|
|
314
377
|
onChange: (e) => {
|
|
315
378
|
let t = e.target.value, n = parseInt(t, 10);
|
|
316
|
-
|
|
317
|
-
...
|
|
379
|
+
T({
|
|
380
|
+
...w,
|
|
318
381
|
fileSize: t === "" || Number.isNaN(n) ? null : n
|
|
319
382
|
});
|
|
320
383
|
},
|
|
321
|
-
className:
|
|
322
|
-
disabled:
|
|
323
|
-
})] }), /* @__PURE__ */
|
|
384
|
+
className: h,
|
|
385
|
+
disabled: b
|
|
386
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
324
387
|
htmlFor: "version",
|
|
325
388
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
326
|
-
children:
|
|
327
|
-
}), /* @__PURE__ */
|
|
389
|
+
children: x("pressKit.fieldVersion", "Version")
|
|
390
|
+
}), /* @__PURE__ */ p("input", {
|
|
328
391
|
id: "version",
|
|
329
392
|
type: "text",
|
|
330
|
-
value:
|
|
331
|
-
onChange: (e) =>
|
|
332
|
-
...
|
|
393
|
+
value: w.version,
|
|
394
|
+
onChange: (e) => T({
|
|
395
|
+
...w,
|
|
333
396
|
version: e.target.value
|
|
334
397
|
}),
|
|
335
|
-
className:
|
|
398
|
+
className: h,
|
|
336
399
|
placeholder: "v2",
|
|
337
|
-
disabled:
|
|
400
|
+
disabled: b
|
|
338
401
|
})] })]
|
|
339
402
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ m("div", { children: [
|
|
404
|
+
/* @__PURE__ */ p("label", {
|
|
342
405
|
htmlFor: "thumbnailUrl",
|
|
343
406
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
344
|
-
children:
|
|
407
|
+
children: x("pressKit.fieldThumbnail", "Thumbnail / Preview URL")
|
|
345
408
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ p("input", {
|
|
347
410
|
id: "thumbnailUrl",
|
|
348
411
|
type: "url",
|
|
349
|
-
value:
|
|
350
|
-
onChange: (e) =>
|
|
351
|
-
...
|
|
412
|
+
value: w.thumbnailUrl,
|
|
413
|
+
onChange: (e) => T({
|
|
414
|
+
...w,
|
|
352
415
|
thumbnailUrl: e.target.value
|
|
353
416
|
}),
|
|
354
|
-
className:
|
|
417
|
+
className: h,
|
|
355
418
|
placeholder: "https://cdn.example.com/press/logo-dark-preview.png",
|
|
356
|
-
disabled:
|
|
419
|
+
disabled: b
|
|
357
420
|
}),
|
|
358
|
-
|
|
421
|
+
w.thumbnailUrl && /* @__PURE__ */ p("div", {
|
|
359
422
|
className: "mt-2 rounded-lg overflow-hidden border border-default",
|
|
360
423
|
style: { maxWidth: 320 },
|
|
361
|
-
children: /* @__PURE__ */
|
|
362
|
-
src:
|
|
424
|
+
children: /* @__PURE__ */ p("img", {
|
|
425
|
+
src: w.thumbnailUrl,
|
|
363
426
|
alt: "Preview",
|
|
364
427
|
className: "w-full h-auto"
|
|
365
428
|
})
|
|
@@ -367,101 +430,101 @@ function f({ asset: f, onSubmit: m, onCancel: h, loading: g }) {
|
|
|
367
430
|
] })
|
|
368
431
|
]
|
|
369
432
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ m("div", {
|
|
371
434
|
className: "space-y-4 pt-4 border-t border-default",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
373
436
|
className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
|
|
374
|
-
children:
|
|
375
|
-
}), /* @__PURE__ */
|
|
437
|
+
children: x("pressKit.publishing", "Publishing")
|
|
438
|
+
}), /* @__PURE__ */ m("div", {
|
|
376
439
|
className: "grid grid-cols-2 gap-4",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ m("div", { children: [
|
|
441
|
+
/* @__PURE__ */ p("label", {
|
|
379
442
|
htmlFor: "visibility",
|
|
380
443
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
381
|
-
children:
|
|
444
|
+
children: x("pressKit.fieldVisibility", "Visibility")
|
|
382
445
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ m("select", {
|
|
384
447
|
id: "visibility",
|
|
385
|
-
value:
|
|
386
|
-
onChange: (e) =>
|
|
387
|
-
...
|
|
448
|
+
value: w.visibility,
|
|
449
|
+
onChange: (e) => T({
|
|
450
|
+
...w,
|
|
388
451
|
visibility: e.target.value
|
|
389
452
|
}),
|
|
390
|
-
className:
|
|
391
|
-
disabled:
|
|
453
|
+
className: h,
|
|
454
|
+
disabled: b,
|
|
392
455
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ p("option", {
|
|
394
457
|
value: "PUBLIC",
|
|
395
|
-
children:
|
|
458
|
+
children: x("pressKit.visPublic", "Public — everyone")
|
|
396
459
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ p("option", {
|
|
398
461
|
value: "AUTHENTICATED",
|
|
399
|
-
children:
|
|
462
|
+
children: x("pressKit.visAuth", "Authenticated — signed-in")
|
|
400
463
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ p("option", {
|
|
402
465
|
value: "INTERNAL",
|
|
403
|
-
children:
|
|
466
|
+
children: x("pressKit.visInternal", "Internal — staff")
|
|
404
467
|
})
|
|
405
468
|
]
|
|
406
469
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ p("p", {
|
|
408
471
|
className: "text-xs text-text-tertiary mt-1",
|
|
409
|
-
children:
|
|
472
|
+
children: x("pressKit.visHint", "Public is required to show on the website press page.")
|
|
410
473
|
})
|
|
411
|
-
] }), /* @__PURE__ */
|
|
474
|
+
] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
412
475
|
htmlFor: "sortOrder",
|
|
413
476
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
414
|
-
children:
|
|
415
|
-
}), /* @__PURE__ */
|
|
477
|
+
children: x("pressKit.fieldSortOrder", "Sort Order")
|
|
478
|
+
}), /* @__PURE__ */ p("input", {
|
|
416
479
|
id: "sortOrder",
|
|
417
480
|
type: "number",
|
|
418
481
|
min: 0,
|
|
419
|
-
value:
|
|
420
|
-
onChange: (e) =>
|
|
421
|
-
...
|
|
482
|
+
value: w.sortOrder,
|
|
483
|
+
onChange: (e) => T({
|
|
484
|
+
...w,
|
|
422
485
|
sortOrder: parseInt(e.target.value, 10) || 0
|
|
423
486
|
}),
|
|
424
|
-
className:
|
|
425
|
-
disabled:
|
|
487
|
+
className: h,
|
|
488
|
+
disabled: b
|
|
426
489
|
})] })]
|
|
427
490
|
})]
|
|
428
491
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ m("div", {
|
|
430
493
|
className: "space-y-4 pt-4 border-t border-default",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
432
495
|
className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
|
|
433
|
-
children:
|
|
434
|
-
}), /* @__PURE__ */
|
|
435
|
-
value:
|
|
436
|
-
onChange:
|
|
437
|
-
disabled:
|
|
496
|
+
children: x("pressKit.tags", "Tags")
|
|
497
|
+
}), /* @__PURE__ */ p(r, {
|
|
498
|
+
value: E,
|
|
499
|
+
onChange: D,
|
|
500
|
+
disabled: b
|
|
438
501
|
})]
|
|
439
502
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ m("div", {
|
|
441
504
|
className: "flex gap-3 pt-4 border-t border-default",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ m("button", {
|
|
443
506
|
type: "submit",
|
|
444
|
-
disabled:
|
|
507
|
+
disabled: b,
|
|
445
508
|
className: "inline-flex items-center gap-2 px-6 py-2.5 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 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
446
|
-
children: [
|
|
509
|
+
children: [b && /* @__PURE__ */ p(u, {
|
|
447
510
|
size: 16,
|
|
448
511
|
className: "animate-spin"
|
|
449
|
-
}),
|
|
450
|
-
}), /* @__PURE__ */
|
|
512
|
+
}), S ? x("pressKit.updateAsset", "Update Asset") : x("pressKit.createAsset", "Create Asset")]
|
|
513
|
+
}), /* @__PURE__ */ p("button", {
|
|
451
514
|
type: "button",
|
|
452
|
-
onClick:
|
|
453
|
-
disabled:
|
|
515
|
+
onClick: y,
|
|
516
|
+
disabled: b,
|
|
454
517
|
className: "px-6 py-2.5 bg-transparent text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200 font-medium disabled:opacity-50 disabled:cursor-not-allowed",
|
|
455
|
-
children:
|
|
518
|
+
children: x("productCommon.cancel", "Cancel")
|
|
456
519
|
})]
|
|
457
520
|
})
|
|
458
521
|
]
|
|
459
522
|
});
|
|
460
523
|
}
|
|
461
|
-
function
|
|
524
|
+
function _(e) {
|
|
462
525
|
return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
463
526
|
}
|
|
464
527
|
//#endregion
|
|
465
|
-
export {
|
|
528
|
+
export { g as PressKitAssetForm };
|
|
466
529
|
|
|
467
530
|
//# sourceMappingURL=PressKitAssetForm.js.map
|