@burdenoff/microfe-devportal 2026.616.1 → 2026.622.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.
@@ -1,388 +1,462 @@
1
- import { EmptyState as e } from "../components/EmptyState.js";
2
- import { useCreateApplicationVersionMutation as t, useDeprecateApplicationVersionMutation as n, useGetApplicationQuery as r, useGetApplicationVersionsQuery as ee, usePublishApplicationVersionMutation as te } from "../../generated/global-operations.js";
1
+ import { useDevportal as e } from "../providers/DevportalProvider.js";
2
+ import { EmptyState as t } from "../components/EmptyState.js";
3
+ import { useCreateApplicationVersionMutation as n, useDeprecateApplicationVersionMutation as r, useGetApplicationQuery as ee, useGetApplicationVersionsQuery as te, usePublishApplicationVersionMutation as ne } from "../../generated/global-operations.js";
3
4
  import { PageLayout as i } from "../components/PageLayout.js";
4
- import { StatusBadge as a } from "../components/StatusBadge.js";
5
- import { SelectionCheckbox as o } from "../components/SelectionCheckbox.js";
6
- import { DataTable as ne } from "../components/DataTable.js";
7
- import { InputField as re, TextareaField as s } from "../components/FormField.js";
8
- import { ConfirmDialog as c } from "../components/ConfirmDialog.js";
9
- import { PermissionGuard as ie } from "../components/PermissionGuard.js";
5
+ import { StatusBadge as re } from "../components/StatusBadge.js";
6
+ import { SelectionCheckbox as a } from "../components/SelectionCheckbox.js";
7
+ import { DataTable as ie } from "../components/DataTable.js";
8
+ import { InputField as ae, TextareaField as oe } from "../components/FormField.js";
9
+ import { ConfirmDialog as o } from "../components/ConfirmDialog.js";
10
+ import { PermissionGuard as se } from "../components/PermissionGuard.js";
10
11
  import "../components/index.js";
11
- import { DEVPORTAL_PERMISSIONS as l } from "../constants/permissions.js";
12
- import { useDevportalPermission as u } from "../hooks/usePermission.js";
12
+ import { DEVPORTAL_PERMISSIONS as s } from "../constants/permissions.js";
13
+ import { useDevportalPermission as c } from "../hooks/usePermission.js";
13
14
  import "../hooks/index.js";
14
- import ae from "../../node_modules/date-fns/format.js";
15
- import { useEffect as oe, useMemo as d, useState as f } from "react";
16
- import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
- import { AlertCircle as m, Archive as se, CheckCircle as h, Clock as ce, Loader2 as g, Package as _, Plus as v } from "lucide-react";
18
- import { useParams as le } from "react-router-dom";
19
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
15
+ import ce from "../../node_modules/date-fns/format.js";
16
+ import { usePackageUpload as le } from "../hooks/usePackageUpload.js";
17
+ import { useCallback as ue, useEffect as de, useMemo as l, useRef as fe, useState as u } from "react";
18
+ import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
+ import { AlertCircle as d, Archive as me, CheckCircle as f, Clock as he, Loader2 as p, Package as m, Plus as h, Upload as ge } from "lucide-react";
20
+ import { useParams as _e } from "react-router-dom";
21
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
20
22
  //#region src/devportal/pages/ApplicationVersionsPage.tsx
