@burdenoff/microfe-buildmyiq 2026.716.1 → 2026.720.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.
Files changed (85) hide show
  1. package/dist/buildmyiq/BuildmyiqAdminRoot.d.ts.map +1 -1
  2. package/dist/buildmyiq/BuildmyiqAdminRoot.js +149 -135
  3. package/dist/buildmyiq/BuildmyiqAdminRoot.js.map +1 -1
  4. package/dist/buildmyiq/BuildmyiqRoot.d.ts.map +1 -1
  5. package/dist/buildmyiq/BuildmyiqRoot.js +59 -54
  6. package/dist/buildmyiq/BuildmyiqRoot.js.map +1 -1
  7. package/dist/buildmyiq/BuildmyiqRoutes.js.map +1 -1
  8. package/dist/buildmyiq/components/Avatar.js.map +1 -1
  9. package/dist/buildmyiq/components/BuiDiscussion.js.map +1 -1
  10. package/dist/buildmyiq/components/BuiPermissionButton.d.ts +25 -0
  11. package/dist/buildmyiq/components/BuiPermissionButton.d.ts.map +1 -0
  12. package/dist/buildmyiq/components/BuiPermissionButton.js +15 -0
  13. package/dist/buildmyiq/components/BuiPermissionButton.js.map +1 -0
  14. package/dist/buildmyiq/components/BuiTags.js.map +1 -1
  15. package/dist/buildmyiq/components/DataTable.js.map +1 -1
  16. package/dist/buildmyiq/components/EmptyState.js.map +1 -1
  17. package/dist/buildmyiq/components/EvidenceUpload.js.map +1 -1
  18. package/dist/buildmyiq/components/FileLink.js.map +1 -1
  19. package/dist/buildmyiq/components/FilterTabs.js.map +1 -1
  20. package/dist/buildmyiq/components/MetricsCard.js.map +1 -1
  21. package/dist/buildmyiq/components/MiniBar.js.map +1 -1
  22. package/dist/buildmyiq/components/PageLayout.js.map +1 -1
  23. package/dist/buildmyiq/components/Pagination.js.map +1 -1
  24. package/dist/buildmyiq/components/StateViews.js.map +1 -1
  25. package/dist/buildmyiq/components/StatusBadge.js.map +1 -1
  26. package/dist/buildmyiq/components/Tabs.js.map +1 -1
  27. package/dist/buildmyiq/components/Viz.js.map +1 -1
  28. package/dist/buildmyiq/components/index.d.ts +1 -0
  29. package/dist/buildmyiq/components/index.d.ts.map +1 -1
  30. package/dist/buildmyiq/components/index.js +1 -0
  31. package/dist/buildmyiq/context/BuildmyiqContext.js.map +1 -1
  32. package/dist/buildmyiq/hooks/index.d.ts +1 -0
  33. package/dist/buildmyiq/hooks/index.d.ts.map +1 -1
  34. package/dist/buildmyiq/hooks/index.js +1 -0
  35. package/dist/buildmyiq/hooks/useBuiComments.js.map +1 -1
  36. package/dist/buildmyiq/hooks/useBuiFiles.js.map +1 -1
  37. package/dist/buildmyiq/hooks/useBuiPermissions.d.ts +54 -0
  38. package/dist/buildmyiq/hooks/useBuiPermissions.d.ts.map +1 -0
  39. package/dist/buildmyiq/hooks/useBuiPermissions.js +2 -0
  40. package/dist/buildmyiq/hooks/useBuiTags.js.map +1 -1
  41. package/dist/buildmyiq/hooks/useBuildmyiqApi.js.map +1 -1
  42. package/dist/buildmyiq/hooks/useCursorPager.js.map +1 -1
  43. package/dist/buildmyiq/pages/DashboardPage.js.map +1 -1
  44. package/dist/buildmyiq/pages/_shared/CourseCard.js.map +1 -1
  45. package/dist/buildmyiq/pages/assessments/AssessmentDetailPage.js.map +1 -1
  46. package/dist/buildmyiq/pages/assessments/AssessmentsPage.js.map +1 -1
  47. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js.map +1 -1
  48. package/dist/buildmyiq/pages/authoring/AuthoringPage.d.ts.map +1 -1
  49. package/dist/buildmyiq/pages/authoring/AuthoringPage.js +97 -86
  50. package/dist/buildmyiq/pages/authoring/AuthoringPage.js.map +1 -1
  51. package/dist/buildmyiq/pages/authoring/CourseBuilderPage.d.ts.map +1 -1
  52. package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js +159 -118
  53. package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js.map +1 -1
  54. package/dist/buildmyiq/pages/authoring/_forms.js.map +1 -1
  55. package/dist/buildmyiq/pages/catalog/CatalogPage.js.map +1 -1
  56. package/dist/buildmyiq/pages/catalog/CourseDetailPage.d.ts.map +1 -1
  57. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js +75 -69
  58. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js.map +1 -1
  59. package/dist/buildmyiq/pages/certificates/CertificatesPage.d.ts.map +1 -1
  60. package/dist/buildmyiq/pages/certificates/CertificatesPage.js +186 -170
  61. package/dist/buildmyiq/pages/certificates/CertificatesPage.js.map +1 -1
  62. package/dist/buildmyiq/pages/cohorts/CohortsPage.d.ts.map +1 -1
  63. package/dist/buildmyiq/pages/cohorts/CohortsPage.js +177 -166
  64. package/dist/buildmyiq/pages/cohorts/CohortsPage.js.map +1 -1
  65. package/dist/buildmyiq/pages/insights/InsightsPage.js.map +1 -1
  66. package/dist/buildmyiq/pages/learning/LessonPlayerPage.js.map +1 -1
  67. package/dist/buildmyiq/pages/learning/MyLearningPage.js.map +1 -1
  68. package/dist/buildmyiq/pages/paths/PathsPage.js.map +1 -1
  69. package/dist/buildmyiq/pages/skills/SkillsPage.js.map +1 -1
  70. package/dist/buildmyiq/pages/submissions/SubmissionsPage.d.ts.map +1 -1
  71. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +160 -154
  72. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
  73. package/dist/buildmyiq/shared/hooks/useTr.js.map +1 -1
  74. package/dist/buildmyiq/types/index.js.map +1 -1
  75. package/dist/buildmyiq/utils/cn.js.map +1 -1
  76. package/dist/buildmyiq/utils/formatters.js.map +1 -1
  77. package/dist/buildmyiq/utils/navigation.js.map +1 -1
  78. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  79. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1 -1
  80. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  81. package/dist/services/createSandboxAssistantTransport.js.map +1 -1
  82. package/dist/utils/pageContext.d.ts.map +1 -1
  83. package/dist/utils/pageContext.js +7 -2
  84. package/dist/utils/pageContext.js.map +1 -1
  85. package/package.json +2 -2
