@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.
@@ -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 { PRESS_KIT_CATEGORIES as i } from "../types/index.js";
6
- import { createPressKitAssetSchema as a, updatePressKitAssetSchema as o } from "../schemas/index.js";
7
- import { useState as s } from "react";
8
- import { Loader2 as c } from "lucide-react";
9
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
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 d = "\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";
12
- function f({ asset: f, onSubmit: m, onCancel: h, loading: g }) {
13
- let _ = e(), v = !!f, { products: y } = t(void 0, { limit: 100 }), [b, x] = s({
14
- productId: f?.productId || "",
15
- category: f?.category || "LOGO",
16
- title: f?.title || "",
17
- slug: f?.slug || "",
18
- description: f?.description || "",
19
- fileUrl: f?.fileUrl || "",
20
- fileName: f?.fileName || "",
21
- fileSize: f?.fileSize ?? null,
22
- mimeType: f?.mimeType || "",
23
- thumbnailUrl: f?.thumbnailUrl || "",
24
- version: f?.version || "",
25
- visibility: f?.visibility ?? "PUBLIC",
26
- sortOrder: f?.sortOrder ?? 0
27
- }), [S, C] = s(f?.tags ?? []), [w, T] = s({}), E = () => {
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 = v ? o : a, t = { ...b };
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), T({}), !0;
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
- }), T(t);
59
+ }), k(t);
37
60
  }
38
61
  return !1;
39
62
  }
40
63
  };
