@burdenoff/microfe-timecampus 2026.1107.6 → 2026.1109.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.
Files changed (50) hide show
  1. package/dist/generated/global-types.d.ts +1019 -85
  2. package/dist/generated/global-types.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.d.ts +1219 -0
  4. package/dist/generated/wspace-operations.d.ts.map +1 -1
  5. package/dist/generated/wspace-operations.js +1731 -1483
  6. package/dist/generated/wspace-operations.js.map +1 -1
  7. package/dist/generated/wspace-types.d.ts +5568 -171
  8. package/dist/generated/wspace-types.d.ts.map +1 -1
  9. package/dist/generated/wspace-types.js +7 -5
  10. package/dist/generated/wspace-types.js.map +1 -1
  11. package/dist/index.js +8 -7
  12. package/dist/timecampus/AdminRoot.d.ts.map +1 -1
  13. package/dist/timecampus/AdminRoot.js +1 -1
  14. package/dist/timecampus/AdminRoot.js.map +1 -1
  15. package/dist/timecampus/AdminRoutes.d.ts.map +1 -1
  16. package/dist/timecampus/AdminRoutes.js +24 -4
  17. package/dist/timecampus/AdminRoutes.js.map +1 -1
  18. package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
  19. package/dist/timecampus/TimeCampusRoutes.js +11 -7
  20. package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
  21. package/dist/timecampus/adminPaths.d.ts +7 -0
  22. package/dist/timecampus/adminPaths.d.ts.map +1 -0
  23. package/dist/timecampus/adminPaths.js +6 -0
  24. package/dist/timecampus/adminPaths.js.map +1 -0
  25. package/dist/timecampus/index.d.ts +1 -0
  26. package/dist/timecampus/index.d.ts.map +1 -1
  27. package/dist/timecampus/index.js +8 -7
  28. package/dist/timecampus/pages/admin/AdminPage.d.ts.map +1 -1
  29. package/dist/timecampus/pages/admin/AdminPage.js +263 -251
  30. package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
  31. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +4 -4
  32. package/dist/timecampus/pages/extend/AppletDeveloperPage.d.ts.map +1 -1
  33. package/dist/timecampus/pages/extend/AppletDeveloperPage.js +252 -134
  34. package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
  35. package/dist/timecampus/pages/extend/AppletReviewPage.d.ts.map +1 -1
  36. package/dist/timecampus/pages/extend/AppletReviewPage.js +143 -130
  37. package/dist/timecampus/pages/extend/AppletReviewPage.js.map +1 -1
  38. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.d.ts +2 -0
  39. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.d.ts.map +1 -0
  40. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +330 -0
  41. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -0
  42. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.d.ts.map +1 -1
  43. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +167 -104
  44. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
  45. package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts +30 -0
  46. package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts.map +1 -1
  47. package/dist/timecampus/pages/extend/appletPublishingHelpers.js +27 -1
  48. package/dist/timecampus/pages/extend/appletPublishingHelpers.js.map +1 -1
  49. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js +4 -4
  50. package/package.json +1 -1
@@ -2,126 +2,232 @@ import { useTimeCampus as e } from "../../providers/TimeCampusProvider.js";
2
2
  import { formatDate as t } from "../../utils/helpers.js";
3
3
  import { LoadingSkeleton as n } from "../../components/LoadingSkeleton.js";
4
4
  import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { useAddThirdPartyAppletVersionMutation as i, useArchiveThirdPartyAppletMutation as a, useCreateThirdPartyAppletMutation as o, useListAppletDataScopesQuery as s, useListMyThirdPartyAppletsQuery as c, useSubmitThirdPartyAppletVersionMutation as l, useUpdateThirdPartyAppletVersionMutation as u, useValidateAppletManifestLazyQuery as d, useWithdrawThirdPartyAppletVersionMutation as f } from "../../../generated/wspace-operations.js";