@@ -11,16 +11,17 @@ import { useBuiArchiveCourse as f, useBuiAssessments as p, useBuiCourse as m, us
11
11
  import "../../hooks/index.js";
12
12
  import { EvidenceUpload as x } from "../../components/EvidenceUpload.js";
13
13
  import { BuiDiscussion as S } from "../../components/BuiDiscussion.js";
14
+ import { BuiPermissionButton as C } from "../../components/BuiPermissionButton.js";
14
15
  import "../../components/index.js";
15
- import { COURSE_LEVELS as C, LESSON_TYPES as w } from "../../types/index.js";
16
- import { Field as T, Modal as E, NO_SKILL as D, SelectField as O } from "./_forms.js";
17
- import { useState as k } from "react";
18
- import { Archive as A, ArrowLeft as j, BarChart3 as M, BookOpen as ee, Calendar as N, ClipboardList as P, Clock as F, Eye as I, FileText as L, Globe as te, Image as ne, Link2 as re, ListChecks as R, MessageSquare as ie, MousePointerClick as ae, PlayCircle as z, Plus as B, Radio as V, Send as H } from "lucide-react";
16
+ import { COURSE_LEVELS as w, LESSON_TYPES as T } from "../../types/index.js";
17
+ import { Field as E, Modal as D, NO_SKILL as O, SelectField as k } from "./_forms.js";
18
+ import { useState as A } from "react";
19
+ import { Archive as j, ArrowLeft as M, BarChart3 as ee, BookOpen as te, Calendar as N, ClipboardList as P, Clock as F, Eye as I, FileText as L, Globe as ne, Image as re, Link2 as ie, ListChecks as R, MessageSquare as ae, MousePointerClick as oe, PlayCircle as z, Plus as B, Radio as V, Send as H } from "lucide-react";
19
20
  import { useParams as U } from "react-router-dom";
20
21
  import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
21
22
  import { Button as q, GlassCard as J, Input as Y, Switch as X, Textarea as Z } from "@burdenoff/fe-libs/ui";
22
23
  //#region src/buildmyiq/pages/authoring/CourseBuilderPage.tsx
23
- var oe = {
24
+ var se = {
24
25
  ARTICLE: {
25
26
  icon: L,
26
27
  tint: "bg-bg-sunken text-text-secondary"
@@ -38,44 +39,49 @@ var oe = {
38
39
  tint: "bg-status-success-bg-subtle text-status-success-text"
39
40
  },
40
41
  INTERACTIVE: {
41
- icon: ae,
42
+ icon: oe,
42
43
  tint: "bg-[color-mix(in_srgb,var(--color-accent-teal)_18%,transparent)] text-[var(--color-accent-teal)]"
43
44
  },
44
45
  LIVE_SESSION: {
45
46
  icon: V,
46
47
  tint: "bg-[color-mix(in_srgb,var(--color-accent-primary)_16%,transparent)] text-[var(--color-accent-primary)]"
47
48
  }
48
- }, se = ({ course: e }) => {
49
- let t = b(), n = y(), r = n.data ?? [], [i, o] = k(e.title), [s, c] = k(e.summary ?? ""), [l, d] = k(e.description ?? ""), [f, p] = k(e.level), [m, h] = k(e.language), [g, _] = k(String(e.estimatedHours ?? 0)), [v, x] = k(e.skillId ?? "__none__"), [S, w] = k(e.isPublic), [E, A] = k(null);
49
+ }, ce = ({ course: e }) => {
50
+ let t = b(), n = y(), r = n.data ?? [], [i, o] = A(e.title), [s, c] = A(e.summary ?? ""), [l, d] = A(e.description ?? ""), [f, p] = A(e.level), [m, h] = A(e.language), [g, _] = A(String(e.estimatedHours ?? 0)), [v, x] = A(e.skillId ?? "__none__"), [S, T] = A(e.isPublic), [D, j] = A(null);
50
51
  return /* @__PURE__ */ G("div", {
51
52
  className: "mx-auto max-w-3xl",
52
53
  children: /* @__PURE__ */ G(u, {
53
54
  title: "Course details",
54
55
  description: "Metadata learners see in the catalog.",
55
- action: /* @__PURE__ */ G(q, {
56
- onClick: async () => {
57
- A(null);
58
- let n = {
59
- title: i.trim() || e.title,
60
- summary: s.trim() || void 0,
61
- description: l.trim() || void 0,
62
- level: f,
63
- language: m.trim() || "en",
64
- estimatedHours: g.trim() ? Number(g) : 0,
65
- skillId: v === "__none__" ? void 0 : v,
66
- isPublic: S
67
- };
68
- try {
69
- await t.mutateAsync({
70
- id: e.id,
71
- input: n
72
- });
73
- } catch (e) {
74
- A(e instanceof Error ? e.message : "Failed to save changes.");
75
- }
76
- },
77
- disabled: t.isPending,
78
- children: t.isPending ? "Saving…" : "Save changes"
56
+ action: /* @__PURE__ */ G(C, {
57
+ resource: "buildmyiq-course",
58
+ action: "update",
59
+ deniedBehavior: "tooltip",
60
+ children: /* @__PURE__ */ G(q, {
61
+ onClick: async () => {
62
+ j(null);
63
+ let n = {
64
+ title: i.trim() || e.title,
65
+ summary: s.trim() || void 0,
66
+ description: l.trim() || void 0,
67
+ level: f,
68
+ language: m.trim() || "en",
69
+ estimatedHours: g.trim() ? Number(g) : 0,
70
+ skillId: v === "__none__" ? void 0 : v,
71
+ isPublic: S
72
+ };
73
+ try {
74
+ await t.mutateAsync({
75
+ id: e.id,
76
+ input: n
77
+ });
78
+ } catch (e) {
79
+ j(e instanceof Error ? e.message : "Failed to save changes.");
80
+ }
81
+ },
82
+ disabled: t.isPending,
83
+ children: t.isPending ? "Saving…" : "Save changes"
84
+ })
79
85
  }),
80
86
  children: /* @__PURE__ */ G(J, {
81
87
  treatment: "plain",
@@ -83,7 +89,7 @@ var oe = {
83
89
  children: /* @__PURE__ */ K("div", {
84
90
  className: "grid gap-4",
85
91
  children: [
86
- /* @__PURE__ */ G(T, {
92
+ /* @__PURE__ */ G(E, {
87
93
  label: "Title",
88
94
  htmlFor: "detail-title",
89
95
  required: !0,
@@ -93,7 +99,7 @@ var oe = {
93
99
  onChange: (e) => o(e.target.value)
94
100
  })
95
101
  }),
96
- /* @__PURE__ */ G(T, {
102
+ /* @__PURE__ */ G(E, {
97
103
  label: "Summary",
98
104
  htmlFor: "detail-summary",
99
105
  children: /* @__PURE__ */ G(Z, {
@@ -104,7 +110,7 @@ var oe = {
104
110
  placeholder: "A short description shown on the catalog card."
105
111
  })
106
112
  }),
107
- /* @__PURE__ */ G(T, {
113
+ /* @__PURE__ */ G(E, {
108
114
  label: "Description",
109
115
  htmlFor: "detail-description",
110
116
  children: /* @__PURE__ */ G(Z, {
@@ -118,18 +124,18 @@ var oe = {
118
124
  /* @__PURE__ */ K("div", {
119
125
  className: "grid gap-4 sm:grid-cols-2",
120
126
  children: [
121
- /* @__PURE__ */ G(T, {
127
+ /* @__PURE__ */ G(E, {
122
128
  label: "Level",
123
- children: /* @__PURE__ */ G(O, {
129
+ children: /* @__PURE__ */ G(k, {
124
130
  value: f,
125
131
  onChange: (e) => p(e),
126
- options: C.map((e) => ({
132
+ options: w.map((e) => ({
127
133
  value: e,
128
134
  label: a(e)
129
135
  }))
130
136
  })
131
137
  }),
132
- /* @__PURE__ */ G(T, {
138
+ /* @__PURE__ */ G(E, {
133
139
  label: "Language",
134
140
  htmlFor: "detail-language",
135
141
  children: /* @__PURE__ */ G(Y, {
@@ -139,7 +145,7 @@ var oe = {
139
145
  placeholder: "en"
140
146
  })
141
147
  }),
142
- /* @__PURE__ */ G(T, {
148
+ /* @__PURE__ */ G(E, {
143
149
  label: "Estimated hours",
144
150
  htmlFor: "detail-hours",
145
151
  children: /* @__PURE__ */ G(Y, {
@@ -150,13 +156,13 @@ var oe = {
150
156
  onChange: (e) => _(e.target.value)
151
157
  })
152
158
  }),
153
- /* @__PURE__ */ G(T, {
159
+ /* @__PURE__ */ G(E, {
154
160
  label: "Skill",
155
- children: /* @__PURE__ */ G(O, {
161
+ children: /* @__PURE__ */ G(k, {
156
162
  value: v,
157
163
  onChange: x,
158
164
  options: [{
159
- value: D,
165
+ value: O,
160
166
  label: n.isLoading ? "Loading…" : "No skill"
161
167
  }, ...r.map((e) => ({
162
168
  value: e.id,
@@ -170,21 +176,21 @@ var oe = {
170
176
  className: "inline-flex cursor-pointer items-center gap-2 text-sm text-text-secondary",
171
177
  children: [/* @__PURE__ */ G(X, {
172
178
  checked: S,
173
- onCheckedChange: w
179
+ onCheckedChange: T
174
180
  }), "Publicly visible in the catalog"]
175
181
  }),
176
- E && /* @__PURE__ */ G("p", {
182
+ D && /* @__PURE__ */ G("p", {
177
183
  className: "text-sm text-status-error-text",
178
- children: E
184
+ children: D
179
185
  })
180
186
  ]
181
187
  })
182
188
  })
183
189
  })
184
190
  });
185
- }, ce = ({ courseId: e, position: t, onClose: n }) => {
186
- let r = g(), [i, a] = k(""), [o, s] = k(""), [c, l] = k(null), u = i.trim().length > 0 && !r.isPending;
187
- return /* @__PURE__ */ G(E, {
191
+ }, le = ({ courseId: e, position: t, onClose: n }) => {
192
+ let r = g(), [i, a] = A(""), [o, s] = A(""), [c, l] = A(null), u = i.trim().length > 0 && !r.isPending;
193
+ return /* @__PURE__ */ G(D, {
188
194
  open: !0,
189
195
  onClose: n,
190
196
  title: "Add module",
@@ -215,7 +221,7 @@ var oe = {
215
221
  children: /* @__PURE__ */ K("div", {
216
222
  className: "grid gap-4",
217
223
  children: [
218
- /* @__PURE__ */ G(T, {
224
+ /* @__PURE__ */ G(E, {
219
225
  label: "Module title",
220
226
  htmlFor: "module-title",
221
227
  required: !0,
@@ -226,7 +232,7 @@ var oe = {
226
232
  placeholder: "e.g. Getting started"
227
233
  })
228
234
  }),
229
- /* @__PURE__ */ G(T, {
235
+ /* @__PURE__ */ G(E, {
230
236
  label: "Description",
231
237
  htmlFor: "module-description",
232
238
  children: /* @__PURE__ */ G(Z, {
@@ -243,9 +249,9 @@ var oe = {
243
249
  ]
244
250
  })
245
251
  });
246
- }, le = ({ courseId: e, moduleId: t, position: n, onClose: r }) => {
247
- let i = h(), [o, s] = k(""), [c, l] = k("ARTICLE"), [u, d] = k(""), [f, p] = k(""), [m, g] = k(!1), [_, v] = k(null), [y, b] = k(null), S = o.trim().length > 0 && !i.isPending;
248
- return /* @__PURE__ */ G(E, {
252
+ }, ue = ({ courseId: e, moduleId: t, position: n, onClose: r }) => {
253
+ let i = h(), [o, s] = A(""), [c, l] = A("ARTICLE"), [u, d] = A(""), [f, p] = A(""), [m, g] = A(!1), [_, v] = A(null), [y, b] = A(null), S = o.trim().length > 0 && !i.isPending;
254
+ return /* @__PURE__ */ G(D, {
249
255
  open: !0,
250
256
  onClose: r,
251
257
  title: "Add lesson",
@@ -282,7 +288,7 @@ var oe = {
282
288
  children: /* @__PURE__ */ K("div", {
283
289
  className: "grid gap-4",
284
290
  children: [
285
- /* @__PURE__ */ G(T, {
291
+ /* @__PURE__ */ G(E, {
286
292
  label: "Lesson title",
287
293
  htmlFor: "lesson-title",
288
294
  required: !0,
@@ -295,17 +301,17 @@ var oe = {
295
301
  }),
296
302
  /* @__PURE__ */ K("div", {
297
303
  className: "grid gap-4 sm:grid-cols-2",
298
- children: [/* @__PURE__ */ G(T, {
304
+ children: [/* @__PURE__ */ G(E, {
299
305
  label: "Type",
300
- children: /* @__PURE__ */ G(O, {
306
+ children: /* @__PURE__ */ G(k, {
301
307
  value: c,
302
308
  onChange: (e) => l(e),
303
- options: w.map((e) => ({
309
+ options: T.map((e) => ({
304
310
  value: e,
305
311
  label: a(e)
306
312
  }))
307
313
  })
308
- }), /* @__PURE__ */ G(T, {
314
+ }), /* @__PURE__ */ G(E, {
309
315
  label: "Duration (minutes)",
310
316
  htmlFor: "lesson-duration",
311
317
  children: /* @__PURE__ */ G(Y, {
@@ -318,7 +324,7 @@ var oe = {
318
324
  })
319
325
  })]
320
326
  }),
321
- /* @__PURE__ */ G(T, {
327
+ /* @__PURE__ */ G(E, {
322
328
  label: "Content",
323
329
  htmlFor: "lesson-content",
324
330
  hint: "Lesson body — markdown or plain text.",
@@ -350,8 +356,8 @@ var oe = {
350
356
  ]
351
357
  })
352
358
  });
353
- }, ue = ({ lesson: e }) => {
354
- let n = oe[e.type], r = n.icon;
359
+ }, Q = ({ lesson: e }) => {
360
+ let n = se[e.type], r = n.icon;
355
361
  return /* @__PURE__ */ K("li", {
356
362
  className: "flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
357
363
  children: [
@@ -384,7 +390,7 @@ var oe = {
384
390
  })
385
391
  ]
386
392
  });
387
- }, Q = ({ module: e, index: t, onAddLesson: n }) => {
393
+ }, de = ({ module: e, index: t, onAddLesson: n }) => {
388
394
  let r = [...e.lessons ?? []].sort((e, t) => e.position - t.position), a = r.reduce((e, t) => e + (t.durationMin || 0), 0);
389
395
  return /* @__PURE__ */ K(J, {
390
396
  treatment: "plain",
@@ -420,12 +426,17 @@ var oe = {
420
426
  ]
421
427
  })]
422
428
  }),
423
- /* @__PURE__ */ K(q, {
424
- variant: "outline",
425
- size: "sm",
426
- onClick: n,
427
- className: "shrink-0",
428
- children: [/* @__PURE__ */ G(B, { className: "mr-1.5 h-4 w-4" }), " Add lesson"]
429
+ /* @__PURE__ */ G(C, {
430
+ resource: "buildmyiq-lesson",
431
+ action: "create",
432
+ deniedBehavior: "hide",
433
+ children: /* @__PURE__ */ K(q, {
434
+ variant: "outline",
435
+ size: "sm",
436
+ onClick: n,
437
+ className: "shrink-0",
438
+ children: [/* @__PURE__ */ G(B, { className: "mr-1.5 h-4 w-4" }), " Add lesson"]
439
+ })
429
440
  })
430
441
  ]
431
442
  }),
@@ -435,14 +446,19 @@ var oe = {
435
446
  }),
436
447
  /* @__PURE__ */ G("div", {
437
448
  className: "p-3",
438
- children: r.length === 0 ? /* @__PURE__ */ K("button", {
439
- type: "button",
440
- onClick: n,
441
- className: "flex w-full items-center justify-center gap-2 rounded-lg border border-dashed border-border-seam px-3 py-3 text-sm text-text-secondary transition-colors hover:border-[var(--color-action-primary-bg)] hover:text-text-primary",
442
- children: [/* @__PURE__ */ G(B, { className: "h-4 w-4" }), " Add the first lesson"]
449
+ children: r.length === 0 ? /* @__PURE__ */ G(C, {
450
+ resource: "buildmyiq-lesson",
451
+ action: "create",
452
+ deniedBehavior: "hide",
453
+ children: /* @__PURE__ */ K("button", {
454
+ type: "button",
455
+ onClick: n,
456
+ className: "flex w-full items-center justify-center gap-2 rounded-lg border border-dashed border-border-seam px-3 py-3 text-sm text-text-secondary transition-colors hover:border-[var(--color-action-primary-bg)] hover:text-text-primary",
457
+ children: [/* @__PURE__ */ G(B, { className: "h-4 w-4" }), " Add the first lesson"]
458
+ })
443
459
  }) : /* @__PURE__ */ G("ul", {
444
460
  className: "flex flex-col gap-2",
445
- children: r.map((e) => /* @__PURE__ */ G(ue, { lesson: e }, e.id))
461
+ children: r.map((e) => /* @__PURE__ */ G(Q, { lesson: e }, e.id))
446
462
  })
447
463
  })
448
464
  ]
@@ -464,8 +480,8 @@ var oe = {
464
480
  children: n
465
481
  })
466
482
  ]
467
- }), de = ({ course: e }) => {
468
- let t = e.id, n = _(t), i = b(), [o, d] = k(!1), [f, p] = k(null), [m, h] = k(null), [g, v] = k(null), y = [...n.data ?? []].sort((e, t) => e.position - t.position), S = y.find((e) => e.id === f) ?? null;
483
+ }), fe = ({ course: e }) => {
484
+ let t = e.id, n = _(t), i = b(), [o, d] = A(!1), [f, p] = A(null), [m, h] = A(null), [g, v] = A(null), y = [...n.data ?? []].sort((e, t) => e.position - t.position), S = y.find((e) => e.id === f) ?? null;
469
485
  return /* @__PURE__ */ K("div", {
470
486
  className: "grid gap-6 lg:grid-cols-3",
471
487
  children: [
@@ -474,9 +490,14 @@ var oe = {
474
490
  children: /* @__PURE__ */ G(u, {
475
491
  title: "Curriculum",
476
492
  description: "Organise the course into modules and lessons.",
477
- action: /* @__PURE__ */ K(q, {
478
- onClick: () => d(!0),
479
- children: [/* @__PURE__ */ G(B, { className: "mr-1.5 h-4 w-4" }), " Add module"]
493
+ action: /* @__PURE__ */ G(C, {
494
+ resource: "buildmyiq-module",
495
+ action: "create",
496
+ deniedBehavior: "hide",
497
+ children: /* @__PURE__ */ K(q, {
498
+ onClick: () => d(!0),
499
+ children: [/* @__PURE__ */ G(B, { className: "mr-1.5 h-4 w-4" }), " Add module"]
500
+ })
480
501
  }),
481
502
  children: n.isLoading ? /* @__PURE__ */ G(l, { label: "Loading curriculum…" }) : n.isError ? /* @__PURE__ */ G(c, {
482
503
  message: "We couldn't load the curriculum.",
@@ -485,21 +506,31 @@ var oe = {
485
506
  illustration: "onboarding",
486
507
  title: "No modules yet",
487
508
  description: "Add your first module, then fill it with lessons.",
488
- action: /* @__PURE__ */ K(q, {
489
- onClick: () => d(!0),
490
- children: [/* @__PURE__ */ G(B, { className: "mr-1.5 h-4 w-4" }), " Add module"]
509
+ action: /* @__PURE__ */ G(C, {
510
+ resource: "buildmyiq-module",
511
+ action: "create",
512
+ deniedBehavior: "hide",
513
+ children: /* @__PURE__ */ K(q, {
514
+ onClick: () => d(!0),
515
+ children: [/* @__PURE__ */ G(B, { className: "mr-1.5 h-4 w-4" }), " Add module"]
516
+ })
491
517
  })
492
518
  }) : /* @__PURE__ */ K("div", {
493
519
  className: "flex flex-col gap-4",
494
- children: [y.map((e, t) => /* @__PURE__ */ G(Q, {
520
+ children: [y.map((e, t) => /* @__PURE__ */ G(de, {
495
521
  module: e,
496
522
  index: t,
497
523
  onAddLesson: () => p(e.id)
498
- }, e.id)), /* @__PURE__ */ K("button", {
499
- type: "button",
500
- onClick: () => d(!0),
501
- className: "flex w-full items-center justify-center gap-2 rounded-xl border-2 border-dashed border-border-seam px-4 py-4 text-sm font-medium text-text-secondary transition-colors hover:border-[var(--color-action-primary-bg)] hover:bg-bg-sunken/40 hover:text-text-primary",
502
- children: [/* @__PURE__ */ G(B, { className: "h-4 w-4" }), " Add module"]
524
+ }, e.id)), /* @__PURE__ */ G(C, {
525
+ resource: "buildmyiq-module",
526
+ action: "create",
527
+ deniedBehavior: "hide",
528
+ children: /* @__PURE__ */ K("button", {
529
+ type: "button",
530
+ onClick: () => d(!0),
531
+ className: "flex w-full items-center justify-center gap-2 rounded-xl border-2 border-dashed border-border-seam px-4 py-4 text-sm font-medium text-text-secondary transition-colors hover:border-[var(--color-action-primary-bg)] hover:bg-bg-sunken/40 hover:text-text-primary",
532
+ children: [/* @__PURE__ */ G(B, { className: "h-4 w-4" }), " Add module"]
533
+ })
503
534
  })]
504
535
  })
505
536
  })
@@ -526,7 +557,7 @@ var oe = {
526
557
  className: "h-full w-full object-cover"
527
558
  }) : /* @__PURE__ */ K("div", {
528
559
  className: "flex h-full items-center justify-center gap-2 text-sm text-text-tertiary",
529
- children: [/* @__PURE__ */ G(ne, { className: "h-5 w-5" }), " No cover yet"]
560
+ children: [/* @__PURE__ */ G(re, { className: "h-5 w-5" }), " No cover yet"]
530
561
  })
531
562
  }),
532
563
  /* @__PURE__ */ K("div", {
@@ -566,17 +597,17 @@ var oe = {
566
597
  className: "mt-2 flex flex-col divide-y divide-border-seam",
567
598
  children: [
568
599
  /* @__PURE__ */ G($, {
569
- icon: /* @__PURE__ */ G(re, { className: "h-4 w-4" }),
600
+ icon: /* @__PURE__ */ G(ie, { className: "h-4 w-4" }),
570
601
  label: "Slug",
571
602
  value: e.slug
572
603
  }),
573
604
  /* @__PURE__ */ G($, {
574
- icon: /* @__PURE__ */ G(te, { className: "h-4 w-4" }),
605
+ icon: /* @__PURE__ */ G(ne, { className: "h-4 w-4" }),
575
606
  label: "Language",
576
607
  value: e.language ? e.language.toUpperCase() : "—"
577
608
  }),
578
609
  /* @__PURE__ */ G($, {
579
- icon: /* @__PURE__ */ G(M, { className: "h-4 w-4" }),
610
+ icon: /* @__PURE__ */ G(ee, { className: "h-4 w-4" }),
580
611
  label: "Level",
581
612
  value: a(e.level)
582
613
  }),
@@ -594,12 +625,12 @@ var oe = {
594
625
  })]
595
626
  })]
596
627
  }),
597
- o && /* @__PURE__ */ G(ce, {
628
+ o && /* @__PURE__ */ G(le, {
598
629
  courseId: t,
599
630
  position: y.length,
600
631
  onClose: () => d(!1)
601
632
  }),
602
- f && /* @__PURE__ */ G(le, {
633
+ f && /* @__PURE__ */ G(ue, {
603
634
  courseId: t,
604
635
  moduleId: f,
605
636
  position: S?.lessons?.length ?? 0,
@@ -607,7 +638,7 @@ var oe = {
607
638
  })
608
639
  ]
609
640
  });
610
- }, fe = ({ courseId: t }) => {
641
+ }, pe = ({ courseId: t }) => {
611
642
  let { navigateTo: n } = e(), r = p(t), d = r.data ?? [];
612
643
  return /* @__PURE__ */ G(u, {
613
644
  title: "Assessments",
@@ -668,8 +699,8 @@ var oe = {
668
699
  }, e.id))
669
700
  })
670
701
  });
671
- }, pe = () => {
672
- let { courseId: t } = U(), { navigateTo: r } = e(), [i, a] = k("details"), u = m(t), p = u.data ?? null, h = v(), g = f(), [_, y] = k(null), [b, x] = k(!1), C = async () => {
702
+ }, me = () => {
703
+ let { courseId: t } = U(), { navigateTo: r } = e(), [i, a] = A("details"), u = m(t), p = u.data ?? null, h = v(), g = f(), [_, y] = A(null), [b, x] = A(!1), w = async () => {
673
704
  if (p) {
674
705
  y(null);
675
706
  try {
@@ -678,7 +709,7 @@ var oe = {
678
709
  y(e instanceof Error ? e.message : "Failed to publish the course.");
679
710
  }
680
711
  }
681
- }, w = async () => {
712
+ }, T = async () => {
682
713
  if (p) {
683
714
  y(null);
684
715
  try {
@@ -711,7 +742,7 @@ var oe = {
711
742
  })
712
743
  })
713
744
  });
714
- let T = p.status === "DRAFT" || p.status === "IN_REVIEW", D = p.status !== "ARCHIVED", O = [
745
+ let E = p.status === "DRAFT" || p.status === "IN_REVIEW", O = p.status !== "ARCHIVED", k = [
715
746
  {
716
747
  value: "details",
717
748
  label: "Details",
@@ -720,7 +751,7 @@ var oe = {
720
751
  {
721
752
  value: "curriculum",
722
753
  label: "Curriculum",
723
- icon: /* @__PURE__ */ G(ee, { className: "h-4 w-4" }),
754
+ icon: /* @__PURE__ */ G(te, { className: "h-4 w-4" }),
724
755
  count: p.modules?.length ?? 0
725
756
  },
726
757
  {
@@ -731,7 +762,7 @@ var oe = {
731
762
  {
732
763
  value: "discussion",
733
764
  label: "Discussion",
734
- icon: /* @__PURE__ */ G(ie, { className: "h-4 w-4" })
765
+ icon: /* @__PURE__ */ G(ae, { className: "h-4 w-4" })
735
766
  }
736
767
  ];
737
768
  return /* @__PURE__ */ K(n, {
@@ -751,17 +782,27 @@ var oe = {
751
782
  /* @__PURE__ */ K(q, {
752
783
  variant: "ghost",
753
784
  onClick: () => r("authoring"),
754
- children: [/* @__PURE__ */ G(j, { className: "mr-1.5 h-4 w-4" }), " Back"]
785
+ children: [/* @__PURE__ */ G(M, { className: "mr-1.5 h-4 w-4" }), " Back"]
755
786
  }),
756
- D && /* @__PURE__ */ K(q, {
757
- variant: "outline",
758
- onClick: () => x(!0),
759
- children: [/* @__PURE__ */ G(A, { className: "mr-1.5 h-4 w-4" }), " Archive"]
787
+ O && /* @__PURE__ */ G(C, {
788
+ resource: "buildmyiq-course",
789
+ action: "delete",
790
+ deniedBehavior: "hide",
791
+ children: /* @__PURE__ */ K(q, {
792
+ variant: "outline",
793
+ onClick: () => x(!0),
794
+ children: [/* @__PURE__ */ G(j, { className: "mr-1.5 h-4 w-4" }), " Archive"]
795
+ })
760
796
  }),
761
- T && /* @__PURE__ */ K(q, {
762
- onClick: C,
763
- disabled: h.isPending,
764
- children: [/* @__PURE__ */ G(H, { className: "mr-1.5 h-4 w-4" }), h.isPending ? "Publishing…" : "Publish"]
797
+ E && /* @__PURE__ */ G(C, {
798
+ resource: "buildmyiq-course",
799
+ action: "update",
800
+ deniedBehavior: "hide",
801
+ children: /* @__PURE__ */ K(q, {
802
+ onClick: w,
803
+ disabled: h.isPending,
804
+ children: [/* @__PURE__ */ G(H, { className: "mr-1.5 h-4 w-4" }), h.isPending ? "Publishing…" : "Publish"]
805
+ })
765
806
  })
766
807
  ] }),
767
808
  children: [/* @__PURE__ */ K("div", {
@@ -772,19 +813,19 @@ var oe = {
772
813
  children: _
773
814
  }),
774
815
  /* @__PURE__ */ G(d, {
775
- items: O,
816
+ items: k,
776
817
  value: i,
777
818
  onChange: a
778
819
  }),
779
- i === "details" && /* @__PURE__ */ G(se, { course: p }, p.id),
780
- i === "curriculum" && /* @__PURE__ */ G(de, { course: p }),
781
- i === "assessments" && /* @__PURE__ */ G(fe, { courseId: t }),
820
+ i === "details" && /* @__PURE__ */ G(ce, { course: p }, p.id),
821
+ i === "curriculum" && /* @__PURE__ */ G(fe, { course: p }),
822
+ i === "assessments" && /* @__PURE__ */ G(pe, { courseId: t }),
782
823
  i === "discussion" && /* @__PURE__ */ G(S, {
783
824
  entityType: "buildmyiq-course",
784
825
  entityId: t
785
826
  })
786
827
  ]
787
- }), b && /* @__PURE__ */ G(E, {
828
+ }), b && /* @__PURE__ */ G(D, {
788
829
  open: !0,
789
830
  onClose: () => x(!1),
790
831
  title: "Archive this course?",
@@ -796,7 +837,7 @@ var oe = {
796
837
  children: "Cancel"
797
838
  }), /* @__PURE__ */ G(q, {
798
839
  variant: "destructive",
799
- onClick: w,
840
+ onClick: T,
800
841
  disabled: g.isPending,
801
842
  children: g.isPending ? "Archiving…" : "Archive course"
802
843
  })] }),
@@ -808,6 +849,6 @@ var oe = {
808
849
  });
809
850
  };
810
851
  //#endregion
811
- export { pe as CourseBuilderPage };
852
+ export { me as CourseBuilderPage };
812
853
 
813
854
  //# sourceMappingURL=CourseBuilderPage.js.map