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