6
- import { PageLayout as p } from "../../components/PageLayout.js";
7
- import { StatusBadge as m } from "../../components/StatusBadge.js";
8
- import { ToastContainer as h, useToast as ee } from "../../components/Toast.js";
9
- import { catalogueIcon as g } from "./extendHelpers.js";
10
- import { appletStatus as _, errorText as v, manifestForNextVersion as te, manifestText as y, parseManifestText as ne, starterManifest as b } from "./appletPublishingHelpers.js";
11
- import { useMemo as x, useState as S } from "react";
12
- import { CheckCircle2 as C, FilePlus2 as w, Pencil as T, Send as E, Trash2 as D, Undo2 as O } from "lucide-react";
13
- import { jsx as k, jsxs as A } from "react/jsx-runtime";
14
- import { GlassCard as j } from "@burdenoff/fe-libs/ui";
5
+ import { useAddThirdPartyAppletVersionMutation as i, useArchiveThirdPartyAppletMutation as a, useCreateThirdPartyAppletMutation as o, useDelistAppletFromMarketplaceMutation as s, useListAppletDataScopesQuery as c, useListMyThirdPartyAppletsQuery as l, useSubmitAppletToMarketplaceMutation as u, useSubmitThirdPartyAppletVersionMutation as d, useUpdateThirdPartyAppletVersionMutation as f, useValidateAppletManifestLazyQuery as ee, useWithdrawAppletFromMarketplaceMutation as p, useWithdrawThirdPartyAppletVersionMutation as m } from "../../../generated/wspace-operations.js";
6
+ import { PageLayout as te } from "../../components/PageLayout.js";
7
+ import { StatusBadge as h } from "../../components/StatusBadge.js";
8
+ import { ToastContainer as g, useToast as _ } from "../../components/Toast.js";
9
+ import { catalogueIcon as v } from "./extendHelpers.js";
10
+ import { appletStatus as y, errorText as b, manifestForNextVersion as ne, manifestText as x, marketplaceOffer as S, parseManifestText as re, starterManifest as C } from "./appletPublishingHelpers.js";
11
+ import { useMemo as w, useState as T } from "react";
12
+ import { CheckCircle2 as E, FilePlus2 as D, Globe as O, Pencil as k, Send as A, Trash2 as j, Undo2 as M } from "lucide-react";
13
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
14
+ import { GlassCard as I } from "@burdenoff/fe-libs/ui";
15
15
  //#region src/timecampus/pages/extend/AppletDeveloperPage.tsx
