@instructure/platform-rubrics 2.0.0 → 2.1.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 (38) hide show
  1. package/README.md +12 -0
  2. package/dist/_internal/RubricAssessment/components/TraditionalViewCriterionPoints.d.ts +2 -0
  3. package/dist/_internal/RubricAssessment/components/TraditionalViewCriterionPoints.d.ts.map +1 -1
  4. package/dist/_internal/RubricAssessment/components/TraditionalViewCriterionRow.d.ts +1 -0
  5. package/dist/_internal/RubricAssessment/components/TraditionalViewCriterionRow.d.ts.map +1 -1
  6. package/dist/_internal/RubricAssessment/useRubricViewMode.d.ts +3 -1
  7. package/dist/_internal/RubricAssessment/useRubricViewMode.d.ts.map +1 -1
  8. package/dist/_internal/RubricAssignment/hooks/useAssignmentRubricState.d.ts.map +1 -1
  9. package/dist/_internal/RubricAssignment/hooks/useRubricSelfAssessmentSettings.d.ts.map +1 -1
  10. package/dist/_internal/RubricForm/useGenerateCriteria.d.ts.map +1 -1
  11. package/dist/_internal/RubricForm/useOutcomeDialog.d.ts.map +1 -1
  12. package/dist/_internal/RubricForm/useRegenerateCriteria.d.ts.map +1 -1
  13. package/dist/_internal/RubricForm/useSaveRubricForm.d.ts.map +1 -1
  14. package/dist/_internal/RubricForm/useSubmitRubricFeedback.d.ts.map +1 -1
  15. package/dist/_internal/RubricForm/utils.d.ts +1 -0
  16. package/dist/_internal/RubricForm/utils.d.ts.map +1 -1
  17. package/dist/_internal/ViewRubrics/useRubricImport.d.ts.map +1 -1
  18. package/dist/_internal/ViewRubrics/useRubricMutations.d.ts.map +1 -1
  19. package/dist/_internal/ViewRubrics/useRubricsQuery.d.ts.map +1 -1
  20. package/dist/_internal/ViewRubrics/useViewRubrics.d.ts.map +1 -1
  21. package/dist/_internal/hooks/useRubricsPlatformUiContext.d.ts +2 -0
  22. package/dist/_internal/hooks/useRubricsPlatformUiContext.d.ts.map +1 -1
  23. package/dist/canvas/RubricForm/components/AIGeneratedCriteria/GeneratedCriteriaForm.d.ts.map +1 -1
  24. package/dist/canvas/RubricForm/components/AssignmentPointsDifferenceModal.d.ts.map +1 -1
  25. package/dist/canvas/RubricForm/components/RubricFormFooter.d.ts.map +1 -1
  26. package/dist/canvas/RubricForm/index.d.ts +1 -0
  27. package/dist/canvas/RubricForm/index.d.ts.map +1 -1
  28. package/dist/canvas/ViewRubrics/UsedLocationsModal.d.ts.map +1 -1
  29. package/dist/canvas.js +3686 -3659
  30. package/dist/chunks/{ErrorShip-DEitKD2c.js → ErrorShip-ie9F1gVL.js} +486 -479
  31. package/dist/foundation/RubricBuilder/RubricBuilder.d.ts +19 -1
  32. package/dist/foundation/RubricBuilder/RubricBuilder.d.ts.map +1 -1
  33. package/dist/foundation/RubricBuilder/components/PointsDifferenceModal.d.ts +12 -0
  34. package/dist/foundation/RubricBuilder/components/PointsDifferenceModal.d.ts.map +1 -0
  35. package/dist/foundation/index.d.ts +1 -1
  36. package/dist/foundation/index.d.ts.map +1 -1
  37. package/dist/foundation.js +485 -373
  38. package/package.json +18 -19
@@ -1,30 +1,34 @@
1
- import { g as Le, u as De, R as Pe, r as Te, e as ie, b as Ee } from "./chunks/errorPage-Jon3K-u6.js";
2
- import { D as ti, a as ni } from "./chunks/errorPage-Jon3K-u6.js";
1
+ import { g as Ue, u as _e, R as qe, r as Fe, e as le, b as $e } from "./chunks/errorPage-Jon3K-u6.js";
2
+ import { D as Si, a as Di } from "./chunks/errorPage-Jon3K-u6.js";
3
3
  import "@instructure/platform-provider";
4
- import { useState as x, useEffect as F, useRef as Z, useCallback as xe } from "react";
5
- import { jsx as e, jsxs as c, Fragment as ke } from "react/jsx-runtime";
6
- import { Heading as _ } from "@instructure/ui-heading";
4
+ import { useState as T, useEffect as F, useRef as ne, useCallback as ze } from "react";
5
+ import { jsx as e, jsxs as m, Fragment as Ge } from "react/jsx-runtime";
6
+ import { Heading as N } from "@instructure/ui-heading";
7
7
  import { View as h } from "@instructure/ui-view";
8
- import { Button as N, CloseButton as Ae, IconButton as X } from "@instructure/ui-buttons";
9
- import { Flex as C } from "@instructure/ui-flex";
10
- import { SimpleSelect as J } from "@instructure/ui-simple-select";
11
- import { Spinner as Oe } from "@instructure/ui-spinner";
12
- import { Text as D } from "@instructure/ui-text";
13
- import { useQuery as Ne } from "@tanstack/react-query";
14
- import { u as Me, T as le, t as oe, i as se, a as L, p as _e, b as de, c as te, C as ce, d as ne, e as He, f as ue, g as Y, s as me, K as be, P as ge, r as Ue, D as he, S as pe, v as fe, h as qe, j as Fe, k as ze, l as Ge, m as We, n as $e, o as je, w as ae, q as Ke, x as Qe, y as Ve, z as Xe, A as Ye, B as Je, E as Ze, F as er } from "./chunks/ErrorShip-DEitKD2c.js";
15
- import rr from "graphql-tag";
16
- import { LoadingIndicator as ir } from "@instructure/platform-loading-indicator";
17
- import { Alert as tr } from "@instructure/ui-alerts";
18
- import { IconDragHandleLine as Ce, IconTrashLine as ve, IconAddLine as Re, IconArrowOpenDownLine as nr, IconArrowOpenEndLine as ar, IconCommentLine as lr, IconDuplicateLine as or } from "@instructure/ui-icons";
8
+ import { Button as A, CloseButton as We, IconButton as Y } from "@instructure/ui-buttons";
9
+ import { Flex as v } from "@instructure/ui-flex";
10
+ import { SimpleSelect as te } from "@instructure/ui-simple-select";
11
+ import { Spinner as je } from "@instructure/ui-spinner";
12
+ import { Text as P } from "@instructure/ui-text";
13
+ import { useQuery as Ke } from "@tanstack/react-query";
14
+ import { u as me, T as be, t as ge, i as pe, a as L, p as Qe, b as he, c as se, C as fe, d as de, e as Ve, f as Ce, g as J, s as ve, K as Re, P as Be, r as Xe, D as ye, S as Se, v as De, h as Ye, j as Ze, k as Je, l as er, m as rr, n as ir, o as tr, w as ce, q as nr, x as ar, y as or, z as lr, A as sr, B as dr, E as cr, F as ur, G as mr } from "./chunks/ErrorShip-ie9F1gVL.js";
15
+ import br from "graphql-tag";
16
+ import { LoadingIndicator as gr } from "@instructure/platform-loading-indicator";
17
+ import { Alert as pr } from "@instructure/ui-alerts";
18
+ import { IconDragHandleLine as Ie, IconTrashLine as Le, IconAddLine as we, IconArrowOpenDownLine as hr, IconArrowOpenEndLine as fr, IconCommentLine as Cr, IconDuplicateLine as vr } from "@instructure/ui-icons";
19
19
  import { Modal as Q } from "@instructure/ui-modal";