41
- return /* @__PURE__ */ u("form", {
64
+ return /* @__PURE__ */ m("form", {
42
65
  onSubmit: async (e) => {
43
- if (e.preventDefault(), !E()) return;
44
- let t = (e) => v ? e.trim() === "" ? null : e : e || void 0, n = {
45
- category: b.category,
46
- title: b.title,
47
- description: t(b.description),
48
- fileUrl: b.fileUrl,
49
- fileName: t(b.fileName),
50
- fileSize: ((e) => v ? e : e ?? void 0)(b.fileSize),
51
- mimeType: t(b.mimeType),
52
- thumbnailUrl: t(b.thumbnailUrl),
53
- version: t(b.version),
54
- tags: S,
55
- visibility: b.visibility,
56
- sortOrder: typeof b.sortOrder == "string" ? parseInt(b.sortOrder, 10) || 0 : b.sortOrder
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 m(v ? n : {
81
+ await v(S ? n : {
59
82
  ...n,
60
- productId: b.productId,
61
- slug: b.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__ */ u("div", {
89
+ /* @__PURE__ */ m("div", {
67
90
  className: "space-y-4",
68
91
  children: [
69
- /* @__PURE__ */ l("h3", {
92
+ /* @__PURE__ */ p("h3", {
70
93
  className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
71
- children: _("pressKit.basicInformation", "Basic Information")
94
+ children: x("pressKit.basicInformation", "Basic Information")
72
95
  }),
73
- !v && /* @__PURE__ */ u("div", { children: [
74
- /* @__PURE__ */ u("label", {
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
- _("pressKit.fieldProduct", "Product"),
101
+ x("pressKit.fieldProduct", "Product"),
79
102
  " ",
80
- /* @__PURE__ */ l("span", {
103
+ /* @__PURE__ */ p("span", {
81
104
  className: "text-[var(--color-status-error)]",
82
105
  children: "*"
83
106
  })
84
107
  ]
85
108
  }),
86
- /* @__PURE__ */ u("select", {
109
+ /* @__PURE__ */ m("select", {
87
110
  id: "productId",
88
- value: b.productId,
89
- onChange: (e) => x({
90
- ...b,
111
+ value: w.productId,
112
+ onChange: (e) => T({
113
+ ...w,
91
114
  productId: e.target.value
92
115
  }),
93
- className: d,
94
- disabled: g,
116
+ className: h,
117
+ disabled: b,
95
118
  required: !0,
96
- children: [/* @__PURE__ */ l("option", {
119
+ children: [/* @__PURE__ */ p("option", {
97
120
  value: "",
98
- children: _("pressKit.selectProduct", "Select a product…")
99
- }), y.map((e) => /* @__PURE__ */ u("option", {
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
- w.productId && /* @__PURE__ */ l("p", {
132
+ O.productId && /* @__PURE__ */ p("p", {
110
133
  className: "text-sm text-[var(--color-status-error)] mt-1",
111
- children: w.productId
134
+ children: O.productId
112
135
  })
113
136
  ] }),
114
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("label", {
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
- _("pressKit.fieldCategory", "Category"),
141
+ x("pressKit.fieldCategory", "Category"),
119
142
  " ",
120
- /* @__PURE__ */ l("span", {
143
+ /* @__PURE__ */ p("span", {
121
144
  className: "text-[var(--color-status-error)]",
122
145
  children: "*"
123
146
  })
124
147
  ]
125
- }), /* @__PURE__ */ l("select", {
148
+ }), /* @__PURE__ */ p("select", {
126
149
  id: "category",
127
- value: b.category,
128
- onChange: (e) => x({
129
- ...b,
150
+ value: w.category,
151
+ onChange: (e) => T({
152
+ ...w,
130
153
  category: e.target.value
131
154
  }),
132
- className: d,
133
- disabled: g,
134
- children: i.map((e) => /* @__PURE__ */ l("option", {
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__ */ u("div", { children: [
140
- /* @__PURE__ */ u("label", {
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
- _("pressKit.fieldTitle", "Title"),
167
+ x("pressKit.fieldTitle", "Title"),
145
168
  " ",
146
- /* @__PURE__ */ l("span", {
169
+ /* @__PURE__ */ p("span", {
147
170
  className: "text-[var(--color-status-error)]",
148
171
  children: "*"
149
172
  })
150
173
  ]
151
174
  }),
152
- /* @__PURE__ */ l("input", {
175
+ /* @__PURE__ */ p("input", {
153
176
  id: "title",
154
177
  type: "text",
155
- value: b.title,
178
+ value: w.title,
156
179
  onChange: (e) => {
157
180
  let t = e.target.value;
158
- x((e) => ({
181
+ T((e) => ({
159
182
  ...e,
160
183
  title: t,
161
- slug: !v && (!e.slug || e.slug === p(e.title)) ? p(t) : e.slug
184
+ slug: !S && (!e.slug || e.slug === _(e.title)) ? _(t) : e.slug
162
185
  }));
163
186
  },
164
- className: d,
165
- placeholder: _("pressKit.titlePlaceholder", "e.g. Logo — Dark"),
166
- disabled: g,
187
+ className: h,
188
+ placeholder: x("pressKit.titlePlaceholder", "e.g. Logo — Dark"),
189
+ disabled: b,
167
190
  required: !0
168
191
  }),
169
- w.title && /* @__PURE__ */ l("p", {
192
+ O.title && /* @__PURE__ */ p("p", {
170
193
  className: "text-sm text-[var(--color-status-error)] mt-1",
171
- children: w.title
194
+ children: O.title
172
195
  })
173
196
  ] }),
174
- /* @__PURE__ */ u("div", { children: [
175
- /* @__PURE__ */ u("label", {
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
- _("pressKit.fieldSlug", "Slug"),
202
+ x("pressKit.fieldSlug", "Slug"),
180
203
  " ",
181
- /* @__PURE__ */ l("span", {
204
+ /* @__PURE__ */ p("span", {
182
205
  className: "text-[var(--color-status-error)]",
183
206
  children: "*"
184
207
  })
185
208
  ]
186
209
  }),
187
- /* @__PURE__ */ l("input", {
210
+ /* @__PURE__ */ p("input", {
188
211
  id: "slug",
189
212
  type: "text",
190
- value: b.slug,
191
- onChange: (e) => x({
192
- ...b,
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: d,
218
+ className: h,
196
219
  placeholder: "logo-dark",
197
- disabled: g || v,
198
- required: !v
220
+ disabled: b || S,
221
+ required: !S
199
222
  }),
200
- /* @__PURE__ */ l("p", {
223
+ /* @__PURE__ */ p("p", {
201
224
  className: "text-xs text-text-tertiary mt-1",
202
- children: _("pressKit.slugHint", "Lowercase, numbers, hyphens. Cannot change after creation.")
225
+ children: x("pressKit.slugHint", "Lowercase, numbers, hyphens. Cannot change after creation.")
203
226
  }),
204
- w.slug && /* @__PURE__ */ l("p", {
227
+ O.slug && /* @__PURE__ */ p("p", {
205
228
  className: "text-sm text-[var(--color-status-error)] mt-1",
206
- children: w.slug
229
+ children: O.slug
207
230
  })
208
231
  ] }),
209
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
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: _("pressKit.fieldDescription", "Description")
213
- }), /* @__PURE__ */ l("textarea", {
235
+ children: x("pressKit.fieldDescription", "Description")
236
+ }), /* @__PURE__ */ p("textarea", {
214
237
  id: "description",
215
- value: b.description,
216
- onChange: (e) => x({
217
- ...b,
238
+ value: w.description,
239
+ onChange: (e) => T({
240
+ ...w,
218
241
  description: e.target.value
219
242
  }),
220
243
  rows: 3,
221
- className: d,
222
- placeholder: _("pressKit.descriptionPlaceholder", "Short description / usage notes"),
223
- disabled: g
244
+ className: h,
245
+ placeholder: x("pressKit.descriptionPlaceholder", "Short description / usage notes"),
246
+ disabled: b
224
247
  })] })
225
248
  ]
226
249
  }),
227
- /* @__PURE__ */ u("div", {
250
+ /* @__PURE__ */ m("div", {
228
251
  className: "space-y-4 pt-4 border-t border-default",
229
252
  children: [
230
- /* @__PURE__ */ l("h3", {
253
+ /* @__PURE__ */ p("h3", {
231
254
  className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
232
- children: _("pressKit.fileSection", "File")
255
+ children: x("pressKit.fileSection", "File")
233
256
  }),
234
- /* @__PURE__ */ l("p", {
257
+ /* @__PURE__ */ p("p", {
235
258
  className: "text-xs text-text-tertiary",
236
- children: _("pressKit.fileUrlHint", "Paste the public CDN/file URL. (In-app upload coming in a later phase.)")
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__ */ u("div", { children: [
239
- /* @__PURE__ */ u("label", {
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
- _("pressKit.fieldFileUrl", "File URL"),
306
+ x("pressKit.fieldFileUrl", "File URL"),
244
307
  " ",
245
- /* @__PURE__ */ l("span", {
308
+ /* @__PURE__ */ p("span", {
246
309
  className: "text-[var(--color-status-error)]",
247
310
  children: "*"
248
311
  })
249
312
  ]
250
313
  }),
251
- /* @__PURE__ */ l("input", {
314
+ /* @__PURE__ */ p("input", {
252
315
  id: "fileUrl",
253
316
  type: "url",
254
- value: b.fileUrl,
255
- onChange: (e) => x({
256
- ...b,
317
+ value: w.fileUrl,
318
+ onChange: (e) => T({
319
+ ...w,
257
320
  fileUrl: e.target.value
258
321
  }),
259
- className: d,
322
+ className: h,
260
323
  placeholder: "https://cdn.example.com/press/logo-dark.svg",
261
- disabled: g,
324
+ disabled: b,
262
325
  required: !0
263
326
  }),
264
- w.fileUrl && /* @__PURE__ */ l("p", {
327
+ O.fileUrl && /* @__PURE__ */ p("p", {
265
328
  className: "text-sm text-[var(--color-status-error)] mt-1",
266
- children: w.fileUrl
329
+ children: O.fileUrl
267
330
  })
268
331
  ] }),
269
- /* @__PURE__ */ u("div", {
332
+ /* @__PURE__ */ m("div", {
270
333
  className: "grid grid-cols-2 gap-4",
271
- children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
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: _("pressKit.fieldFileName", "File Name")
275
- }), /* @__PURE__ */ l("input", {
337
+ children: x("pressKit.fieldFileName", "File Name")
338
+ }), /* @__PURE__ */ p("input", {
276
339
  id: "fileName",
277
340
  type: "text",
278
- value: b.fileName,
279
- onChange: (e) => x({
280
- ...b,
341
+ value: w.fileName,
342
+ onChange: (e) => T({
343
+ ...w,
281
344
  fileName: e.target.value
282
345
  }),
283
- className: d,
346
+ className: h,
284
347
  placeholder: "logo-dark.svg",
285
- disabled: g
286
- })] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
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: _("pressKit.fieldMimeType", "MIME Type")
290
- }), /* @__PURE__ */ l("input", {
352
+ children: x("pressKit.fieldMimeType", "MIME Type")
353
+ }), /* @__PURE__ */ p("input", {
291
354
  id: "mimeType",
292
355
  type: "text",
293
- value: b.mimeType,
294
- onChange: (e) => x({
295
- ...b,
356
+ value: w.mimeType,
357
+ onChange: (e) => T({
358
+ ...w,
296
359
  mimeType: e.target.value
297
360
  }),
298
- className: d,
361
+ className: h,
299
362
  placeholder: "image/svg+xml",
300
- disabled: g
363
+ disabled: b
301
364
  })] })]
302
365
  }),
303
- /* @__PURE__ */ u("div", {
366
+ /* @__PURE__ */ m("div", {
304
367
  className: "grid grid-cols-2 gap-4",
305
- children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
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: _("pressKit.fieldFileSize", "File Size (bytes)")
309
- }), /* @__PURE__ */ l("input", {
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: b.fileSize ?? "",
376
+ value: w.fileSize ?? "",
314
377
  onChange: (e) => {
315
378
  let t = e.target.value, n = parseInt(t, 10);
316
- x({
317
- ...b,
379
+ T({
380
+ ...w,
318
381
  fileSize: t === "" || Number.isNaN(n) ? null : n
319
382
  });
320
383
  },
321
- className: d,
322
- disabled: g
323
- })] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
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: _("pressKit.fieldVersion", "Version")
327
- }), /* @__PURE__ */ l("input", {
389
+ children: x("pressKit.fieldVersion", "Version")
390
+ }), /* @__PURE__ */ p("input", {
328
391
  id: "version",
329
392
  type: "text",
330
- value: b.version,
331
- onChange: (e) => x({
332
- ...b,
393
+ value: w.version,
394
+ onChange: (e) => T({
395
+ ...w,
333
396
  version: e.target.value
334
397
  }),
335
- className: d,
398
+ className: h,
336
399
  placeholder: "v2",
337
- disabled: g
400
+ disabled: b
338
401
  })] })]
339
402
  }),
340
- /* @__PURE__ */ u("div", { children: [
341
- /* @__PURE__ */ l("label", {
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: _("pressKit.fieldThumbnail", "Thumbnail / Preview URL")
407
+ children: x("pressKit.fieldThumbnail", "Thumbnail / Preview URL")
345
408
  }),
346
- /* @__PURE__ */ l("input", {
409
+ /* @__PURE__ */ p("input", {
347
410
  id: "thumbnailUrl",
348
411
  type: "url",
349
- value: b.thumbnailUrl,
350
- onChange: (e) => x({
351
- ...b,
412
+ value: w.thumbnailUrl,
413
+ onChange: (e) => T({
414
+ ...w,
352
415
  thumbnailUrl: e.target.value
353
416
  }),
354
- className: d,
417
+ className: h,
355
418
  placeholder: "https://cdn.example.com/press/logo-dark-preview.png",
356
- disabled: g
419
+ disabled: b
357
420
  }),
358
- b.thumbnailUrl && /* @__PURE__ */ l("div", {
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__ */ l("img", {
362
- src: b.thumbnailUrl,
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__ */ u("div", {
433
+ /* @__PURE__ */ m("div", {
371
434
  className: "space-y-4 pt-4 border-t border-default",
372
- children: [/* @__PURE__ */ l("h3", {
435
+ children: [/* @__PURE__ */ p("h3", {
373
436
  className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
374
- children: _("pressKit.publishing", "Publishing")
375
- }), /* @__PURE__ */ u("div", {
437
+ children: x("pressKit.publishing", "Publishing")
438
+ }), /* @__PURE__ */ m("div", {
376
439
  className: "grid grid-cols-2 gap-4",
377
- children: [/* @__PURE__ */ u("div", { children: [
378
- /* @__PURE__ */ l("label", {
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: _("pressKit.fieldVisibility", "Visibility")
444
+ children: x("pressKit.fieldVisibility", "Visibility")
382
445
  }),
383
- /* @__PURE__ */ u("select", {
446
+ /* @__PURE__ */ m("select", {
384
447
  id: "visibility",
385
- value: b.visibility,
386
- onChange: (e) => x({
387
- ...b,
448
+ value: w.visibility,
449
+ onChange: (e) => T({
450
+ ...w,
388
451
  visibility: e.target.value
389
452
  }),
390
- className: d,
391
- disabled: g,
453
+ className: h,
454
+ disabled: b,
392
455
  children: [
393
- /* @__PURE__ */ l("option", {
456
+ /* @__PURE__ */ p("option", {
394
457
  value: "PUBLIC",
395
- children: _("pressKit.visPublic", "Public — everyone")
458
+ children: x("pressKit.visPublic", "Public — everyone")
396
459
  }),
397
- /* @__PURE__ */ l("option", {
460
+ /* @__PURE__ */ p("option", {
398
461
  value: "AUTHENTICATED",
399
- children: _("pressKit.visAuth", "Authenticated — signed-in")
462
+ children: x("pressKit.visAuth", "Authenticated — signed-in")
400
463
  }),
401
- /* @__PURE__ */ l("option", {
464
+ /* @__PURE__ */ p("option", {
402
465
  value: "INTERNAL",
403
- children: _("pressKit.visInternal", "Internal — staff")
466
+ children: x("pressKit.visInternal", "Internal — staff")
404
467
  })
405
468
  ]
406
469
  }),
407
- /* @__PURE__ */ l("p", {
470
+ /* @__PURE__ */ p("p", {
408
471
  className: "text-xs text-text-tertiary mt-1",
409
- children: _("pressKit.visHint", "Public is required to show on the website press page.")
472
+ children: x("pressKit.visHint", "Public is required to show on the website press page.")
410
473
  })
411
- ] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
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: _("pressKit.fieldSortOrder", "Sort Order")
415
- }), /* @__PURE__ */ l("input", {
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: b.sortOrder,
420
- onChange: (e) => x({
421
- ...b,
482
+ value: w.sortOrder,
483
+ onChange: (e) => T({
484
+ ...w,
422
485
  sortOrder: parseInt(e.target.value, 10) || 0
423
486
  }),
424
- className: d,
425
- disabled: g
487
+ className: h,
488
+ disabled: b
426
489
  })] })]
427
490
  })]
428
491
  }),
429
- /* @__PURE__ */ u("div", {
492
+ /* @__PURE__ */ m("div", {
430
493
  className: "space-y-4 pt-4 border-t border-default",
431
- children: [/* @__PURE__ */ l("h3", {
494
+ children: [/* @__PURE__ */ p("h3", {
432
495
  className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
433
- children: _("pressKit.tags", "Tags")
434
- }), /* @__PURE__ */ l(r, {
435
- value: S,
436
- onChange: C,
437
- disabled: g
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__ */ u("div", {
503
+ /* @__PURE__ */ m("div", {
441
504
  className: "flex gap-3 pt-4 border-t border-default",
442
- children: [/* @__PURE__ */ u("button", {
505
+ children: [/* @__PURE__ */ m("button", {
443
506
  type: "submit",
444
- disabled: g,
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: [g && /* @__PURE__ */ l(c, {
509
+ children: [b && /* @__PURE__ */ p(u, {
447
510
  size: 16,
448
511
  className: "animate-spin"
449
- }), v ? _("pressKit.updateAsset", "Update Asset") : _("pressKit.createAsset", "Create Asset")]
450
- }), /* @__PURE__ */ l("button", {
512
+ }), S ? x("pressKit.updateAsset", "Update Asset") : x("pressKit.createAsset", "Create Asset")]
513
+ }), /* @__PURE__ */ p("button", {
451
514
  type: "button",
452
- onClick: h,
453
- disabled: g,
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: _("productCommon.cancel", "Cancel")
518
+ children: x("productCommon.cancel", "Cancel")
456
519
  })]
457
520
  })
458
521
  ]
459
522
  });
460
523
  }
461
- function p(e) {
524
+ function _(e) {
462
525
  return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
463
526
  }
464
527
  //#endregion
465
- export { f as PressKitAssetForm };
528
+ export { g as PressKitAssetForm };
466
529
 
467
530
  //# sourceMappingURL=PressKitAssetForm.js.map