16
- var M = ["ListMyThirdPartyApplets"], N = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", P = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50";
17
- function re(e) {
16
+ var L = ["ListMyThirdPartyApplets"], R = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", z = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50";
17
+ function B(e) {
18
18
  return e.kind === "new" ? "Register a new applet" : e.kind === "version" ? `New version of ${e.appletName}` : `Edit ${e.appletName} v${e.version}`;
19
19
  }
20
- function F(e) {
20
+ function V(e) {
21
21
  return e.kind === "new" ? "Register applet" : e.kind === "version" ? "Add version" : "Save draft";
22
22
  }
23
- function I({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a, onWithdraw: o, onArchive: s }) {
24
- let c = g(e.icon), l = _(e.status), u = e.versions.some((e) => e.status === "DRAFT" || e.status === "IN_REVIEW");
25
- return /* @__PURE__ */ A(j, {
23
+ function H({ applet: e, busy: n, onOffer: r, onWithdraw: i, onDelist: a }) {
24
+ let o = e.marketplace, s = S(e), c = o?.latestSubmission, l = o ? y(o.status) : null, u = c ? y(c.status) : null;
25
+ return /* @__PURE__ */ F("div", {
26
+ className: "flex flex-col gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
27
+ "data-testid": `developer-marketplace-${e.key}`,
28
+ children: [
29
+ /* @__PURE__ */ F("div", {
30
+ className: "flex flex-wrap items-center gap-2",
31
+ children: [
32
+ /* @__PURE__ */ P(O, {
33
+ className: "h-4 w-4 text-text-tertiary",
34
+ "aria-hidden": "true"
35
+ }),
36
+ /* @__PURE__ */ P("p", {
37
+ className: "text-sm font-medium text-text-primary",
38
+ children: "Public marketplace"
39
+ }),
40
+ l && /* @__PURE__ */ P(h, {
41
+ label: l.label,
42
+ variant: l.variant,
43
+ dot: !0
44
+ })
45
+ ]
46
+ }),
47
+ o ? /* @__PURE__ */ F(N, { children: [
48
+ o.liveSubmission && /* @__PURE__ */ F("p", {
49
+ className: "text-xs text-text-secondary",
50
+ children: [
51
+ "v",
52
+ o.liveSubmission.version,
53
+ " is live in the marketplace",
54
+ o.liveSubmission.certifiedAt ? ` since ${t(o.liveSubmission.certifiedAt)}` : "",
55
+ "."
56
+ ]
57
+ }),
58
+ c && u && c.id !== o.liveSubmission?.id && /* @__PURE__ */ F("p", {
59
+ className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary",
60
+ children: [
61
+ "Latest submission v",
62
+ c.version,
63
+ /* @__PURE__ */ P(h, {
64
+ label: u.label,
65
+ variant: u.variant
66
+ })
67
+ ]
68
+ }),
69
+ c?.reviewNotes && /* @__PURE__ */ F("p", {
70
+ className: "text-xs text-text-secondary",
71
+ children: ["Platform reviewer notes: ", c.reviewNotes]
72
+ }),
73
+ o.suspendedReason && /* @__PURE__ */ F("p", {
74
+ className: "text-xs text-status-warning-text",
75
+ children: ["Suspended by the platform: ", o.suspendedReason]
76
+ })
77
+ ] }) : /* @__PURE__ */ P("p", {
78
+ className: "text-xs text-text-secondary",
79
+ children: "Offer this applet to every TimeCampus workspace. The TimeCampus platform team certifies each version before other workspaces can install it."
80
+ }),
81
+ /* @__PURE__ */ F("div", {
82
+ className: "flex flex-wrap gap-2",
83
+ children: [
84
+ s.canOffer ? /* @__PURE__ */ F("button", {
85
+ type: "button",
86
+ className: z,
87
+ disabled: n,
88
+ onClick: r,
89
+ "aria-label": `Offer ${e.name} v${s.version} in the marketplace`,
90
+ children: [
91
+ /* @__PURE__ */ P(O, {
92
+ className: "h-4 w-4",
93
+ "aria-hidden": "true"
94
+ }),
95
+ "Offer v",
96
+ s.version,
97
+ " in the marketplace"
98
+ ]
99
+ }) : /* @__PURE__ */ P("p", {
100
+ className: "text-xs text-text-tertiary",
101
+ children: s.reason
102
+ }),
103
+ c?.status === "IN_REVIEW" && /* @__PURE__ */ F("button", {
104
+ type: "button",
105
+ className: z,
106
+ disabled: n,
107
+ onClick: i,
108
+ children: [/* @__PURE__ */ P(M, {
109
+ className: "h-4 w-4",
110
+ "aria-hidden": "true"
111
+ }), "Withdraw from certification"]
112
+ }),
113
+ o && /* @__PURE__ */ F("button", {
114
+ type: "button",
115
+ className: z,
116
+ disabled: n,
117
+ onClick: a,
118
+ "aria-label": `Remove ${e.name} from the marketplace`,
119
+ children: [/* @__PURE__ */ P(j, {
120
+ className: "h-4 w-4",
121
+ "aria-hidden": "true"
122
+ }), "Remove from marketplace"]
123
+ })
124
+ ]
125
+ })
126
+ ]
127
+ });
128
+ }
129
+ function U({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a, onWithdraw: o, onArchive: s, marketplace: c }) {
130
+ let l = v(e.icon), u = y(e.status), d = e.versions.some((e) => e.status === "DRAFT" || e.status === "IN_REVIEW");
131
+ return /* @__PURE__ */ F(I, {
26
132
  treatment: "glass",
27
133
  className: "flex flex-col gap-3 p-5",
28
134
  "data-testid": `developer-applet-${e.key}`,
29
135
  children: [
30
- /* @__PURE__ */ A("div", {
136
+ /* @__PURE__ */ F("div", {
31
137
  className: "flex flex-wrap items-start gap-3",
32
138
  children: [
33
- /* @__PURE__ */ k("div", {
139
+ /* @__PURE__ */ P("div", {
34
140
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
35
- children: /* @__PURE__ */ k(c, {
141
+ children: /* @__PURE__ */ P(l, {
36
142
  className: "h-5 w-5",
37
143
  "aria-hidden": "true"
38
144
  })
39
145
  }),
40
- /* @__PURE__ */ A("div", {
146
+ /* @__PURE__ */ F("div", {
41
147
  className: "min-w-0 flex-1",
42
- children: [/* @__PURE__ */ k("h3", {
148
+ children: [/* @__PURE__ */ P("h3", {
43
149
  className: "truncate text-base font-semibold text-text-primary",
44
150
  children: e.name
45
- }), /* @__PURE__ */ A("p", {
151
+ }), /* @__PURE__ */ F("p", {
46
152
  className: "text-xs text-text-tertiary",
47
153
  children: [
48
- /* @__PURE__ */ k("code", { children: e.key }),
154
+ /* @__PURE__ */ P("code", { children: e.key }),
49
155
  " · registered",
50
156
  " ",
51
157
  t(e.createdAt)
52
158
  ]
53
159
  })]
54
160
  }),
55
- /* @__PURE__ */ k(m, {
56
- label: l.label,
57
- variant: l.variant,
161
+ /* @__PURE__ */ P(h, {
162
+ label: u.label,
163
+ variant: u.variant,
58
164
  dot: !0
59
165
  })
60
166
  ]
61
167
  }),
62
- /* @__PURE__ */ k("p", {
168
+ /* @__PURE__ */ P("p", {
63
169
  className: "text-sm text-text-secondary",
64
170
  children: e.description
65
171
  }),
66
- /* @__PURE__ */ k("ul", {
172
+ /* @__PURE__ */ P("ul", {
67
173
  className: "divide-y divide-border-subtle rounded-md border border-border-subtle",
68
174
  children: e.versions.map((t) => {
69
- let i = _(t.status);
70
- return /* @__PURE__ */ A("li", {
175
+ let i = y(t.status);
176
+ return /* @__PURE__ */ F("li", {
71
177
  className: "flex flex-col gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between",
72
178
  "data-testid": `developer-version-${e.key}-${t.version}`,
73
- children: [/* @__PURE__ */ A("div", {
179
+ children: [/* @__PURE__ */ F("div", {
74
180
  className: "min-w-0",
75
181
  children: [
76
- /* @__PURE__ */ A("p", {
182
+ /* @__PURE__ */ F("p", {
77
183
  className: "flex items-center gap-2 text-sm text-text-primary",
78
184
  children: [
79
185
  "v",
80
186
  t.version,
81
- /* @__PURE__ */ k(m, {
187
+ /* @__PURE__ */ P(h, {
82
188
  label: i.label,
83
189
  variant: i.variant
84
190
  })
85
191
  ]
86
192
  }),
87
- t.reviewNotes && /* @__PURE__ */ A("p", {
193
+ t.reviewNotes && /* @__PURE__ */ F("p", {
88
194
  className: "text-xs text-text-secondary",
89
195
  children: ["Reviewer notes: ", t.reviewNotes]
90
196
  }),
91
- t.suspendedReason && /* @__PURE__ */ A("p", {
197
+ t.suspendedReason && /* @__PURE__ */ F("p", {
92
198
  className: "text-xs text-status-warning-text",
93
199
  children: ["Suspended: ", t.suspendedReason]
94
200
  })
95
201
  ]
96
- }), /* @__PURE__ */ A("div", {
202
+ }), /* @__PURE__ */ F("div", {
97
203
  className: "flex flex-wrap gap-2",
98
204
  children: [
99
- (t.status === "DRAFT" || t.status === "REJECTED") && /* @__PURE__ */ A("button", {
205
+ (t.status === "DRAFT" || t.status === "REJECTED") && /* @__PURE__ */ F("button", {
100
206
  type: "button",
101
- className: P,
207
+ className: z,
102
208
  disabled: n,
103
209
  onClick: () => r(t.id, t.version, t.manifest),
104
- children: [/* @__PURE__ */ k(T, {
210
+ children: [/* @__PURE__ */ P(k, {
105
211
  className: "h-4 w-4",
106
212
  "aria-hidden": "true"
107
213
  }), "Edit"]
108
214
  }),
109
- t.status === "DRAFT" && /* @__PURE__ */ A("button", {
215
+ t.status === "DRAFT" && /* @__PURE__ */ F("button", {
110
216
  type: "button",
111
- className: N,
217
+ className: R,
112
218
  disabled: n,
113
219
  onClick: () => a(t.id),
114
- children: [/* @__PURE__ */ k(E, {
220
+ children: [/* @__PURE__ */ P(A, {
115
221
  className: "h-4 w-4",
116
222
  "aria-hidden": "true"
117
223
  }), "Submit for review"]
118
224
  }),
119
- t.status === "IN_REVIEW" && /* @__PURE__ */ A("button", {
225
+ t.status === "IN_REVIEW" && /* @__PURE__ */ F("button", {
120
226
  type: "button",
121
- className: P,
227
+ className: z,
122
228
  disabled: n,
123
229
  onClick: () => o(t.id),
124
- children: [/* @__PURE__ */ k(O, {
230
+ children: [/* @__PURE__ */ P(M, {
125
231
  className: "h-4 w-4",
126
232
  "aria-hidden": "true"
127
233
  }), "Withdraw"]
@@ -131,25 +237,30 @@ function I({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a,
131
237
  }, t.id);
132
238
  })
133
239
  }),
134
- /* @__PURE__ */ A("div", {
240
+ /* @__PURE__ */ P(H, {
241
+ applet: e,
242
+ busy: n,
243
+ ...c
244
+ }),
245
+ /* @__PURE__ */ F("div", {
135
246
  className: "flex flex-wrap gap-2",
136
- children: [/* @__PURE__ */ A("button", {
247
+ children: [/* @__PURE__ */ F("button", {
137
248
  type: "button",
138
- className: P,
139
- disabled: n || u,
249
+ className: z,
250
+ disabled: n || d,
140
251
  onClick: i,
141
- title: u ? "Finish or withdraw the open version first" : void 0,
142
- children: [/* @__PURE__ */ k(w, {
252
+ title: d ? "Finish or withdraw the open version first" : void 0,
253
+ children: [/* @__PURE__ */ P(D, {
143
254
  className: "h-4 w-4",
144
255
  "aria-hidden": "true"
145
256
  }), "New version"]
146
- }), /* @__PURE__ */ A("button", {
257
+ }), /* @__PURE__ */ F("button", {
147
258
  type: "button",
148
- className: P,
259
+ className: z,
149
260
  disabled: n,
150
261
  onClick: s,
151
262
  "aria-label": `Archive ${e.name}`,
152
- children: [/* @__PURE__ */ k(D, {
263
+ children: [/* @__PURE__ */ P(j, {
153
264
  className: "h-4 w-4",
154
265
  "aria-hidden": "true"
155
266
  }), "Archive"]
@@ -158,98 +269,98 @@ function I({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a,
158
269
  ]
159
270
  });
160
271
  }
161
- function L() {
162
- let { workspaceId: t = "" } = e(), { toasts: m, addToast: g, dismissToast: _ } = ee(), w = typeof window > "u" ? "" : window.location.origin, [T, E] = S({ kind: "new" }), [D, O] = S(() => b(w)), [L, R] = S([]), [z, B] = S(!1), { data: V, loading: H, error: U } = c({ skip: !t }), { data: W } = s({ skip: !t }), [G] = d({ fetchPolicy: "network-only" }), [K] = o({ refetchQueries: M }), [q] = i({ refetchQueries: M }), [J] = u({ refetchQueries: M }), [Y] = l({ refetchQueries: M }), [ie] = f({ refetchQueries: M }), [ae] = a({ refetchQueries: M }), X = x(() => V?.timeCampusMyThirdPartyApplets ?? [], [V]), oe = W?.timeCampusAppletDataScopes ?? [], Z = () => {
163
- E({ kind: "new" }), O(b(w)), R([]);
272
+ function W() {
273
+ let { workspaceId: t = "" } = e(), { toasts: h, addToast: v, dismissToast: y } = _(), S = typeof window > "u" ? "" : window.location.origin, [D, O] = T({ kind: "new" }), [k, A] = T(() => C(S)), [j, M] = T([]), [N, H] = T(!1), { data: W, loading: G, error: K } = l({ skip: !t }), { data: q } = c({ skip: !t }), [J] = ee({ fetchPolicy: "network-only" }), [Y] = o({ refetchQueries: L }), [ie] = i({ refetchQueries: L }), [ae] = f({ refetchQueries: L }), [oe] = d({ refetchQueries: L }), [se] = m({ refetchQueries: L }), [ce] = a({ refetchQueries: L }), [le] = u({ refetchQueries: L }), [ue] = p({ refetchQueries: L }), [de] = s({ refetchQueries: L }), X = w(() => W?.timeCampusMyThirdPartyApplets ?? [], [W]), fe = q?.timeCampusAppletDataScopes ?? [], Z = () => {
274
+ O({ kind: "new" }), A(C(S)), M([]);
164
275
  }, Q = async () => {
165
- let e = ne(D);
166
- if (!e.ok) return R([e.error]), null;
167
- let t = await G({ variables: { manifest: e.manifest } }), n = t.data?.validateTimeCampusAppletManifest;
168
- return n ? (R(n.errors), n.valid ? e.manifest : null) : (R([v(t.error)]), null);
169
- }, se = async () => {
170
- await Q() && g({
276
+ let e = re(k);
277
+ if (!e.ok) return M([e.error]), null;
278
+ let t = await J({ variables: { manifest: e.manifest } }), n = t.data?.validateTimeCampusAppletManifest;
279
+ return n ? (M(n.errors), n.valid ? e.manifest : null) : (M([b(t.error)]), null);
280
+ }, pe = async () => {
281
+ await Q() && v({
171
282
  title: "Manifest is valid",
172
283
  variant: "success"
173
284
  });
174
- }, ce = async () => {
175
- B(!0);
285
+ }, me = async () => {
286
+ H(!0);
176
287
  try {
177
288
  let e = await Q();
178
289
  if (!e) return;
179
- T.kind === "new" ? (await K({ variables: { manifest: e } }), g({
290
+ D.kind === "new" ? (await Y({ variables: { manifest: e } }), v({
180
291
  title: "Applet registered as a draft",
181
292
  description: "Submit it for review when it is ready.",
182
293
  variant: "success"
183
- })) : T.kind === "version" ? (await q({ variables: {
184
- appletId: T.appletId,
294
+ })) : D.kind === "version" ? (await ie({ variables: {
295
+ appletId: D.appletId,
185
296
  manifest: e
186
- } }), g({
297
+ } }), v({
187
298
  title: "New draft version added",
188
299
  variant: "success"
189
- })) : (await J({ variables: {
190
- versionId: T.versionId,
300
+ })) : (await ae({ variables: {
301
+ versionId: D.versionId,
191
302
  manifest: e
192
- } }), g({
303
+ } }), v({
193
304
  title: "Draft saved",
194
305
  variant: "success"
195
306
  })), Z();
196
307
  } catch (e) {
197
- g({
198
- title: v(e),
308
+ v({
309
+ title: b(e),
199
310
  variant: "error"
200
311
  });
201
312
  } finally {
202
- B(!1);
313
+ H(!1);
203
314
  }
204
315
  }, $ = async (e, t) => {
205
- B(!0);
316
+ H(!0);
206
317
  try {
207
- await e(), g({
318
+ await e(), v({
208
319
  title: t,
209
320
  variant: "success"
210
321
  });
211
322
  } catch (e) {
212
- g({
213
- title: v(e),
323
+ v({
324
+ title: b(e),
214
325
  variant: "error"
215
326
  });
216
327
  } finally {
217
- B(!1);
328
+ H(!1);
218
329
  }
219
330
  };
220
- return /* @__PURE__ */ A(p, {
331
+ return /* @__PURE__ */ F(te, {
221
332
  title: "Applet Developer",
222
333
  description: "Build and publish your own TimeCampus applets",
223
334
  purpose: "Describe an applet with a JSON manifest: its name and icon, the TimeCampus data scopes it reads, its HTTPS entry point and the widgets it adds. Each version goes to a reviewer before anyone can install it. Widgets run in a sandboxed iframe and get data only through the host bridge — never an API token.",
224
- children: [/* @__PURE__ */ k(h, {
225
- toasts: m,
226
- onDismiss: _
227
- }), /* @__PURE__ */ A("div", {
335
+ children: [/* @__PURE__ */ P(g, {
336
+ toasts: h,
337
+ onDismiss: y
338
+ }), /* @__PURE__ */ F("div", {
228
339
  className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
229
- children: [/* @__PURE__ */ k("section", {
340
+ children: [/* @__PURE__ */ P("section", {
230
341
  "aria-labelledby": "manifest-editor-heading",
231
- children: /* @__PURE__ */ A(j, {
342
+ children: /* @__PURE__ */ F(I, {
232
343
  treatment: "glass",
233
344
  className: "flex flex-col gap-3 p-5",
234
345
  children: [
235
- /* @__PURE__ */ A("div", {
346
+ /* @__PURE__ */ F("div", {
236
347
  className: "flex items-center justify-between gap-2",
237
- children: [/* @__PURE__ */ k("h2", {
348
+ children: [/* @__PURE__ */ P("h2", {
238
349
  id: "manifest-editor-heading",
239
350
  className: "text-base font-semibold text-text-primary",
240
- children: re(T)
241
- }), T.kind !== "new" && /* @__PURE__ */ k("button", {
351
+ children: B(D)
352
+ }), D.kind !== "new" && /* @__PURE__ */ P("button", {
242
353
  type: "button",
243
- className: P,
354
+ className: z,
244
355
  onClick: Z,
245
356
  children: "Cancel"
246
357
  })]
247
358
  }),
248
- /* @__PURE__ */ A("label", {
359
+ /* @__PURE__ */ F("label", {
249
360
  className: "flex flex-col gap-1 text-sm text-text-secondary",
250
- children: ["Manifest (JSON)", /* @__PURE__ */ k("textarea", {
251
- value: D,
252
- onChange: (e) => O(e.target.value),
361
+ children: ["Manifest (JSON)", /* @__PURE__ */ P("textarea", {
362
+ value: k,
363
+ onChange: (e) => A(e.target.value),
253
364
  spellCheck: !1,
254
365
  rows: 22,
255
366
  className: "w-full rounded-md border border-border-subtle bg-bg-surface p-3 font-mono text-xs text-text-primary",
@@ -257,54 +368,54 @@ function L() {
257
368
  "data-testid": "applet-manifest-editor"
258
369
  })]
259
370
  }),
260
- L.length > 0 && /* @__PURE__ */ k("ul", {
371
+ j.length > 0 && /* @__PURE__ */ P("ul", {
261
372
  className: "list-disc rounded-md bg-status-error-bg py-2 pl-6 pr-3 text-xs text-status-error-text",
262
373
  "data-testid": "applet-manifest-problems",
263
- children: L.map((e) => /* @__PURE__ */ k("li", { children: e }, e))
374
+ children: j.map((e) => /* @__PURE__ */ P("li", { children: e }, e))
264
375
  }),
265
- /* @__PURE__ */ A("div", {
376
+ /* @__PURE__ */ F("div", {
266
377
  className: "flex flex-wrap gap-2",
267
- children: [/* @__PURE__ */ A("button", {
378
+ children: [/* @__PURE__ */ F("button", {
268
379
  type: "button",
269
- className: P,
270
- onClick: se,
271
- disabled: z,
272
- children: [/* @__PURE__ */ k(C, {
380
+ className: z,
381
+ onClick: pe,
382
+ disabled: N,
383
+ children: [/* @__PURE__ */ P(E, {
273
384
  className: "h-4 w-4",
274
385
  "aria-hidden": "true"
275
386
  }), "Validate"]
276
- }), /* @__PURE__ */ k("button", {
387
+ }), /* @__PURE__ */ P("button", {
277
388
  type: "button",
278
- className: N,
279
- onClick: ce,
280
- disabled: z,
281
- children: F(T)
389
+ className: R,
390
+ onClick: me,
391
+ disabled: N,
392
+ children: V(D)
282
393
  })]
283
394
  }),
284
- /* @__PURE__ */ A("div", {
395
+ /* @__PURE__ */ F("div", {
285
396
  className: "text-xs text-text-tertiary",
286
397
  children: [
287
- /* @__PURE__ */ k("p", {
398
+ /* @__PURE__ */ P("p", {
288
399
  className: "mb-1 font-medium text-text-secondary",
289
400
  children: "Data scopes a manifest can ask for"
290
401
  }),
291
- /* @__PURE__ */ k("ul", {
402
+ /* @__PURE__ */ P("ul", {
292
403
  className: "list-disc pl-5",
293
- children: oe.map((e) => /* @__PURE__ */ A("li", { children: [
294
- /* @__PURE__ */ k("code", { children: e.key }),
404
+ children: fe.map((e) => /* @__PURE__ */ F("li", { children: [
405
+ /* @__PURE__ */ P("code", { children: e.key }),
295
406
  " — ",
296
407
  e.description
297
408
  ] }, e.key))
298
409
  }),
299
- /* @__PURE__ */ A("p", {
410
+ /* @__PURE__ */ F("p", {
300
411
  className: "mt-2",
301
412
  children: [
302
413
  "Your widget page asks the host for data with",
303
414
  " ",
304
- /* @__PURE__ */ k("code", { children: "parent.postMessage({ protocol: \"timecampus.applet.v1\", type: \"request\", requestId, scope }, \"*\")" }),
415
+ /* @__PURE__ */ P("code", { children: "parent.postMessage({ protocol: \"timecampus.applet.v1\", type: \"request\", requestId, scope }, \"*\")" }),
305
416
  " ",
306
417
  "and receives a ",
307
- /* @__PURE__ */ k("code", { children: "response" }),
418
+ /* @__PURE__ */ P("code", { children: "response" }),
308
419
  " message back."
309
420
  ]
310
421
  })
@@ -312,47 +423,54 @@ function L() {
312
423
  })
313
424
  ]
314
425
  })
315
- }), /* @__PURE__ */ A("section", {
426
+ }), /* @__PURE__ */ F("section", {
316
427
  "aria-labelledby": "my-applets-heading",
317
- children: [/* @__PURE__ */ k("h2", {
428
+ children: [/* @__PURE__ */ P("h2", {
318
429
  id: "my-applets-heading",
319
430
  className: "mb-3 text-base font-semibold text-text-primary",
320
431
  children: "Your applets"
321
- }), H && !V ? /* @__PURE__ */ k(n, {
432
+ }), G && !W ? /* @__PURE__ */ P(n, {
322
433
  variant: "card",
323
434
  count: 2
324
- }) : U ? /* @__PURE__ */ k(r, {
435
+ }) : K ? /* @__PURE__ */ P(r, {
325
436
  title: "Couldn't load your applets",
326
- description: v(U),
437
+ description: b(K),
327
438
  illustration: "error-state"
328
- }) : X.length === 0 ? /* @__PURE__ */ k(r, {
439
+ }) : X.length === 0 ? /* @__PURE__ */ P(r, {
329
440
  title: "No applets yet",
330
441
  description: "Register your first applet with the manifest editor. The starter manifest uses the sample widget TimeCampus serves.",
331
442
  illustration: "empty-generic"
332
- }) : /* @__PURE__ */ k("div", {
443
+ }) : /* @__PURE__ */ P("div", {
333
444
  className: "flex flex-col gap-4",
334
- children: X.map((e) => /* @__PURE__ */ k(I, {
445
+ children: X.map((e) => /* @__PURE__ */ P(U, {
335
446
  applet: e,
336
- busy: z,
447
+ busy: N,
337
448
  onEditVersion: (t, n, r) => {
338
- E({
449
+ O({
339
450
  kind: "edit",
340
451
  versionId: t,
341
452
  version: n,
342
453
  appletName: e.name
343
- }), O(y(r)), R([]);
454
+ }), A(x(r)), M([]);
344
455
  },
345
456
  onNewVersion: () => {
346
- E({
457
+ O({
347
458
  kind: "version",
348
459
  appletId: e.id,
349
460
  appletName: e.name
350
- }), O(te(e.latestVersion.manifest)), R([]);
461
+ }), A(ne(e.latestVersion.manifest)), M([]);
462
+ },
463
+ onSubmit: (e) => $(() => oe({ variables: { versionId: e } }), "Submitted for review"),
464
+ onWithdraw: (e) => $(() => se({ variables: { versionId: e } }), "Withdrawn from review"),
465
+ marketplace: {
466
+ onOffer: () => void $(() => le({ variables: { appletId: e.id } }), "Sent for platform certification"),
467
+ onWithdraw: () => void $(() => ue({ variables: { appletId: e.id } }), "Withdrawn from platform certification"),
468
+ onDelist: () => {
469
+ window.confirm(`Remove ${e.name} from the marketplace? It is removed from every workspace that installed it.`) && $(() => de({ variables: { appletId: e.id } }), `${e.name} removed from the marketplace`);
470
+ }
351
471
  },
352
- onSubmit: (e) => $(() => Y({ variables: { versionId: e } }), "Submitted for review"),
353
- onWithdraw: (e) => $(() => ie({ variables: { versionId: e } }), "Withdrawn from review"),
354
472
  onArchive: () => {
355
- window.confirm(`Archive ${e.name}? It is removed from every dashboard in this workspace.`) && $(() => ae({ variables: { id: e.id } }), `${e.name} archived`);
473
+ window.confirm(`Archive ${e.name}? It is removed from every dashboard in this workspace and from the marketplace.`) && $(() => ce({ variables: { id: e.id } }), `${e.name} archived`);
356
474
  }
357
475
  }, e.id))
358
476
  })]
@@ -361,6 +479,6 @@ function L() {
361
479
  });
362
480
  }
363
481
  //#endregion
364
- export { L as AppletDeveloperPage };
482
+ export { W as AppletDeveloperPage };
365
483
 
366
484
  //# sourceMappingURL=AppletDeveloperPage.js.map