20
- import { ScreenReaderContent as sr } from "@instructure/ui-a11y-content";
21
- import { Checkbox as dr } from "@instructure/ui-checkbox";
22
- import { Pill as Be } from "@instructure/ui-pill";
23
- import { TextArea as cr } from "@instructure/ui-text-area";
24
- import { TextInput as z } from "@instructure/ui-text-input";
25
- import { NumberInput as ur } from "@instructure/ui-number-input";
26
- import { RadioInputGroup as mr, RadioInput as br } from "@instructure/ui-radio-input";
27
- const Jr = () => /* @__PURE__ */ e(h, { as: "div", padding: "small", children: /* @__PURE__ */ e(_, { level: "h2", children: Le("foundation") }) }), gr = rr`
20
+ import { ScreenReaderContent as Rr } from "@instructure/ui-a11y-content";
21
+ import { Checkbox as Br } from "@instructure/ui-checkbox";
22
+ import { Pill as Te } from "@instructure/ui-pill";
23
+ import { TextArea as yr } from "@instructure/ui-text-area";
24
+ import { TextInput as $ } from "@instructure/ui-text-input";
25
+ import { NumberInput as Sr } from "@instructure/ui-number-input";
26
+ import { CloseButton as Dr, Button as ue } from "@instructure/ui-buttons/v11_7";
27
+ import { Heading as Ir } from "@instructure/ui-heading/v11_7";
28
+ import { Modal as V } from "@instructure/ui-modal/v11_7";
29
+ import { Text as Lr } from "@instructure/ui-text/v11_7";
30
+ import { RadioInputGroup as wr, RadioInput as Tr } from "@instructure/ui-radio-input";
31
+ const Ci = () => /* @__PURE__ */ e(h, { as: "div", padding: "small", children: /* @__PURE__ */ e(N, { level: "h2", children: Ue("foundation") }) }), Pr = br`
28
32
  query CourseRubricsList($courseId: ID!, $first: Int) {
29
33
  course(id: $courseId) {
30
34
  rubricsConnection(first: $first) {
@@ -42,16 +46,16 @@ const Jr = () => /* @__PURE__ */ e(h, { as: "div", padding: "small", children: /
42
46
  }
43
47
  }
44
48
  `;
45
- function hr(r) {
46
- const { executeQuery: a } = Me();
47
- return Ne({
49
+ function kr(r) {
50
+ const { executeQuery: a } = me();
51
+ return Ke({
48
52
  queryKey: ["courseRubrics", r],
49
53
  queryFn: async () => {
50
54
  var n;
51
- const { course: s } = await a(gr, {
55
+ const { course: o } = await a(Pr, {
52
56
  courseId: r,
53
57
  first: 50
54
- }), i = s == null ? void 0 : s.rubricsConnection;
58
+ }), i = o == null ? void 0 : o.rubricsConnection;
55
59
  return {
56
60
  rubrics: ((i == null ? void 0 : i.nodes) ?? []).filter(
57
61
  (t) => t != null
@@ -62,303 +66,303 @@ function hr(r) {
62
66
  enabled: !!r
63
67
  });
64
68
  }
65
- const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, children: /* @__PURE__ */ e(pr, { ...r }) }), pr = ({
69
+ const vi = (r) => /* @__PURE__ */ e(be, { translations: pe, translate: ge, children: /* @__PURE__ */ e(Er, { ...r }) }), Er = ({
66
70
  courseId: r,
67
71
  value: a,
68
- onChange: s
72
+ onChange: o
69
73
  }) => {
70
- const { translations: i } = L(), { data: n, isLoading: t, isError: l, refetch: o } = hr(r), u = n == null ? void 0 : n.rubrics;
71
- return t ? /* @__PURE__ */ c(h, { as: "div", role: "status", "aria-live": "polite", margin: "0 0 medium", children: [
72
- /* @__PURE__ */ e(Oe, { renderTitle: i.rubricSelectorLoading, size: "x-small" }),
73
- /* @__PURE__ */ e(h, { as: "span", padding: "0 0 0 x-small", children: /* @__PURE__ */ e(D, { size: "small", children: i.rubricSelectorLoading }) })
74
- ] }) : l ? /* @__PURE__ */ e(h, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ c(C, { gap: "small", alignItems: "center", wrap: "wrap", children: [
75
- /* @__PURE__ */ e(C.Item, { children: /* @__PURE__ */ c(D, { size: "small", color: "danger", children: [
74
+ const { translations: i } = L(), { data: n, isLoading: t, isError: s, refetch: c } = kr(r), b = n == null ? void 0 : n.rubrics;
75
+ return t ? /* @__PURE__ */ m(h, { as: "div", role: "status", "aria-live": "polite", margin: "0 0 medium", children: [
76
+ /* @__PURE__ */ e(je, { renderTitle: i.rubricSelectorLoading, size: "x-small" }),
77
+ /* @__PURE__ */ e(h, { as: "span", padding: "0 0 0 x-small", children: /* @__PURE__ */ e(P, { size: "small", children: i.rubricSelectorLoading }) })
78
+ ] }) : s ? /* @__PURE__ */ e(h, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ m(v, { gap: "small", alignItems: "center", wrap: "wrap", children: [
79
+ /* @__PURE__ */ e(v.Item, { children: /* @__PURE__ */ m(P, { size: "small", color: "danger", children: [
76
80
  i.rubricSelectorErrorTitle,
77
81
  ". ",
78
82
  i.rubricSelectorErrorBody
79
83
  ] }) }),
80
- /* @__PURE__ */ e(C.Item, { children: /* @__PURE__ */ e(N, { size: "small", onClick: () => o(), children: i.rubricSelectorRetry }) })
81
- ] }) }) : !u || u.length === 0 ? /* @__PURE__ */ e(h, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ e(D, { size: "small", children: i.rubricSelectorEmpty }) }) : /* @__PURE__ */ c(h, { as: "div", margin: "0 0 medium", maxWidth: "360px", children: [
82
- /* @__PURE__ */ c(
83
- J,
84
+ /* @__PURE__ */ e(v.Item, { children: /* @__PURE__ */ e(A, { size: "small", onClick: () => c(), children: i.rubricSelectorRetry }) })
85
+ ] }) }) : !b || b.length === 0 ? /* @__PURE__ */ e(h, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ e(P, { size: "small", children: i.rubricSelectorEmpty }) }) : /* @__PURE__ */ m(h, { as: "div", margin: "0 0 medium", maxWidth: "360px", children: [
86
+ /* @__PURE__ */ m(
87
+ te,
84
88
  {
85
89
  renderLabel: i.rubricSelectorLabel,
86
90
  assistiveText: i.rubricSelectorAssistiveText,
87
91
  value: a ?? "",
88
- onChange: (b, { value: p }) => {
89
- if (typeof p != "string" || !p) return;
90
- const g = u.find((d) => d.id === p);
91
- s(p, (g == null ? void 0 : g.title) ?? "");
92
+ onChange: (g, { value: l }) => {
93
+ if (typeof l != "string" || !l) return;
94
+ const u = b.find((d) => d.id === l);
95
+ o(l, (u == null ? void 0 : u.title) ?? "");
92
96
  },
93
97
  children: [
94
- a === void 0 && /* @__PURE__ */ e(J.Option, { id: "rubrics-rubric-selector-placeholder", value: "", children: i.rubricSelectorPlaceholder }),
95
- u.map((b) => /* @__PURE__ */ e(
96
- J.Option,
98
+ a === void 0 && /* @__PURE__ */ e(te.Option, { id: "rubrics-rubric-selector-placeholder", value: "", children: i.rubricSelectorPlaceholder }),
99
+ b.map((g) => /* @__PURE__ */ e(
100
+ te.Option,
97
101
  {
98
- id: `rubrics-rubric-selector-option-${b.id}`,
99
- value: b.id,
100
- children: b.title || i.rubricSelectorUntitled
102
+ id: `rubrics-rubric-selector-option-${g.id}`,
103
+ value: g.id,
104
+ children: g.title || i.rubricSelectorUntitled
101
105
  },
102
- b.id
106
+ g.id
103
107
  ))
104
108
  ]
105
109
  }
106
110
  ),
107
- (n == null ? void 0 : n.hasMore) && /* @__PURE__ */ e(h, { as: "div", padding: "xx-small 0 0", children: /* @__PURE__ */ e(D, { size: "x-small", color: "secondary", children: i.rubricSelectorTruncated }) })
111
+ (n == null ? void 0 : n.hasMore) && /* @__PURE__ */ e(h, { as: "div", padding: "xx-small 0 0", children: /* @__PURE__ */ e(P, { size: "x-small", color: "secondary", children: i.rubricSelectorTruncated }) })
108
112
  ] });
109
- }, ee = ({
113
+ }, Z = ({
110
114
  isOpen: r,
111
115
  heading: a,
112
- body: s,
116
+ body: o,
113
117
  confirmLabel: i,
114
118
  cancelLabel: n,
115
119
  onConfirm: t,
116
- onDismiss: l,
117
- "data-testid": o
120
+ onDismiss: s,
121
+ "data-testid": c
118
122
  }) => {
119
- const { translations: u } = L();
120
- return /* @__PURE__ */ c(Q, { open: r, onDismiss: l, size: "small", label: a, "data-testid": o, children: [
121
- /* @__PURE__ */ c(Q.Header, { children: [
123
+ const { translations: b } = L();
124
+ return /* @__PURE__ */ m(Q, { open: r, onDismiss: s, size: "small", label: a, "data-testid": c, children: [
125
+ /* @__PURE__ */ m(Q.Header, { children: [
122
126
  /* @__PURE__ */ e(
123
- Ae,
127
+ We,
124
128
  {
125
129
  placement: "end",
126
130
  offset: "small",
127
- onClick: l,
128
- screenReaderLabel: u.close
131
+ onClick: s,
132
+ screenReaderLabel: b.close
129
133
  }
130
134
  ),
131
- /* @__PURE__ */ e(_, { level: "h2", children: a })
135
+ /* @__PURE__ */ e(N, { level: "h2", children: a })
132
136
  ] }),
133
- /* @__PURE__ */ e(Q.Body, { children: /* @__PURE__ */ e(D, { children: s }) }),
134
- /* @__PURE__ */ c(Q.Footer, { children: [
135
- /* @__PURE__ */ e(N, { onClick: l, margin: "0 x-small 0 0", children: n }),
136
- /* @__PURE__ */ e(N, { color: "primary", onClick: t, "data-testid": "confirm-modal-confirm", children: i })
137
+ /* @__PURE__ */ e(Q.Body, { children: /* @__PURE__ */ e(P, { children: o }) }),
138
+ /* @__PURE__ */ m(Q.Footer, { children: [
139
+ /* @__PURE__ */ e(A, { onClick: s, margin: "0 x-small 0 0", children: n }),
140
+ /* @__PURE__ */ e(A, { color: "primary", onClick: t, "data-testid": "confirm-modal-confirm", children: i })
137
141
  ] })
138
142
  ] });
139
- }, fr = ({
143
+ }, xr = ({
140
144
  criteriaCount: r,
141
145
  showMissingCriteriaError: a,
142
- actions: s,
146
+ actions: o,
143
147
  children: i
144
148
  }) => {
145
149
  const { translations: n } = L();
146
- return /* @__PURE__ */ c(h, { as: "section", "aria-labelledby": "rubric-builder-criteria-heading", children: [
147
- /* @__PURE__ */ c(C, { justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
148
- /* @__PURE__ */ e(_, { level: "h3", id: "rubric-builder-criteria-heading", children: n.rubricBuilderCriteriaHeading }),
149
- s && /* @__PURE__ */ e(C, { gap: "small", wrap: "wrap", children: s })
150
+ return /* @__PURE__ */ m(h, { as: "section", "aria-labelledby": "rubric-builder-criteria-heading", children: [
151
+ /* @__PURE__ */ m(v, { justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
152
+ /* @__PURE__ */ e(N, { level: "h3", id: "rubric-builder-criteria-heading", children: n.rubricBuilderCriteriaHeading }),
153
+ o && /* @__PURE__ */ e(v, { gap: "small", wrap: "wrap", children: o })
150
154
  ] }),
151
- /* @__PURE__ */ e(h, { as: "div", margin: "small 0 0", children: r === 0 ? /* @__PURE__ */ e(D, { color: "secondary", children: n.rubricBuilderCriteriaEmpty }) : i }),
152
- /* @__PURE__ */ e("div", { "aria-live": "polite", children: a && r === 0 && /* @__PURE__ */ e(D, { color: "danger", "data-testid": "rubric-builder-criteria-error", children: n.rubricBuilderAddCriterionError }) })
155
+ /* @__PURE__ */ e(h, { as: "div", margin: "small 0 0", children: r === 0 ? /* @__PURE__ */ e(P, { color: "secondary", children: n.rubricBuilderCriteriaEmpty }) : i }),
156
+ /* @__PURE__ */ e("div", { "aria-live": "polite", children: a && r === 0 && /* @__PURE__ */ e(P, { color: "danger", "data-testid": "rubric-builder-criteria-error", children: n.rubricBuilderAddCriterionError }) })
153
157
  ] });
154
- }, Cr = ({ points: r, onCommit: a }) => {
155
- const { translations: s } = L(), [i, n] = x(String(r));
158
+ }, Mr = ({ points: r, onCommit: a }) => {
159
+ const { translations: o } = L(), [i, n] = T(String(r));
156
160
  return F(() => {
157
161
  n(String(r));
158
162
  }, [r]), /* @__PURE__ */ e(
159
- z,
163
+ $,
160
164
  {
161
- renderLabel: s.rubricBuilderPointsPossibleLabel,
165
+ renderLabel: o.rubricBuilderPointsPossibleLabel,
162
166
  width: "8rem",
163
167
  value: i,
164
168
  onChange: (t) => n(t.target.value),
165
169
  onBlur: (t) => {
166
- const l = _e(t.target.value);
167
- n(String(l)), l !== r && a(l);
170
+ const s = Qe(t.target.value);
171
+ n(String(s)), s !== r && a(s);
168
172
  },
169
173
  "data-testid": "rubric-builder-points-possible"
170
174
  }
171
175
  );
172
- }, vr = ({
176
+ }, Or = ({
173
177
  rating: r,
174
178
  sortableId: a,
175
- position: s,
179
+ position: o,
176
180
  rangeStart: i,
177
181
  useRange: n,
178
182
  hidePoints: t,
179
- showNameError: l,
180
- canRemove: o,
181
- onChange: u,
182
- onPointsBlur: b,
183
- onRemove: p
183
+ showNameError: s,
184
+ canRemove: c,
185
+ onChange: b,
186
+ onPointsBlur: g,
187
+ onRemove: l
184
188
  }) => {
185
- const { translations: g, translate: d } = L(), { attributes: v, listeners: y, setNodeRef: f, transform: I, transition: k } = de({
189
+ const { translations: u, translate: d } = L(), { attributes: C, listeners: D, setNodeRef: f, transform: I, transition: E } = he({
186
190
  id: a
187
- }), [T, S] = x(String(r.points));
191
+ }), [x, y] = T(String(r.points));
188
192
  F(() => {
189
- te(T) !== r.points && S(String(r.points));
193
+ se(x) !== r.points && y(String(r.points));
190
194
  }, [r.points]);
191
- const B = (R, P) => {
192
- S(P), u({ ...r, points: R });
195
+ const B = (R, S) => {
196
+ y(S), b({ ...r, points: R });
193
197
  };
194
198
  return /* @__PURE__ */ e(
195
199
  "div",
196
200
  {
197
201
  ref: f,
198
- style: { transform: ce.Transform.toString(I), transition: k },
202
+ style: { transform: fe.Transform.toString(I), transition: E },
199
203
  "data-testid": "rubric-builder-rating-row",
200
- children: /* @__PURE__ */ c(C, { gap: "small", alignItems: "start", wrap: "wrap", margin: "0 0 small", children: [
204
+ children: /* @__PURE__ */ m(v, { gap: "small", alignItems: "start", wrap: "wrap", margin: "0 0 small", children: [
201
205
  /* @__PURE__ */ e(
202
206
  h,
203
207
  {
204
208
  as: "div",
205
209
  cursor: "grab",
206
210
  margin: "medium 0 0",
207
- "aria-label": d("rubricBuilderReorderRating", { position: s }),
208
- ...v,
209
- ...y,
210
- children: /* @__PURE__ */ e(Ce, { "aria-hidden": "true" })
211
+ "aria-label": d("rubricBuilderReorderRating", { position: o }),
212
+ ...C,
213
+ ...D,
214
+ children: /* @__PURE__ */ e(Ie, { "aria-hidden": "true" })
211
215
  }
212
216
  ),
213
- /* @__PURE__ */ e(h, { as: "div", minWidth: "1.5rem", margin: "medium 0 0", children: /* @__PURE__ */ e(D, { weight: "bold", "aria-hidden": "true", children: s }) }),
214
- !t && /* @__PURE__ */ c(C, { gap: "x-small", alignItems: "end", children: [
215
- n && i !== void 0 && /* @__PURE__ */ e(h, { as: "div", margin: "0 0 x-small", children: /* @__PURE__ */ e(D, { children: d("rangeStartPrefix", { rangeStart: i }) }) }),
217
+ /* @__PURE__ */ e(h, { as: "div", minWidth: "1.5rem", margin: "medium 0 0", children: /* @__PURE__ */ e(P, { weight: "bold", "aria-hidden": "true", children: o }) }),
218
+ !t && /* @__PURE__ */ m(v, { gap: "x-small", alignItems: "end", children: [
219
+ n && i !== void 0 && /* @__PURE__ */ e(h, { as: "div", margin: "0 0 x-small", children: /* @__PURE__ */ e(P, { children: d("rangeStartPrefix", { rangeStart: i }) }) }),
216
220
  /* @__PURE__ */ e(
217
- ur,
221
+ Sr,
218
222
  {
219
- renderLabel: n ? g.rubricBuilderPointRangeLabel : g.rubricBuilderPointsLabel,
223
+ renderLabel: n ? u.rubricBuilderPointRangeLabel : u.rubricBuilderPointsLabel,
220
224
  allowStringValue: !0,
221
225
  showArrows: !1,
222
226
  width: "6rem",
223
- value: T,
224
- onChange: (R, P) => {
225
- He(P) && B(te(P), P);
227
+ value: x,
228
+ onChange: (R, S) => {
229
+ Ve(S) && B(se(S), S);
226
230
  },
227
231
  onIncrement: () => {
228
- const R = ne(Math.floor(r.points) + 1);
232
+ const R = de(Math.floor(r.points) + 1);
229
233
  B(R, String(R));
230
234
  },
231
235
  onDecrement: () => {
232
- const R = ne(Math.floor(r.points) - 1);
236
+ const R = de(Math.floor(r.points) - 1);
233
237
  B(R, String(R));
234
238
  },
235
- onBlur: b,
239
+ onBlur: g,
236
240
  "data-testid": "rubric-builder-rating-points"
237
241
  }
238
242
  )
239
243
  ] }),
240
- /* @__PURE__ */ e(C.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
241
- z,
244
+ /* @__PURE__ */ e(v.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
245
+ $,
242
246
  {
243
- renderLabel: g.rubricBuilderRatingNameLabel,
247
+ renderLabel: u.rubricBuilderRatingNameLabel,
244
248
  isRequired: !0,
245
249
  value: r.description,
246
- onChange: (R) => u({ ...r, description: R.target.value }),
247
- messages: l ? [{ text: g.rubricBuilderRatingNameRequired, type: "error" }] : [],
250
+ onChange: (R) => b({ ...r, description: R.target.value }),
251
+ messages: s ? [{ text: u.rubricBuilderRatingNameRequired, type: "error" }] : [],
248
252
  "data-testid": "rubric-builder-rating-name"
249
253
  }
250
254
  ) }),
251
- /* @__PURE__ */ e(C.Item, { shouldGrow: !0, shouldShrink: !0, size: "14rem", children: /* @__PURE__ */ e(
252
- z,
255
+ /* @__PURE__ */ e(v.Item, { shouldGrow: !0, shouldShrink: !0, size: "14rem", children: /* @__PURE__ */ e(
256
+ $,
253
257
  {
254
- renderLabel: g.rubricBuilderRatingDescriptionLabel,
258
+ renderLabel: u.rubricBuilderRatingDescriptionLabel,
255
259
  value: r.longDescription,
256
- onChange: (R) => u({ ...r, longDescription: R.target.value }),
260
+ onChange: (R) => b({ ...r, longDescription: R.target.value }),
257
261
  "data-testid": "rubric-builder-rating-description"
258
262
  }
259
263
  ) }),
260
- o && /* @__PURE__ */ e(h, { as: "div", margin: "medium 0 0", children: /* @__PURE__ */ e(
261
- X,
264
+ c && /* @__PURE__ */ e(h, { as: "div", margin: "medium 0 0", children: /* @__PURE__ */ e(
265
+ Y,
262
266
  {
263
- screenReaderLabel: d("rubricBuilderRemoveRating", { position: s }),
267
+ screenReaderLabel: d("rubricBuilderRemoveRating", { position: o }),
264
268
  withBackground: !1,
265
269
  withBorder: !1,
266
- onClick: p,
270
+ onClick: l,
267
271
  "data-testid": "rubric-builder-remove-rating",
268
- children: /* @__PURE__ */ e(ve, {})
272
+ children: /* @__PURE__ */ e(Le, {})
269
273
  }
270
274
  ) })
271
275
  ] })
272
276
  }
273
277
  );
274
- }, Rr = ({
278
+ }, Ar = ({
275
279
  ratings: r,
276
280
  useRange: a,
277
- hidePoints: s,
281
+ hidePoints: o,
278
282
  ratingOrder: i,
279
283
  ratingNamesRequired: n,
280
284
  onChange: t
281
285
  }) => {
282
- const { translations: l } = L(), o = ue(
283
- Y(ge, { activationConstraint: { distance: 8 } }),
284
- Y(be, { coordinateGetter: me })
285
- ), u = r.map(Ue), b = i === "ascending", p = r.map((d, v) => b ? r.length - 1 - v : v);
286
- return /* @__PURE__ */ c(h, { as: "div", children: [
287
- /* @__PURE__ */ e(he, { sensors: o, onDragEnd: ({ active: d, over: v }) => {
288
- if (!v || d.id === v.id) return;
289
- const y = u.indexOf(String(d.id)), f = u.indexOf(String(v.id));
290
- y === -1 || f === -1 || t($e({ list: r, startIndex: y, endIndex: f }));
286
+ const { translations: s } = L(), c = Ce(
287
+ J(Be, { activationConstraint: { distance: 8 } }),
288
+ J(Re, { coordinateGetter: ve })
289
+ ), b = r.map(Xe), g = i === "ascending", l = r.map((d, C) => g ? r.length - 1 - C : C);
290
+ return /* @__PURE__ */ m(h, { as: "div", children: [
291
+ /* @__PURE__ */ e(ye, { sensors: c, onDragEnd: ({ active: d, over: C }) => {
292
+ if (!C || d.id === C.id) return;
293
+ const D = b.indexOf(String(d.id)), f = b.indexOf(String(C.id));
294
+ D === -1 || f === -1 || t(ir({ list: r, startIndex: D, endIndex: f }));
291
295
  }, children: /* @__PURE__ */ e(
292
- pe,
296
+ Se,
293
297
  {
294
- items: p.map((d) => u[d]),
295
- strategy: fe,
296
- children: p.map((d, v) => /* @__PURE__ */ e(
297
- vr,
298
+ items: l.map((d) => b[d]),
299
+ strategy: De,
300
+ children: l.map((d, C) => /* @__PURE__ */ e(
301
+ Or,
298
302
  {
299
303
  rating: r[d],
300
- sortableId: u[d],
301
- position: v + 1,
302
- rangeStart: qe(r, d),
304
+ sortableId: b[d],
305
+ position: C + 1,
306
+ rangeStart: Ye(r, d),
303
307
  useRange: a,
304
- hidePoints: s,
308
+ hidePoints: o,
305
309
  showNameError: n.includes(d),
306
310
  canRemove: r.length > 1,
307
- onChange: (y) => t(Ge(r, d, y)),
308
- onPointsBlur: () => t(ze(r)),
309
- onRemove: () => t(Fe(r, d))
311
+ onChange: (D) => t(er(r, d, D)),
312
+ onPointsBlur: () => t(Je(r)),
313
+ onRemove: () => t(Ze(r, d))
310
314
  },
311
- u[d]
315
+ b[d]
312
316
  ))
313
317
  }
314
318
  ) }),
315
319
  /* @__PURE__ */ e(
316
- N,
320
+ A,
317
321
  {
318
- renderIcon: /* @__PURE__ */ e(Re, {}),
322
+ renderIcon: /* @__PURE__ */ e(we, {}),
319
323
  withBackground: !1,
320
- onClick: () => t(We(r, b ? 0 : r.length)),
324
+ onClick: () => t(rr(r, g ? 0 : r.length)),
321
325
  "data-testid": "rubric-builder-add-rating",
322
- children: l.rubricBuilderAddRatingLevel
326
+ children: s.rubricBuilderAddRatingLevel
323
327
  }
324
328
  )
325
329
  ] });
326
- }, Br = ({
330
+ }, Nr = ({
327
331
  criterion: r,
328
332
  sortableId: a,
329
- position: s,
333
+ position: o,
330
334
  hidePoints: i,
331
335
  freeFormCriterionComments: n,
332
336
  ratingOrder: t,
333
- errors: l,
334
- showErrors: o,
335
- shouldFocusName: u,
336
- shouldFocusHandle: b,
337
- onNameFocused: p,
338
- onHandleFocused: g,
337
+ errors: s,
338
+ showErrors: c,
339
+ shouldFocusName: b,
340
+ shouldFocusHandle: g,
341
+ onNameFocused: l,
342
+ onHandleFocused: u,
339
343
  onChange: d,
340
- onDuplicate: v,
341
- onDelete: y
344
+ onDuplicate: C,
345
+ onDelete: D
342
346
  }) => {
343
- const { translations: f, translate: I } = L(), { rubricCriterionRange: k } = De(), { attributes: T, listeners: S, setNodeRef: B, transform: R, transition: P, isDragging: H } = de({
347
+ const { translations: f, translate: I } = L(), { rubricCriterionRange: E } = _e(), { attributes: x, listeners: y, setNodeRef: B, transform: R, transition: S, isDragging: z } = he({
344
348
  id: a
345
- }), [E, G] = x(!r.description.trim()), [W, M] = x(!1), $ = Z(null), j = Z(null), U = o && je(l), K = I("rubricBuilderCriterionHeading", { position: s }), A = r.description.trim(), O = A || K, q = `rubric-builder-criterion-body-${a}`;
349
+ }), [k, G] = T(!r.description.trim()), [ee, M] = T(!1), W = ne(null), j = ne(null), H = c && tr(s), U = I("rubricBuilderCriterionHeading", { position: o }), _ = r.description.trim(), O = _ || U, q = `rubric-builder-criterion-body-${a}`;
346
350
  return F(() => {
347
- U && G(!0);
348
- }, [U]), F(() => {
349
- var m;
350
- u && E && ((m = $.current) == null || m.focus(), p());
351
- }, [u, E, p]), F(() => {
352
- var m;
353
- b && ((m = j.current) == null || m.focus(), g());
354
- }, [b, g]), /* @__PURE__ */ c(
351
+ H && G(!0);
352
+ }, [H]), F(() => {
353
+ var p;
354
+ b && k && ((p = W.current) == null || p.focus(), l());
355
+ }, [b, k, l]), F(() => {
356
+ var p;
357
+ g && ((p = j.current) == null || p.focus(), u());
358
+ }, [g, u]), /* @__PURE__ */ m(
355
359
  "div",
356
360
  {
357
361
  ref: B,
358
- style: { transform: ce.Transform.toString(R), transition: P },
362
+ style: { transform: fe.Transform.toString(R), transition: S },
359
363
  "data-testid": "rubric-builder-criterion-card",
360
364
  children: [
361
- /* @__PURE__ */ c(
365
+ /* @__PURE__ */ m(
362
366
  h,
363
367
  {
364
368
  as: "section",
@@ -368,126 +372,126 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
368
372
  padding: "small medium",
369
373
  margin: "0 0 small",
370
374
  background: "primary",
371
- shadow: H ? "above" : "none",
375
+ shadow: z ? "above" : "none",
372
376
  children: [
373
- /* @__PURE__ */ c(C, { gap: "small", alignItems: "center", wrap: "wrap", children: [
377
+ /* @__PURE__ */ m(v, { gap: "small", alignItems: "center", wrap: "wrap", children: [
374
378
  /* @__PURE__ */ e(
375
379
  "div",
376
380
  {
377
381
  ref: j,
378
382
  "aria-label": I("rubricBuilderReorderCriterion", { name: O }),
379
383
  "data-testid": "rubric-builder-criterion-drag-handle",
380
- ...T,
381
- ...S,
382
- children: /* @__PURE__ */ e(Ce, { "aria-hidden": "true" })
384
+ ...x,
385
+ ...y,
386
+ children: /* @__PURE__ */ e(Ie, { "aria-hidden": "true" })
383
387
  }
384
388
  ),
385
389
  /* @__PURE__ */ e(
386
- X,
390
+ Y,
387
391
  {
388
392
  screenReaderLabel: I(
389
- E ? "rubricBuilderCollapseCriterion" : "rubricBuilderExpandCriterion",
393
+ k ? "rubricBuilderCollapseCriterion" : "rubricBuilderExpandCriterion",
390
394
  { name: O }
391
395
  ),
392
- "aria-expanded": E,
396
+ "aria-expanded": k,
393
397
  "aria-controls": q,
394
398
  withBackground: !1,
395
399
  withBorder: !1,
396
400
  size: "small",
397
- onClick: () => G((m) => !m),
401
+ onClick: () => G((p) => !p),
398
402
  "data-testid": "rubric-builder-criterion-toggle",
399
- children: E ? /* @__PURE__ */ e(nr, {}) : /* @__PURE__ */ e(ar, {})
403
+ children: k ? /* @__PURE__ */ e(hr, {}) : /* @__PURE__ */ e(fr, {})
400
404
  }
401
405
  ),
402
406
  n && /* @__PURE__ */ e(
403
- lr,
407
+ Cr,
404
408
  {
405
409
  title: f.rubricBuilderWrittenFeedback,
406
410
  "data-testid": "rubric-builder-criterion-written-icon"
407
411
  }
408
412
  ),
409
- /* @__PURE__ */ e(C.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ c(_, { level: "h4", children: [
410
- K,
411
- A && /* @__PURE__ */ e(D, { weight: "normal", "data-testid": "rubric-builder-criterion-name", children: `: ${A}` })
413
+ /* @__PURE__ */ e(v.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ m(N, { level: "h4", children: [
414
+ U,
415
+ _ && /* @__PURE__ */ e(P, { weight: "normal", "data-testid": "rubric-builder-criterion-name", children: `: ${_}` })
412
416
  ] }) }),
413
- !i && /* @__PURE__ */ e(Be, { "data-testid": "rubric-builder-criterion-max", children: I("rubricBuilderCriterionMaxPoints", { count: r.points }) }),
417
+ !i && /* @__PURE__ */ e(Te, { "data-testid": "rubric-builder-criterion-max", children: I("rubricBuilderCriterionMaxPoints", { count: r.points }) }),
414
418
  /* @__PURE__ */ e(
415
- X,
419
+ Y,
416
420
  {
417
421
  screenReaderLabel: I("rubricBuilderDuplicateCriterion", { name: O }),
418
422
  withBackground: !1,
419
423
  withBorder: !1,
420
- onClick: v,
424
+ onClick: C,
421
425
  "data-testid": "rubric-builder-duplicate-criterion",
422
- children: /* @__PURE__ */ e(or, {})
426
+ children: /* @__PURE__ */ e(vr, {})
423
427
  }
424
428
  ),
425
429
  /* @__PURE__ */ e(
426
- X,
430
+ Y,
427
431
  {
428
432
  screenReaderLabel: I("rubricBuilderDeleteCriterion", { name: O }),
429
433
  withBackground: !1,
430
434
  withBorder: !1,
431
435
  onClick: () => M(!0),
432
436
  "data-testid": "rubric-builder-delete-criterion",
433
- children: /* @__PURE__ */ e(ve, {})
437
+ children: /* @__PURE__ */ e(Le, {})
434
438
  }
435
439
  )
436
440
  ] }),
437
- E && /* @__PURE__ */ e(h, { as: "div", id: q, margin: "medium 0 0", children: /* @__PURE__ */ c(C, { direction: "column", gap: "medium", children: [
441
+ k && /* @__PURE__ */ e(h, { as: "div", id: q, margin: "medium 0 0", children: /* @__PURE__ */ m(v, { direction: "column", gap: "medium", children: [
438
442
  /* @__PURE__ */ e(
439
- z,
443
+ $,
440
444
  {
441
445
  renderLabel: f.rubricBuilderCriterionNameLabel,
442
446
  isRequired: !0,
443
447
  value: r.description,
444
- inputRef: (m) => {
445
- $.current = m;
448
+ inputRef: (p) => {
449
+ W.current = p;
446
450
  },
447
- onChange: (m) => d({ ...r, description: m.target.value }),
448
- messages: o && l.nameRequired ? [{ text: f.rubricBuilderCriterionNameRequired, type: "error" }] : [],
451
+ onChange: (p) => d({ ...r, description: p.target.value }),
452
+ messages: c && s.nameRequired ? [{ text: f.rubricBuilderCriterionNameRequired, type: "error" }] : [],
449
453
  "data-testid": "rubric-builder-criterion-name-input"
450
454
  }
451
455
  ),
452
456
  /* @__PURE__ */ e(
453
- cr,
457
+ yr,
454
458
  {
455
459
  label: f.rubricBuilderCriterionDescriptionLabel,
456
460
  value: r.longDescription ?? "",
457
- onChange: (m) => d({ ...r, longDescription: m.target.value }),
461
+ onChange: (p) => d({ ...r, longDescription: p.target.value }),
458
462
  "data-testid": "rubric-builder-criterion-description"
459
463
  }
460
464
  ),
461
- k && !i && !n && /* @__PURE__ */ e(
462
- dr,
465
+ E && !i && !n && /* @__PURE__ */ e(
466
+ Br,
463
467
  {
464
468
  variant: "toggle",
465
469
  label: f.rubricBuilderEnableRange,
466
470
  checked: r.criterionUseRange,
467
- onChange: (m) => d({ ...r, criterionUseRange: m.target.checked }),
471
+ onChange: (p) => d({ ...r, criterionUseRange: p.target.checked }),
468
472
  "data-testid": "rubric-builder-enable-range"
469
473
  }
470
474
  ),
471
475
  n ? !i && /* @__PURE__ */ e(
472
- Cr,
476
+ Mr,
473
477
  {
474
478
  points: r.points,
475
- onCommit: (m) => d(
476
- ae(
479
+ onCommit: (p) => d(
480
+ ce(
477
481
  r,
478
- Ke(r.ratings, m)
482
+ nr(r.ratings, p)
479
483
  )
480
484
  )
481
485
  }
482
486
  ) : /* @__PURE__ */ e(
483
- Rr,
487
+ Ar,
484
488
  {
485
489
  ratings: r.ratings,
486
490
  useRange: r.criterionUseRange && !i,
487
491
  hidePoints: i,
488
492
  ratingOrder: t,
489
- ratingNamesRequired: o ? l.ratingNamesRequired : [],
490
- onChange: (m) => d(ae(r, m))
493
+ ratingNamesRequired: c ? s.ratingNamesRequired : [],
494
+ onChange: (p) => d(ce(r, p))
491
495
  }
492
496
  )
493
497
  ] }) })
@@ -495,15 +499,15 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
495
499
  }
496
500
  ),
497
501
  /* @__PURE__ */ e(
498
- ee,
502
+ Z,
499
503
  {
500
- isOpen: W,
504
+ isOpen: ee,
501
505
  heading: f.rubricBuilderCriterionDeleteHeading,
502
506
  body: f.rubricBuilderCriterionDeleteBody,
503
507
  confirmLabel: f.delete,
504
508
  cancelLabel: f.cancel,
505
509
  onConfirm: () => {
506
- M(!1), y();
510
+ M(!1), D();
507
511
  },
508
512
  onDismiss: () => M(!1),
509
513
  "data-testid": "rubric-builder-delete-criterion-modal"
@@ -512,60 +516,106 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
512
516
  ]
513
517
  }
514
518
  );
515
- }, Sr = ({
519
+ }, Hr = ({
516
520
  criteria: r,
517
521
  hidePoints: a,
518
- freeFormCriterionComments: s,
522
+ freeFormCriterionComments: o,
519
523
  ratingOrder: i,
520
524
  criteriaValidationErrors: n,
521
525
  showErrors: t,
522
- focusNameCriterionId: l,
523
- onFocusedName: o,
524
- onChangeCriterion: u,
525
- onDuplicateCriterion: b,
526
- onDeleteCriterion: p,
527
- onReorderCriteria: g
526
+ focusNameCriterionId: s,
527
+ onFocusedName: c,
528
+ onChangeCriterion: b,
529
+ onDuplicateCriterion: g,
530
+ onDeleteCriterion: l,
531
+ onReorderCriteria: u
528
532
  }) => {
529
533
  const {
530
534
  sortableIds: d,
531
- movedCriterionId: v,
532
- clearMovedCriterion: y,
535
+ movedCriterionId: C,
536
+ clearMovedCriterion: D,
533
537
  srAnnouncement: f,
534
538
  moveCriterionBySortableId: I
535
- } = Qe({ criteria: r, onReorderCriteria: g }), k = ue(
536
- Y(ge, { activationConstraint: { distance: 8 } }),
537
- Y(be, { coordinateGetter: me })
539
+ } = ar({ criteria: r, onReorderCriteria: u }), E = Ce(
540
+ J(Be, { activationConstraint: { distance: 8 } }),
541
+ J(Re, { coordinateGetter: ve })
538
542
  );
539
- return /* @__PURE__ */ c(ke, { children: [
540
- /* @__PURE__ */ e(sr, { children: /* @__PURE__ */ e("div", { "aria-live": "polite", "aria-atomic": "true", children: f }) }),
541
- /* @__PURE__ */ e(he, { sensors: k, onDragEnd: ({ active: S, over: B }) => {
542
- B && I(S.id, B.id);
543
- }, children: /* @__PURE__ */ e(pe, { items: d, strategy: fe, children: r.map((S, B) => /* @__PURE__ */ e(
544
- Br,
543
+ return /* @__PURE__ */ m(Ge, { children: [
544
+ /* @__PURE__ */ e(Rr, { children: /* @__PURE__ */ e("div", { "aria-live": "polite", "aria-atomic": "true", children: f }) }),
545
+ /* @__PURE__ */ e(ye, { sensors: E, onDragEnd: ({ active: y, over: B }) => {
546
+ B && I(y.id, B.id);
547
+ }, children: /* @__PURE__ */ e(Se, { items: d, strategy: De, children: r.map((y, B) => /* @__PURE__ */ e(
548
+ Nr,
545
549
  {
546
- criterion: S,
550
+ criterion: y,
547
551
  sortableId: d[B],
548
552
  position: B + 1,
549
553
  hidePoints: a,
550
- freeFormCriterionComments: s,
554
+ freeFormCriterionComments: o,
551
555
  ratingOrder: i,
552
556
  errors: n[B],
553
557
  showErrors: t,
554
- shouldFocusName: S.id === l,
555
- shouldFocusHandle: S.id === v,
556
- onNameFocused: o,
557
- onHandleFocused: y,
558
- onChange: u,
559
- onDuplicate: () => b(S),
560
- onDelete: () => p(S)
558
+ shouldFocusName: y.id === s,
559
+ shouldFocusHandle: y.id === C,
560
+ onNameFocused: c,
561
+ onHandleFocused: D,
562
+ onChange: b,
563
+ onDuplicate: () => g(y),
564
+ onDelete: () => l(y)
561
565
  },
562
566
  d[B]
563
567
  )) }) })
564
568
  ] });
565
- }, yr = ({
569
+ }, Ur = ({
570
+ isOpen: r,
571
+ assignmentPoints: a,
572
+ rubricPoints: o,
573
+ onChange: i,
574
+ onLeaveDifferent: n,
575
+ onDismiss: t
576
+ }) => {
577
+ const { translations: s, translate: c } = L(), { locale: b } = me(), g = or(o, a, b), l = g === null ? c("pointsDifferenceModalBodyZeroAssignmentPoints", { rubricPoints: o }) : c("pointsDifferenceModalBody", { assignmentPoints: a, rubricPoints: o, pointRatio: g });
578
+ return /* @__PURE__ */ m(
579
+ V,
580
+ {
581
+ open: r,
582
+ onDismiss: t,
583
+ size: "small",
584
+ label: s.pointsDifferenceModalLabel,
585
+ "data-testid": "rubric-builder-points-difference-modal",
586
+ children: [
587
+ /* @__PURE__ */ m(V.Header, { children: [
588
+ /* @__PURE__ */ e(
589
+ Dr,
590
+ {
591
+ placement: "end",
592
+ offset: "small",
593
+ onClick: t,
594
+ screenReaderLabel: s.close
595
+ }
596
+ ),
597
+ /* @__PURE__ */ e(Ir, { level: "h2", children: s.confirmToContinueHeader })
598
+ ] }),
599
+ /* @__PURE__ */ e(V.Body, { children: /* @__PURE__ */ e(Lr, { children: l }) }),
600
+ /* @__PURE__ */ m(V.Footer, { children: [
601
+ /* @__PURE__ */ e(
602
+ ue,
603
+ {
604
+ onClick: n,
605
+ margin: "0 x-small 0 0",
606
+ "data-testid": "rubric-builder-leave-points-different",
607
+ children: s.pointsDifferenceModalLeaveDifferent
608
+ }
609
+ ),
610
+ /* @__PURE__ */ e(ue, { color: "primary", onClick: i, "data-testid": "rubric-builder-change-points", children: s.pointsDifferenceModalChange })
611
+ ] })
612
+ ]
613
+ }
614
+ );
615
+ }, _r = ({
566
616
  savePending: r,
567
617
  onDiscard: a,
568
- onSave: s
618
+ onSave: o
569
619
  }) => {
570
620
  const { translations: i } = L();
571
621
  return /* @__PURE__ */ e(
@@ -578,13 +628,13 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
578
628
  borderWidth: "small none none none",
579
629
  padding: "small 0",
580
630
  stacking: "above",
581
- children: /* @__PURE__ */ c(C, { justifyItems: "end", gap: "small", wrap: "wrap", children: [
582
- /* @__PURE__ */ e(N, { onClick: a, "data-testid": "rubric-builder-discard", children: i.rubricBuilderDiscard }),
631
+ children: /* @__PURE__ */ m(v, { justifyItems: "end", gap: "small", wrap: "wrap", children: [
632
+ /* @__PURE__ */ e(A, { onClick: a, "data-testid": "rubric-builder-discard", children: i.rubricBuilderDiscard }),
583
633
  /* @__PURE__ */ e(
584
- N,
634
+ A,
585
635
  {
586
636
  color: "primary",
587
- onClick: s,
637
+ onClick: o,
588
638
  interaction: r ? "disabled" : "enabled",
589
639
  "data-testid": "rubric-builder-save",
590
640
  children: i.rubricBuilderSave
@@ -593,42 +643,42 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
593
643
  ] })
594
644
  }
595
645
  );
596
- }, Ir = ({
646
+ }, qr = ({
597
647
  isNewRubric: r,
598
648
  pointsPossible: a,
599
- hidePoints: s
649
+ hidePoints: o
600
650
  }) => {
601
651
  const { translations: i, translate: n } = L();
602
- return /* @__PURE__ */ c(C, { as: "header", justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
603
- /* @__PURE__ */ e(_, { level: "h2", children: r ? i.rubricBuilderCreateTitle : i.rubricBuilderEditTitle }),
604
- !s && /* @__PURE__ */ e(Be, { "data-testid": "rubric-builder-current-total", children: n("rubricBuilderCurrentTotal", { count: a }) })
652
+ return /* @__PURE__ */ m(v, { as: "header", justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
653
+ /* @__PURE__ */ e(N, { level: "h2", children: r ? i.rubricBuilderCreateTitle : i.rubricBuilderEditTitle }),
654
+ !o && /* @__PURE__ */ e(Te, { "data-testid": "rubric-builder-current-total", children: n("rubricBuilderCurrentTotal", { count: a }) })
605
655
  ] });
606
- }, V = ({ name: r, label: a, value: s, options: i, onChange: n }) => /* @__PURE__ */ e(
607
- mr,
656
+ }, X = ({ name: r, label: a, value: o, options: i, onChange: n }) => /* @__PURE__ */ e(
657
+ wr,
608
658
  {
609
659
  name: r,
610
660
  description: a,
611
661
  variant: "toggle",
612
662
  layout: "columns",
613
- value: s,
614
- onChange: (t, l) => n(l),
615
- children: i.map((t) => /* @__PURE__ */ e(br, { value: t.value, label: t.label }, t.value))
663
+ value: o,
664
+ onChange: (t, s) => n(s),
665
+ children: i.map((t) => /* @__PURE__ */ e(Tr, { value: t.value, label: t.label }, t.value))
616
666
  }
617
- ), wr = ({
667
+ ), Fr = ({
618
668
  rubricForm: r,
619
669
  setRubricFormField: a,
620
- validateTitle: s,
670
+ validateTitle: o,
621
671
  titleError: i,
622
672
  titleInputRef: n
623
673
  }) => {
624
- const { translations: t } = L(), l = (o) => {
625
- if (o === "unscored" === r.hidePoints) return;
626
- const { hidePoints: u, hideScoreTotal: b, useForGrading: p, buttonDisplay: g } = Ve(
674
+ const { translations: t } = L(), s = (c) => {
675
+ if (c === "unscored" === r.hidePoints) return;
676
+ const { hidePoints: b, hideScoreTotal: g, useForGrading: l, buttonDisplay: u } = lr(
627
677
  r.hidePoints
628
678
  );
629
- a("hidePoints", u), a("hideScoreTotal", b), a("useForGrading", p), g && a("buttonDisplay", g);
679
+ a("hidePoints", b), a("hideScoreTotal", g), a("useForGrading", l), u && a("buttonDisplay", u);
630
680
  };
631
- return /* @__PURE__ */ c(
681
+ return /* @__PURE__ */ m(
632
682
  h,
633
683
  {
634
684
  as: "section",
@@ -637,24 +687,24 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
637
687
  borderRadius: "medium",
638
688
  padding: "medium",
639
689
  children: [
640
- /* @__PURE__ */ e(_, { level: "h3", id: "rubric-builder-details-heading", margin: "0 0 medium", children: t.rubricBuilderDetailsHeading }),
641
- /* @__PURE__ */ c(C, { direction: "column", gap: "medium", children: [
690
+ /* @__PURE__ */ e(N, { level: "h3", id: "rubric-builder-details-heading", margin: "0 0 medium", children: t.rubricBuilderDetailsHeading }),
691
+ /* @__PURE__ */ m(v, { direction: "column", gap: "medium", children: [
642
692
  /* @__PURE__ */ e(
643
- z,
693
+ $,
644
694
  {
645
695
  "data-testid": "rubric-builder-name",
646
696
  renderLabel: t.rubricBuilderNameLabel,
647
697
  isRequired: !0,
648
698
  value: r.title,
649
699
  inputRef: n,
650
- onChange: (o) => a("title", o.target.value),
651
- onBlur: (o) => s(o.target.value),
700
+ onChange: (c) => a("title", c.target.value),
701
+ onBlur: (c) => o(c.target.value),
652
702
  messages: i ? [{ text: i, type: "error" }] : []
653
703
  }
654
704
  ),
655
- /* @__PURE__ */ c(C, { gap: "medium", wrap: "wrap", children: [
705
+ /* @__PURE__ */ m(v, { gap: "medium", wrap: "wrap", children: [
656
706
  /* @__PURE__ */ e(
657
- V,
707
+ X,
658
708
  {
659
709
  name: "rubric-builder-scoring",
660
710
  label: t.scoringTypeSelectLabel,
@@ -663,11 +713,11 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
663
713
  { value: "scored", label: t.scoringTypeScored },
664
714
  { value: "unscored", label: t.scoringTypeUnscored }
665
715
  ],
666
- onChange: l
716
+ onChange: s
667
717
  }
668
718
  ),
669
719
  !r.hidePoints && !r.freeFormCriterionComments && /* @__PURE__ */ e(
670
- V,
720
+ X,
671
721
  {
672
722
  name: "rubric-builder-display",
673
723
  label: t.rubricBuilderDisplayLabel,
@@ -676,11 +726,11 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
676
726
  { value: "points", label: t.ratingDisplayPoints },
677
727
  { value: "numeric", label: t.ratingDisplayLevel }
678
728
  ],
679
- onChange: (o) => a("buttonDisplay", o)
729
+ onChange: (c) => a("buttonDisplay", c)
680
730
  }
681
731
  ),
682
732
  /* @__PURE__ */ e(
683
- V,
733
+ X,
684
734
  {
685
735
  name: "rubric-builder-feedback",
686
736
  label: t.rubricBuilderFeedbackLabel,
@@ -689,11 +739,11 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
689
739
  { value: "scale", label: t.gradingTypeScale },
690
740
  { value: "freeForm", label: t.rubricBuilderFeedbackWrittenOnly }
691
741
  ],
692
- onChange: (o) => a("freeFormCriterionComments", o === "freeForm")
742
+ onChange: (c) => a("freeFormCriterionComments", c === "freeForm")
693
743
  }
694
744
  ),
695
745
  !r.freeFormCriterionComments && /* @__PURE__ */ e(
696
- V,
746
+ X,
697
747
  {
698
748
  name: "rubric-builder-rating-order",
699
749
  label: t.rubricBuilderRatingOrderLabel,
@@ -702,7 +752,7 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
702
752
  { value: "ascending", label: t.rubricBuilderRatingOrderLowToHigh },
703
753
  { value: "descending", label: t.rubricBuilderRatingOrderHighToLow }
704
754
  ],
705
- onChange: (o) => a("ratingOrder", o)
755
+ onChange: (c) => a("ratingOrder", c)
706
756
  }
707
757
  )
708
758
  ] })
@@ -710,164 +760,226 @@ const Zr = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, child
710
760
  ]
711
761
  }
712
762
  );
713
- }, ei = (r) => /* @__PURE__ */ e(le, { translations: se, translate: oe, children: /* @__PURE__ */ e(
714
- Pe,
763
+ }, Ri = (r) => /* @__PURE__ */ e(be, { translations: pe, translate: ge, children: /* @__PURE__ */ e(
764
+ qe,
715
765
  {
716
766
  courseId: r.courseId,
717
767
  accountId: r.accountId,
718
768
  featureFlags: r.featureFlags,
719
769
  aiLimits: r.aiLimits,
720
- children: /* @__PURE__ */ e(Lr, { ...r })
770
+ children: /* @__PURE__ */ e($r, { ...r })
721
771
  }
722
- ) }), Lr = ({
772
+ ) }), $r = ({
723
773
  rubricId: r,
724
- accountId: a,
774
+ rubric: a,
775
+ rubricAssociation: o,
776
+ assignmentId: i,
777
+ assignmentPointsPossible: n,
778
+ accountId: t,
725
779
  courseId: s,
726
- canManageRubrics: i,
727
- onSaveRubric: n,
728
- onDiscard: t
780
+ canManageRubrics: c,
781
+ onSaveRubric: b,
782
+ onDiscard: g
729
783
  }) => {
730
- var re;
784
+ var oe;
731
785
  const { translations: l } = L(), {
732
- rubricForm: o,
733
- setRubricFormField: u,
734
- validateField: b,
735
- validationErrors: p,
736
- isNewRubric: g,
737
- load: { data: d, isLoading: v, isError: y, isSuccess: f },
738
- savePending: I,
739
- saveError: k,
740
- save: T,
741
- saveAction: S,
742
- isDirty: B,
743
- criteriaValid: R,
744
- criteriaValidationErrors: P,
745
- saveCriterion: H,
746
- deleteCriterion: E,
747
- reorderCriteria: G
748
- } = Xe({ rubricId: r, accountId: a, courseId: s, canManageRubrics: i, onSaveRubric: n }), W = Z(null), [M, $] = x(!1), [j, U] = x(!1), [K, A] = x(!1), [O, q] = x(), m = Ye(), Se = xe(() => q(void 0), []);
749
- if (r && v)
750
- return /* @__PURE__ */ e(ir, {});
751
- if (r && y)
752
- return Te({
753
- errorImageUrl: Je,
786
+ rubricForm: u,
787
+ setRubricFormField: d,
788
+ validateField: C,
789
+ validationErrors: D,
790
+ isNewRubric: f,
791
+ load: { data: I, isLoading: E, isError: x, isSuccess: y },
792
+ savePending: B,
793
+ saveError: R,
794
+ save: S,
795
+ saveAction: z,
796
+ isDirty: k,
797
+ criteriaValid: G,
798
+ criteriaValidationErrors: ee,
799
+ saveCriterion: M,
800
+ deleteCriterion: W,
801
+ reorderCriteria: j
802
+ } = sr({
803
+ rubricId: r,
804
+ rubric: a,
805
+ rubricAssociation: o,
806
+ assignmentId: i,
807
+ assignmentPointsPossible: n,
808
+ accountId: t,
809
+ courseId: s,
810
+ canManageRubrics: c,
811
+ onSaveRubric: b
812
+ }), H = ne(null), [U, _] = T(!1), [O, q] = T(!1), [p, re] = T(!1), [Pe, ie] = T(!1), [ke, K] = T(!1), [Ee, ae] = T(), xe = dr(), Me = ze(() => ae(void 0), []);
813
+ if (r && E)
814
+ return /* @__PURE__ */ e(gr, {});
815
+ if (r && x)
816
+ return Fe({
817
+ errorImageUrl: cr,
754
818
  errorCategory: l.rubricErrorPageCategory,
755
- translations: ie(l)
819
+ translations: le(l)
756
820
  });
757
- if (r && f && !d)
758
- return Ee({ translations: ie(l) });
759
- const ye = () => {
821
+ if (r && y && !I)
822
+ return $e({ translations: le(l) });
823
+ const Oe = () => {
760
824
  var w;
761
- if ($(!0), !b("title", o.title)) {
762
- (w = W.current) == null || w.focus();
825
+ if (_(!0), !C("title", u.title)) {
826
+ (w = H.current) == null || w.focus();
763
827
  return;
764
828
  }
765
- o.criteria.length === 0 || !R || (S === "confirmSave" ? A(!0) : T());
766
- }, Ie = () => {
767
- const w = er(m());
768
- H(w), q(w.id);
769
- }, we = () => {
770
- B ? U(!0) : t();
829
+ if (!(u.criteria.length === 0 || !G))
830
+ switch (z) {
831
+ case "confirmPointsDifference":
832
+ K(!0);
833
+ break;
834
+ case "confirmAssessedEdit":
835
+ ie(!0);
836
+ break;
837
+ case "confirmSave":
838
+ re(!0);
839
+ break;
840
+ case "save":
841
+ S();
842
+ break;
843
+ default: {
844
+ const He = z;
845
+ throw new Error(`Unhandled save action: ${He}`);
846
+ }
847
+ }
848
+ }, Ae = () => {
849
+ const w = mr(xe());
850
+ M(w), ae(w.id);
851
+ }, Ne = () => {
852
+ k ? q(!0) : g();
771
853
  };
772
- return /* @__PURE__ */ c(h, { as: "div", "data-testid": "rubric-builder", children: [
773
- /* @__PURE__ */ c(C, { direction: "column", gap: "medium", padding: "medium 0", children: [
854
+ return /* @__PURE__ */ m(h, { as: "div", "data-testid": "rubric-builder", children: [
855
+ /* @__PURE__ */ m(v, { direction: "column", gap: "medium", padding: "medium 0", children: [
774
856
  /* @__PURE__ */ e(
775
- Ir,
857
+ qr,
776
858
  {
777
- isNewRubric: g,
778
- pointsPossible: o.pointsPossible,
779
- hidePoints: o.hidePoints
859
+ isNewRubric: f,
860
+ pointsPossible: u.pointsPossible,
861
+ hidePoints: u.hidePoints
780
862
  }
781
863
  ),
782
- k && /* @__PURE__ */ e(tr, { variant: "error", margin: "0", children: l.rubricFormSaveError }),
864
+ R && /* @__PURE__ */ e(pr, { variant: "error", margin: "0", children: l.rubricFormSaveError }),
783
865
  /* @__PURE__ */ e(
784
- wr,
866
+ Fr,
785
867
  {
786
- rubricForm: o,
787
- setRubricFormField: u,
788
- validateTitle: (w) => b("title", w),
789
- titleError: (re = p.title) == null ? void 0 : re.message,
868
+ rubricForm: u,
869
+ setRubricFormField: d,
870
+ validateTitle: (w) => C("title", w),
871
+ titleError: (oe = D.title) == null ? void 0 : oe.message,
790
872
  titleInputRef: (w) => {
791
- W.current = w;
873
+ H.current = w;
792
874
  }
793
875
  }
794
876
  ),
795
877
  /* @__PURE__ */ e(
796
- fr,
878
+ xr,
797
879
  {
798
- criteriaCount: o.criteria.length,
799
- showMissingCriteriaError: M,
880
+ criteriaCount: u.criteria.length,
881
+ showMissingCriteriaError: U,
800
882
  actions: /* @__PURE__ */ e(
801
- N,
883
+ A,
802
884
  {
803
- renderIcon: /* @__PURE__ */ e(Re, {}),
804
- onClick: Ie,
885
+ renderIcon: /* @__PURE__ */ e(we, {}),
886
+ onClick: Ae,
805
887
  "data-testid": "rubric-builder-add-criterion",
806
888
  children: l.rubricBuilderAddCriterion
807
889
  }
808
890
  ),
809
891
  children: /* @__PURE__ */ e(
810
- Sr,
892
+ Hr,
811
893
  {
812
- criteria: o.criteria,
813
- hidePoints: o.hidePoints,
814
- freeFormCriterionComments: o.freeFormCriterionComments,
815
- ratingOrder: o.ratingOrder,
816
- criteriaValidationErrors: P,
817
- showErrors: M,
818
- focusNameCriterionId: O,
819
- onFocusedName: Se,
820
- onChangeCriterion: H,
821
- onDuplicateCriterion: (w) => H(Ze(w)),
822
- onDeleteCriterion: E,
823
- onReorderCriteria: G
894
+ criteria: u.criteria,
895
+ hidePoints: u.hidePoints,
896
+ freeFormCriterionComments: u.freeFormCriterionComments,
897
+ ratingOrder: u.ratingOrder,
898
+ criteriaValidationErrors: ee,
899
+ showErrors: U,
900
+ focusNameCriterionId: Ee,
901
+ onFocusedName: Me,
902
+ onChangeCriterion: M,
903
+ onDuplicateCriterion: (w) => M(ur(w)),
904
+ onDeleteCriterion: W,
905
+ onReorderCriteria: j
824
906
  }
825
907
  )
826
908
  }
827
909
  )
828
910
  ] }),
829
911
  /* @__PURE__ */ e(
830
- yr,
912
+ _r,
831
913
  {
832
- savePending: I,
833
- onDiscard: we,
834
- onSave: ye
914
+ savePending: B,
915
+ onDiscard: Ne,
916
+ onSave: Oe
835
917
  }
836
918
  ),
837
919
  /* @__PURE__ */ e(
838
- ee,
920
+ Z,
839
921
  {
840
- isOpen: j,
922
+ isOpen: O,
841
923
  heading: l.rubricBuilderDiscardHeading,
842
924
  body: l.rubricBuilderDiscardBody,
843
925
  confirmLabel: l.rubricBuilderDiscard,
844
926
  cancelLabel: l.rubricBuilderKeepEditing,
845
- onConfirm: t,
846
- onDismiss: () => U(!1),
927
+ onConfirm: g,
928
+ onDismiss: () => q(!1),
847
929
  "data-testid": "rubric-builder-discard-modal"
848
930
  }
849
931
  ),
850
932
  /* @__PURE__ */ e(
851
- ee,
933
+ Z,
852
934
  {
853
- isOpen: K,
935
+ isOpen: p,
854
936
  heading: l.confirmToContinueHeader,
855
937
  body: l.gradingHistoryWarning,
856
938
  confirmLabel: l.saveConfirmModalSave,
857
939
  cancelLabel: l.cancel,
858
940
  onConfirm: () => {
859
- A(!1), T();
941
+ re(!1), S();
860
942
  },
861
- onDismiss: () => A(!1),
943
+ onDismiss: () => re(!1),
862
944
  "data-testid": "rubric-builder-save-confirm-modal"
863
945
  }
946
+ ),
947
+ /* @__PURE__ */ e(
948
+ Z,
949
+ {
950
+ isOpen: Pe,
951
+ heading: l.confirmToContinueHeader,
952
+ body: l.gradingHistoryWarning,
953
+ confirmLabel: l.editConfirmModalConfirm,
954
+ cancelLabel: l.cancel,
955
+ onConfirm: () => {
956
+ ie(!1), S();
957
+ },
958
+ onDismiss: () => ie(!1),
959
+ "data-testid": "rubric-builder-assessed-edit-modal"
960
+ }
961
+ ),
962
+ /* @__PURE__ */ e(
963
+ Ur,
964
+ {
965
+ isOpen: ke,
966
+ assignmentPoints: n ?? 0,
967
+ rubricPoints: u.pointsPossible,
968
+ onChange: () => {
969
+ K(!1), S(!1);
970
+ },
971
+ onLeaveDifferent: () => {
972
+ K(!1), S(!0);
973
+ },
974
+ onDismiss: () => K(!1)
975
+ }
864
976
  )
865
977
  ] });
866
978
  };
867
979
  export {
868
- ti as DEFAULT_AI_MAX_CRITERION_COUNT,
869
- ni as DEFAULT_AI_MAX_RATING_COUNT,
870
- Jr as HelloWorld,
871
- ei as RubricBuilder,
872
- Zr as RubricSelector
980
+ Si as DEFAULT_AI_MAX_CRITERION_COUNT,
981
+ Di as DEFAULT_AI_MAX_RATING_COUNT,
982
+ Ci as HelloWorld,
983
+ Ri as RubricBuilder,
984
+ vi as RubricSelector
873
985
  };