21
- var x = () => {
22
- let { t: x } = p(), S = (e, t) => {
23
- let n = x(e);
23
+ var y = () => {
24
+ let { t: y } = pe(), b = (e, t) => {
25
+ let n = y(e);
24
26
  return n === e ? t : n;
25
- }, { allowed: C } = u(l.APP_VERSION_CREATE), { allowed: w } = u(l.APP_VERSION_PUBLISH), { allowed: T } = u(l.APP_VERSION_DEPRECATE), { appId: E } = le(), [D, O] = f(!1), [k, A] = f({
27
+ }, { allowed: x } = c(s.APP_VERSION_CREATE), { allowed: S } = c(s.APP_VERSION_PUBLISH), { allowed: C } = c(s.APP_VERSION_DEPRECATE), { appId: w } = _e(), { workspacesGatewayUrl: ve, authToken: ye, workspaceId: be, getWorkspaceToken: xe } = e(), { upload: T, uploading: E, progress: Se, error: D } = le(ve, ye, be, xe), O = fe(null), [k, A] = u(!1), [j, M] = u({
26
28
  version: "",
27
29
  releaseNotes: "",
28
- changelog: ""
29
- }), [j, M] = f(null), [N, P] = f(null), [F, I] = f(/* @__PURE__ */ new Set()), [L, R] = f(null), { data: z } = r({
30
- variables: { id: E ?? "" },
31
- skip: !E,
30
+ changelog: "",
31
+ packageUrl: "",
32
+ packageSize: ""
33
+ }), [N, P] = u(null), [F, I] = u(null), [L, R] = u(/* @__PURE__ */ new Set()), [z, B] = u(null), { data: V } = ee({
34
+ variables: { id: w ?? "" },
35
+ skip: !w,
32
36
  fetchPolicy: "cache-first"
33
37
  });
34
- oe(() => {
35
- let e = z?.application?.name;
36
- if (!E || !e) return;
38
+ de(() => {
39
+ let e = V?.application?.name;
40
+ if (!w || !e) return;
37
41
  let t = window.__breadcrumbRegistry;
38
- return t?.register(E, e), () => t?.unregister(E);
39
- }, [E, z?.application?.name]);
40
- let { data: B, loading: V, error: H } = ee({
41
- variables: { applicationId: E },
42
- skip: !E,
42
+ return t?.register(w, e), () => t?.unregister(w);
43
+ }, [w, V?.application?.name]);
44
+ let { data: H, loading: Ce, error: U } = te({
45
+ variables: { applicationId: w },
46
+ skip: !w,
43
47
  fetchPolicy: "cache-and-network"
44
- }), [U, { loading: ue }] = t({ refetchQueries: ["GetApplicationVersions"] }), [W] = te({ refetchQueries: ["GetApplicationVersions"] }), [G] = n({ refetchQueries: ["GetApplicationVersions"] }), K = d(() => B?.application?.versions?.edges?.map((e) => e.node) ?? [], [B?.application?.versions]), q = d(() => K.filter((e) => F.has(e.id)), [K, F]), J = d(() => q.filter((e) => e.status === "DRAFT"), [q]), Y = d(() => q.filter((e) => e.status === "PUBLISHED" && !e.isLatest), [q]), X = K.length > 0 && K.every((e) => F.has(e.id)), Z = K.some((e) => F.has(e.id)) && !X, de = async () => {
45
- if (!(!E || !k.version.trim())) {
46
- M(null);
48
+ }), [we, { loading: Te }] = n({ refetchQueries: ["GetApplicationVersions"] }), [W] = ne({ refetchQueries: ["GetApplicationVersions"] }), [G] = r({ refetchQueries: ["GetApplicationVersions"] }), K = l(() => H?.application?.versions?.edges?.map((e) => e.node) ?? [], [H?.application?.versions]), q = l(() => K.filter((e) => L.has(e.id)), [K, L]), J = l(() => q.filter((e) => e.status?.toUpperCase() === "DRAFT"), [q]), Y = l(() => q.filter((e) => e.status?.toUpperCase() === "PUBLISHED" && !e.isLatest), [q]), X = K.length > 0 && K.every((e) => L.has(e.id)), Z = K.some((e) => L.has(e.id)) && !X, Ee = async () => {
49
+ if (!(!w || !j.version.trim())) {
50
+ P(null);
47
51
  try {
48
- await U({ variables: {
49
- applicationId: E,
52
+ await we({ variables: {
53
+ applicationId: w,
50
54
  input: {
51
- version: k.version,
52
- releaseNotes: k.releaseNotes || void 0,
53
- changelog: k.changelog || void 0
55
+ version: j.version,
56
+ releaseNotes: j.releaseNotes || void 0,
57
+ changelog: j.changelog || void 0,
58
+ packageUrl: j.packageUrl || void 0,
59
+ packageSize: j.packageSize || void 0
54
60
  }
55
- } }), O(!1), A({
61
+ } }), A(!1), M({
56
62
  version: "",
57
63
  releaseNotes: "",
58
- changelog: ""
59
- }), P(S("devportal.versionCreatedSuccess", "Version created successfully"));
64
+ changelog: "",
65
+ packageUrl: "",
66
+ packageSize: ""
67
+ }), I(b("devportal.versionCreatedSuccess", "Version created successfully"));
60
68
  } catch (e) {
61
- M(e instanceof Error ? e.message : S("devportal.versionCreateFailed", "Failed to create version"));
69
+ P(e instanceof Error ? e.message : b("devportal.versionCreateFailed", "Failed to create version"));
62
70
  }
63
71
  }
64
- }, fe = async (e) => {
65
- M(null), P(null);
72
+ }, De = ue(async (e) => {
73
+ let t = e.target.files?.[0];
74
+ if (t) {
75
+ e.target.value = "";
76
+ try {
77
+ let e = await T(t);
78
+ M((n) => ({
79
+ ...n,
80
+ packageUrl: e.downloadUrl,
81
+ packageSize: String(t.size)
82
+ }));
83
+ } catch {}
84
+ }
85
+ }, [T]), Oe = async (e) => {
86
+ P(null), I(null);
66
87
  try {
67
- await W({ variables: { id: e } }), P(S("devportal.versionPublishedSuccess", "Version published successfully"));
88
+ await W({ variables: { id: e } }), I(b("devportal.versionPublishedSuccess", "Version published successfully"));
68
89
  } catch (e) {
69
- M(e instanceof Error ? e.message : S("devportal.versionPublishFailed", "Failed to publish version"));
90
+ P(e instanceof Error ? e.message : b("devportal.versionPublishFailed", "Failed to publish version"));
70
91
  }
71
- }, pe = async (e) => {
72
- M(null), P(null);
92
+ }, ke = async (e) => {
93
+ P(null), I(null);
73
94
  try {
74
- await G({ variables: { id: e } }), P(S("devportal.versionDeprecatedSuccess", "Version deprecated successfully"));
95
+ await G({ variables: { id: e } }), I(b("devportal.versionDeprecatedSuccess", "Version deprecated successfully"));
75
96
  } catch (e) {
76
- M(e instanceof Error ? e.message : S("devportal.versionDeprecateFailed", "Failed to deprecate version"));
97
+ P(e instanceof Error ? e.message : b("devportal.versionDeprecateFailed", "Failed to deprecate version"));
77
98
  }
78
- }, me = (e) => e.status === "PUBLISHED" && e.isLatest ? /* @__PURE__ */ y(h, {
79
- size: 16,
80
- className: "text-status-success-text"
81
- }) : e.status === "DRAFT" ? /* @__PURE__ */ y(ce, {
82
- size: 16,
83
- className: "text-status-warning-text"
84
- }) : e.status === "DEPRECATED" ? /* @__PURE__ */ y(se, {
85
- size: 16,
86
- className: "text-text-secondary"
87
- }) : /* @__PURE__ */ y(_, {
88
- size: 16,
89
- className: "text-accent-blue"
90
- }), he = (e, t) => {
91
- I((n) => {
99
+ }, Ae = (e) => {
100
+ let t = e.status?.toUpperCase();
101
+ return t === "PUBLISHED" && e.isLatest ? /* @__PURE__ */ _(f, {
102
+ size: 16,
103
+ className: "text-status-success-text"
104
+ }) : t === "DRAFT" ? /* @__PURE__ */ _(he, {
105
+ size: 16,
106
+ className: "text-status-warning-text"
107
+ }) : t === "DEPRECATED" ? /* @__PURE__ */ _(me, {
108
+ size: 16,
109
+ className: "text-text-secondary"
110
+ }) : /* @__PURE__ */ _(m, {
111
+ size: 16,
112
+ className: "text-accent-blue"
113
+ });
114
+ }, je = (e, t) => {
115
+ R((n) => {
92
116
  let r = new Set(n);
93
117
  return t ? r.add(e) : r.delete(e), r;
94
118
  });
95
119
  }, Q = (e) => {
96
- I((t) => {
120
+ R((t) => {
97
121
  let n = new Set(t);
98
122
  return K.forEach((t) => {
99
123
  e ? n.add(t.id) : n.delete(t.id);
100
124
  }), n;
101
125
  });
102
- }, $ = () => I(/* @__PURE__ */ new Set());
103
- return V && !B ? /* @__PURE__ */ y(i, {
104
- title: S("devportal.versionManagement", "Version Management"),
105
- description: S("devportal.versionManagementDescription", "Manage your application versions"),
106
- backLink: `/apps/${E}`,
107
- backLabel: S("devportal.backToApplication", "Back to Application"),
108
- children: /* @__PURE__ */ y("div", {
126
+ }, $ = () => R(/* @__PURE__ */ new Set());
127
+ return Ce && !H ? /* @__PURE__ */ _(i, {
128
+ title: b("devportal.versionManagement", "Version Management"),
129
+ description: b("devportal.versionManagementDescription", "Manage your application versions"),
130
+ backLink: `/apps/${w}`,
131
+ backLabel: b("devportal.backToApplication", "Back to Application"),
132
+ children: /* @__PURE__ */ _("div", {
109
133
  className: "flex items-center justify-center py-16",
110
- children: /* @__PURE__ */ y(g, { className: "h-8 w-8 animate-spin text-muted-foreground" })
134
+ children: /* @__PURE__ */ _(p, { className: "h-8 w-8 animate-spin text-muted-foreground" })
111
135
  })
112
- }) : H && !B ? /* @__PURE__ */ y(i, {
113
- title: S("devportal.versionManagement", "Version Management"),
114
- description: S("devportal.versionManagementDescription", "Manage your application versions"),
115
- backLink: `/apps/${E}`,
116
- backLabel: S("devportal.backToApplication", "Back to Application"),
117
- children: /* @__PURE__ */ y(e, {
118
- icon: /* @__PURE__ */ y(m, {
136
+ }) : U && !H ? /* @__PURE__ */ _(i, {
137
+ title: b("devportal.versionManagement", "Version Management"),
138
+ description: b("devportal.versionManagementDescription", "Manage your application versions"),
139
+ backLink: `/apps/${w}`,
140
+ backLabel: b("devportal.backToApplication", "Back to Application"),
141
+ children: /* @__PURE__ */ _(t, {
142
+ icon: /* @__PURE__ */ _(d, {
119
143
  size: 32,
120
144
  className: "text-status-error-text"
121
145
  }),
122
- title: S("devportal.failedToLoadVersions", "Failed to load versions"),
123
- description: H.message || S("devportal.versionsLoadError", "An error occurred while loading versions")
146
+ title: b("devportal.failedToLoadVersions", "Failed to load versions"),
147
+ description: U.message || b("devportal.versionsLoadError", "An error occurred while loading versions")
124
148
  })
125
- }) : /* @__PURE__ */ y(ie, {
126
- permission: l.APP_READ,
127
- children: /* @__PURE__ */ b(i, {
128
- title: S("devportal.versionManagement", "Version Management"),
129
- description: S("devportal.versionManagementDescription", "Manage your application versions"),
130
- backLink: `/apps/${E}`,
131
- backLabel: S("devportal.backToApplication", "Back to Application"),
132
- actions: /* @__PURE__ */ b("button", {
133
- onClick: () => O(!0),
134
- disabled: !C,
135
- "aria-disabled": !C,
149
+ }) : /* @__PURE__ */ _(se, {
150
+ permission: s.APP_READ,
151
+ children: /* @__PURE__ */ v(i, {
152
+ title: b("devportal.versionManagement", "Version Management"),
153
+ description: b("devportal.versionManagementDescription", "Manage your application versions"),
154
+ backLink: `/apps/${w}`,
155
+ backLabel: b("devportal.backToApplication", "Back to Application"),
156
+ actions: /* @__PURE__ */ v("button", {
157
+ onClick: () => A(!0),
158
+ disabled: !x,
159
+ "aria-disabled": !x,
136
160
  className: "inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
137
- children: [/* @__PURE__ */ y(v, { size: 16 }), S("devportal.newVersion", "New Version")]
161
+ children: [/* @__PURE__ */ _(h, { size: 16 }), b("devportal.newVersion", "New Version")]
138
162
  }),
139
163
  children: [
140
- j && /* @__PURE__ */ b("div", {
164
+ N && /* @__PURE__ */ v("div", {
141
165
  className: "rounded-lg border border-border-subtle bg-status-error-bg-subtle p-3 flex items-center gap-2 text-sm text-status-error-text",
142
166
  children: [
143
- /* @__PURE__ */ y(m, {
167
+ /* @__PURE__ */ _(d, {
144
168
  size: 16,
145
169
  className: "flex-shrink-0"
146
170
  }),
147
- j,
148
- /* @__PURE__ */ y("button", {
149
- onClick: () => M(null),
171
+ N,
172
+ /* @__PURE__ */ _("button", {
173
+ onClick: () => P(null),
150
174
  className: "ml-auto text-status-error-text hover:text-status-error-text",
151
- children: S("devportal.dismiss", "Dismiss")
175
+ children: b("devportal.dismiss", "Dismiss")
152
176
  })
153
177
  ]
154
178
  }),
155
- N && /* @__PURE__ */ b("div", {
179
+ F && /* @__PURE__ */ v("div", {
156
180
  className: "rounded-lg border border-border-subtle bg-status-success-bg-subtle p-3 flex items-center gap-2 text-sm text-status-success-text",
157
181
  children: [
158
- /* @__PURE__ */ y(h, {
182
+ /* @__PURE__ */ _(f, {
159
183
  size: 16,
160
184
  className: "flex-shrink-0"
161
185
  }),
162
- N,
163
- /* @__PURE__ */ y("button", {
164
- onClick: () => P(null),
186
+ F,
187
+ /* @__PURE__ */ _("button", {
188
+ onClick: () => I(null),
165
189
  className: "ml-auto text-status-success-text hover:text-status-success-text",
166
- children: S("devportal.dismiss", "Dismiss")
190
+ children: b("devportal.dismiss", "Dismiss")
167
191
  })
168
192
  ]
169
193
  }),
170
- K.length > 0 && /* @__PURE__ */ y("div", {
194
+ K.length > 0 && /* @__PURE__ */ _("div", {
171
195
  className: "rounded-lg border bg-card p-4",
172
- children: /* @__PURE__ */ b("div", {
196
+ children: /* @__PURE__ */ v("div", {
173
197
  className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
174
- children: [/* @__PURE__ */ b("div", {
198
+ children: [/* @__PURE__ */ v("div", {
175
199
  className: "flex flex-wrap items-center gap-3",
176
- children: [/* @__PURE__ */ b("div", {
200
+ children: [/* @__PURE__ */ v("div", {
177
201
  className: "flex items-center gap-2",
178
- children: [/* @__PURE__ */ y(o, {
202
+ children: [/* @__PURE__ */ _(a, {
179
203
  checked: X,
180
204
  indeterminate: Z,
181
205
  onChange: Q,
182
206
  ariaLabel: "Select all visible versions"
183
- }), /* @__PURE__ */ y("span", {
207
+ }), /* @__PURE__ */ _("span", {
184
208
  className: "text-sm font-medium",
185
- children: S("devportal.selectAllVisible", "Select all visible")
209
+ children: b("devportal.selectAllVisible", "Select all visible")
186
210
  })]
187
- }), F.size > 0 && /* @__PURE__ */ y("button", {
211
+ }), L.size > 0 && /* @__PURE__ */ _("button", {
188
212
  onClick: $,
189
213
  className: "text-sm text-muted-foreground hover:text-foreground",
190
- children: S("devportal.clearSelection", "Clear selection")
214
+ children: b("devportal.clearSelection", "Clear selection")
191
215
  })]
192
- }), /* @__PURE__ */ b("div", {
216
+ }), /* @__PURE__ */ v("div", {
193
217
  className: "flex flex-wrap items-center gap-2",
194
218
  children: [
195
- /* @__PURE__ */ b("span", {
219
+ /* @__PURE__ */ v("span", {
196
220
  className: "rounded-full bg-muted px-3 py-1 text-sm font-medium text-muted-foreground",
197
- children: [F.size, " selected"]
221
+ children: [L.size, " selected"]
198
222
  }),
199
- /* @__PURE__ */ b("button", {
200
- onClick: () => R("publish"),
201
- disabled: J.length === 0 || !w,
202
- "aria-disabled": !w,
223
+ /* @__PURE__ */ v("button", {
224
+ onClick: () => B("publish"),
225
+ disabled: J.length === 0 || !S,
226
+ "aria-disabled": !S,
203
227
  className: "rounded-md border border-status-success-bg px-3 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
204
- children: [S("devportal.publishSelected", "Publish Selected"), J.length > 0 ? ` (${J.length})` : ""]
228
+ children: [b("devportal.publishSelected", "Publish Selected"), J.length > 0 ? ` (${J.length})` : ""]
205
229
  }),
206
- /* @__PURE__ */ b("button", {
207
- onClick: () => R("deprecate"),
208
- disabled: Y.length === 0 || !T,
209
- "aria-disabled": !T,
230
+ /* @__PURE__ */ v("button", {
231
+ onClick: () => B("deprecate"),
232
+ disabled: Y.length === 0 || !C,
233
+ "aria-disabled": !C,
210
234
  className: "rounded-md border border-status-warning-bg px-3 py-2 text-sm font-medium text-status-warning-text hover:bg-status-warning-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
211
- children: [S("devportal.deprecateSelected", "Deprecate Selected"), Y.length > 0 ? ` (${Y.length})` : ""]
235
+ children: [b("devportal.deprecateSelected", "Deprecate Selected"), Y.length > 0 ? ` (${Y.length})` : ""]
212
236
  })
213
237
  ]
214
238
  })]
215
239
  })
216
240
  }),
217
- K.length > 0 ? /* @__PURE__ */ y(ne, {
241
+ K.length > 0 ? /* @__PURE__ */ _(ie, {
218
242
  data: K,
219
243
  keyField: "id",
220
244
  columns: [
221
245
  {
222
246
  key: "select",
223
- header: /* @__PURE__ */ y(o, {
247
+ header: /* @__PURE__ */ _(a, {
224
248
  checked: X,
225
249
  indeterminate: Z,
226
250
  onChange: Q,
227
251
  ariaLabel: "Select all visible versions"
228
252
  }),
229
253
  className: "w-12",
230
- render: (e) => /* @__PURE__ */ y("div", {
254
+ render: (e) => /* @__PURE__ */ _("div", {
231
255
  onClick: (e) => e.stopPropagation(),
232
- children: /* @__PURE__ */ y(o, {
233
- checked: F.has(e.id),
234
- onChange: (t) => he(e.id, t),
256
+ children: /* @__PURE__ */ _(a, {
257
+ checked: L.has(e.id),
258
+ onChange: (t) => je(e.id, t),
235
259
  ariaLabel: `Select version ${e.version}`
236
260
  })
237
261
  })
238
262
  },
239
263
  {
240
264
  key: "version",
241
- header: S("devportal.version", "Version"),
242
- render: (e) => /* @__PURE__ */ b("div", {
265
+ header: b("devportal.version", "Version"),
266
+ render: (e) => /* @__PURE__ */ v("div", {
243
267
  className: "flex items-center gap-2",
244
268
  children: [
245
- me(e),
246
- /* @__PURE__ */ y("span", {
269
+ Ae(e),
270
+ /* @__PURE__ */ _("span", {
247
271
  className: "font-mono font-medium",
248
272
  children: e.version
249
273
  }),
250
- e.isLatest && /* @__PURE__ */ y("span", {
274
+ e.isLatest && /* @__PURE__ */ _("span", {
251
275
  className: "rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-xs text-status-success-text",
252
- children: S("devportal.latest", "Latest")
276
+ children: b("devportal.latest", "Latest")
253
277
  }),
254
- !e.isStable && /* @__PURE__ */ y("span", {
278
+ !e.isStable && /* @__PURE__ */ _("span", {
255
279
  className: "rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs text-status-warning-text",
256
- children: S("devportal.beta", "Beta")
280
+ children: b("devportal.beta", "Beta")
257
281
  })
258
282
  ]
259
283
  })
260
284
  },
261
285
  {
262
286
  key: "releaseNotes",
263
- header: S("devportal.releaseNotes", "Release Notes"),
264
- render: (e) => /* @__PURE__ */ y("p", {
287
+ header: b("devportal.releaseNotes", "Release Notes"),
288
+ render: (e) => /* @__PURE__ */ _("p", {
265
289
  className: "max-w-md truncate text-sm text-muted-foreground",
266
- children: e.releaseNotes || S("devportal.noReleaseNotes", "No release notes")
290
+ children: e.releaseNotes || b("devportal.noReleaseNotes", "No release notes")
267
291
  })
268
292
  },
269
293
  {
270
294
  key: "status",
271
- header: S("devportal.status", "Status"),
272
- render: (e) => /* @__PURE__ */ y(a, { status: e.status })
295
+ header: b("devportal.status", "Status"),
296
+ render: (e) => /* @__PURE__ */ _(re, { status: e.status })
273
297
  },
274
298
  {
275
299
  key: "publishedAt",
276
- header: S("devportal.published", "Published"),
277
- render: (e) => e.publishedAt ? ae(new Date(e.publishedAt), "MMM d, yyyy") : "-"
300
+ header: b("devportal.published", "Published"),
301
+ render: (e) => e.publishedAt ? ce(new Date(e.publishedAt), "MMM d, yyyy") : "-"
278
302
  },
279
303
  {
280
304
  key: "actions",
281
305
  header: "",
282
306
  className: "w-32",
283
- render: (e) => /* @__PURE__ */ b("div", {
307
+ render: (e) => /* @__PURE__ */ v("div", {
284
308
  className: "flex gap-2",
285
- children: [e.status === "DRAFT" && /* @__PURE__ */ y("button", {
309
+ children: [e.status?.toUpperCase() === "DRAFT" && /* @__PURE__ */ _("button", {
286
310
  className: "text-xs text-primary hover:underline disabled:opacity-50",
287
- disabled: !w,
288
- "aria-disabled": !w,
289
- onClick: () => fe(e.id),
290
- children: S("devportal.publish", "Publish")
291
- }), e.status === "PUBLISHED" && !e.isLatest && /* @__PURE__ */ y("button", {
311
+ disabled: !S,
312
+ "aria-disabled": !S,
313
+ onClick: () => Oe(e.id),
314
+ children: b("devportal.publish", "Publish")
315
+ }), e.status?.toUpperCase() === "PUBLISHED" && !e.isLatest && /* @__PURE__ */ _("button", {
292
316
  className: "text-xs text-status-warning-text hover:underline disabled:opacity-50",
293
- disabled: !T,
294
- "aria-disabled": !T,
295
- onClick: () => pe(e.id),
296
- children: S("devportal.deprecate", "Deprecate")
317
+ disabled: !C,
318
+ "aria-disabled": !C,
319
+ onClick: () => ke(e.id),
320
+ children: b("devportal.deprecate", "Deprecate")
297
321
  })]
298
322
  })
299
323
  }
300
324
  ]
301
- }) : /* @__PURE__ */ y(e, {
302
- icon: /* @__PURE__ */ y(_, { size: 32 }),
303
- title: S("devportal.noVersionsYet", "No versions yet"),
304
- description: S("devportal.noVersionsYetDescription", "Create your first version to start distributing your app"),
305
- action: /* @__PURE__ */ b("button", {
306
- onClick: () => O(!0),
325
+ }) : /* @__PURE__ */ _(t, {
326
+ icon: /* @__PURE__ */ _(m, { size: 32 }),
327
+ title: b("devportal.noVersionsYet", "No versions yet"),
328
+ description: b("devportal.noVersionsYetDescription", "Create your first version to start distributing your app"),
329
+ action: /* @__PURE__ */ v("button", {
330
+ onClick: () => A(!0),
307
331
  className: "inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
308
- children: [/* @__PURE__ */ y(v, { size: 16 }), S("devportal.createVersion", "Create Version")]
332
+ children: [/* @__PURE__ */ _(h, { size: 16 }), b("devportal.createVersion", "Create Version")]
309
333
  })
310
334
  }),
311
- D && /* @__PURE__ */ y(c, {
312
- open: D,
313
- onOpenChange: O,
314
- onConfirm: de,
315
- title: S("devportal.createNewVersion", "Create New Version"),
316
- confirmLabel: ue ? S("devportal.creating", "Creating...") : S("devportal.createVersion", "Create Version"),
317
- children: /* @__PURE__ */ b("div", {
335
+ k && /* @__PURE__ */ _(o, {
336
+ open: k,
337
+ onOpenChange: A,
338
+ onConfirm: Ee,
339
+ title: b("devportal.createNewVersion", "Create New Version"),
340
+ confirmLabel: Te ? b("devportal.creating", "Creating...") : b("devportal.createVersion", "Create Version"),
341
+ children: /* @__PURE__ */ v("div", {
318
342
  className: "space-y-4",
319
343
  children: [
320
- /* @__PURE__ */ y(re, {
321
- label: S("devportal.versionNumber", "Version Number"),
322
- value: k.version,
323
- onChange: (e) => A({
324
- ...k,
344
+ /* @__PURE__ */ _(ae, {
345
+ label: b("devportal.versionNumber", "Version Number"),
346
+ value: j.version,
347
+ onChange: (e) => M({
348
+ ...j,
325
349
  version: e.target.value
326
350
  }),
327
351
  placeholder: "e.g., 2.2.0",
328
- hint: S("devportal.versionHint", "Use semantic versioning (major.minor.patch)"),
352
+ hint: b("devportal.versionHint", "Use semantic versioning (major.minor.patch)"),
329
353
  required: !0
330
354
  }),
331
- /* @__PURE__ */ y(s, {
332
- label: S("devportal.releaseNotes", "Release Notes"),
333
- value: k.releaseNotes,
334
- onChange: (e) => A({
335
- ...k,
355
+ /* @__PURE__ */ v("div", {
356
+ className: "space-y-1.5",
357
+ children: [
358
+ /* @__PURE__ */ v("label", {
359
+ className: "text-sm font-medium",
360
+ children: [
361
+ "Package File",
362
+ " ",
363
+ /* @__PURE__ */ _("span", {
364
+ className: "text-xs text-muted-foreground",
365
+ children: "(zip / manifest)"
366
+ })
367
+ ]
368
+ }),
369
+ /* @__PURE__ */ v("div", {
370
+ className: "flex gap-2 items-center",
371
+ children: [
372
+ /* @__PURE__ */ _("input", {
373
+ ref: O,
374
+ type: "file",
375
+ accept: ".zip,.json",
376
+ className: "hidden",
377
+ onChange: De
378
+ }),
379
+ /* @__PURE__ */ _("button", {
380
+ type: "button",
381
+ disabled: E,
382
+ onClick: () => O.current?.click(),
383
+ className: "inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium hover:bg-muted transition-colors disabled:opacity-50",
384
+ children: E ? /* @__PURE__ */ v(g, { children: [
385
+ /* @__PURE__ */ _(p, {
386
+ size: 14,
387
+ className: "animate-spin"
388
+ }),
389
+ " ",
390
+ "Uploading… ",
391
+ Se,
392
+ "%"
393
+ ] }) : /* @__PURE__ */ v(g, { children: [
394
+ /* @__PURE__ */ _(ge, { size: 14 }),
395
+ " ",
396
+ j.packageUrl ? "Replace file" : "Upload zip / manifest"
397
+ ] })
398
+ }),
399
+ j.packageUrl && !E && /* @__PURE__ */ _("span", {
400
+ className: "text-xs text-status-success-text truncate max-w-48",
401
+ children: "✓ File uploaded"
402
+ })
403
+ ]
404
+ }),
405
+ j.packageUrl && /* @__PURE__ */ _("p", {
406
+ className: "text-xs text-muted-foreground truncate",
407
+ children: j.packageUrl
408
+ }),
409
+ D && /* @__PURE__ */ _("p", {
410
+ className: "text-xs text-destructive",
411
+ children: D
412
+ })
413
+ ]
414
+ }),
415
+ /* @__PURE__ */ _(oe, {
416
+ label: b("devportal.releaseNotes", "Release Notes"),
417
+ value: j.releaseNotes,
418
+ onChange: (e) => M({
419
+ ...j,
336
420
  releaseNotes: e.target.value
337
421
  }),
338
- placeholder: S("devportal.releaseNotesPlaceholder", "Brief description of this release"),
422
+ placeholder: b("devportal.releaseNotesPlaceholder", "What changed in this release?"),
339
423
  rows: 2
340
- }),
341
- /* @__PURE__ */ y(s, {
342
- label: S("devportal.changelog", "Changelog"),
343
- value: k.changelog,
344
- onChange: (e) => A({
345
- ...k,
346
- changelog: e.target.value
347
- }),
348
- placeholder: "- Added feature X\n- Fixed bug Y\n- Improved performance",
349
- rows: 4
350
424
  })
351
425
  ]
352
426
  })
353
427
  }),
354
- /* @__PURE__ */ y(c, {
355
- open: L === "publish",
428
+ /* @__PURE__ */ _(o, {
429
+ open: z === "publish",
356
430
  onOpenChange: (e) => {
357
- e || R(null);
431
+ e || B(null);
358
432
  },
359
433
  onConfirm: async () => {
360
434
  if (J.length === 0) return;
361
- M(null);
435
+ P(null);
362
436
  let e = await Promise.allSettled(J.map((e) => W({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
363
- P(`Published ${t} version${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`), $(), R(null);
437
+ I(`Published ${t} version${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`), $(), B(null);
364
438
  },
365
- title: S("devportal.publishSelectedVersions", "Publish selected versions"),
366
- description: `${S("devportal.publish", "Publish")} ${J.length} selected version${J.length === 1 ? "" : "s"}?`,
367
- confirmLabel: S("devportal.publish", "Publish"),
368
- cancelLabel: S("devportal.cancel", "Cancel"),
439
+ title: b("devportal.publishSelectedVersions", "Publish selected versions"),
440
+ description: `${b("devportal.publish", "Publish")} ${J.length} selected version${J.length === 1 ? "" : "s"}?`,
441
+ confirmLabel: b("devportal.publish", "Publish"),
442
+ cancelLabel: b("devportal.cancel", "Cancel"),
369
443
  variant: "success"
370
444
  }),
371
- /* @__PURE__ */ y(c, {
372
- open: L === "deprecate",
445
+ /* @__PURE__ */ _(o, {
446
+ open: z === "deprecate",
373
447
  onOpenChange: (e) => {
374
- e || R(null);
448
+ e || B(null);
375
449
  },
376
450
  onConfirm: async () => {
377
451
  if (Y.length === 0) return;
378
- M(null);
452
+ P(null);
379
453
  let e = await Promise.allSettled(Y.map((e) => G({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
380
- P(`Deprecated ${t} version${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`), $(), R(null);
454
+ I(`Deprecated ${t} version${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`), $(), B(null);
381
455
  },
382
- title: S("devportal.deprecateSelectedVersions", "Deprecate selected versions"),
383
- description: `${S("devportal.deprecate", "Deprecate")} ${Y.length} selected version${Y.length === 1 ? "" : "s"}? ${S("devportal.deprecateVersionsWarning", "Deprecated versions remain visible but should no longer be promoted.")}`,
384
- confirmLabel: S("devportal.deprecate", "Deprecate"),
385
- cancelLabel: S("devportal.cancel", "Cancel"),
456
+ title: b("devportal.deprecateSelectedVersions", "Deprecate selected versions"),
457
+ description: `${b("devportal.deprecate", "Deprecate")} ${Y.length} selected version${Y.length === 1 ? "" : "s"}? ${b("devportal.deprecateVersionsWarning", "Deprecated versions remain visible but should no longer be promoted.")}`,
458
+ confirmLabel: b("devportal.deprecate", "Deprecate"),
459
+ cancelLabel: b("devportal.cancel", "Cancel"),
386
460
  variant: "warning"
387
461
  })
388
462
  ]
@@ -390,6 +464,6 @@ var x = () => {
390
464
  });
391
465
  };
392
466
  //#endregion
393
- export { x as ApplicationVersionsPage };
467
+ export { y as ApplicationVersionsPage };
394
468
 
395
469
  //# sourceMappingURL=ApplicationVersionsPage.js.map