@pie-lib/rubric 2.0.4-next.32 → 2.0.4-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring.js +98 -98
- package/package.json +3 -3
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
- package/dist/node_modules/.bun/@hello-pangea_dnd@18.0.1_d0d44917b9a63a72/node_modules/@hello-pangea/dnd/dist/dnd.esm.js +0 -4460
- package/dist/node_modules/.bun/css-box-model@1.2.1/node_modules/css-box-model/dist/css-box-model.esm.js +0 -102
- package/dist/node_modules/.bun/raf-schd@4.0.3/node_modules/raf-schd/dist/raf-schd.esm.js +0 -13
- package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +0 -471
- package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +0 -159
- package/dist/node_modules/.bun/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +0 -11
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +0 -53
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +0 -51
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +0 -10
package/dist/authoring.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import d from "@
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import y from "@
|
|
1
|
+
import e from "./point-menu.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { styled as r } from "@mui/material/styles";
|
|
5
|
+
import i from "@mui/material/InputLabel";
|
|
6
|
+
import a from "@mui/material/OutlinedInput";
|
|
7
|
+
import o from "@mui/material/Select";
|
|
8
|
+
import s from "@mui/material/FormControl";
|
|
9
|
+
import c from "@mui/material/MenuItem";
|
|
10
|
+
import { range as l, takeRight as u, times as d } from "@pie-element/shared-lodash";
|
|
11
|
+
import f from "@mui/material/Checkbox";
|
|
12
|
+
import p from "@mui/material/FormGroup";
|
|
13
|
+
import m from "@mui/material/FormControlLabel";
|
|
14
|
+
import h from "@mui/material/Typography";
|
|
15
|
+
import g from "@mui/icons-material/DragIndicator";
|
|
16
|
+
import { DragDropContext as _, Draggable as v, Droppable as y } from "@hello-pangea/dnd";
|
|
17
17
|
import b from "debug";
|
|
18
18
|
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
19
19
|
import C from "@pie-lib/editable-html-tip-tap";
|
|
@@ -23,63 +23,63 @@ import { grey as T } from "@mui/material/colors";
|
|
|
23
23
|
var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
24
24
|
let r = Array.from(e), [i] = r.splice(t, 1);
|
|
25
25
|
return r.splice(n, 0, i), r;
|
|
26
|
-
}, O =
|
|
27
|
-
excludeZero:
|
|
28
|
-
points:
|
|
29
|
-
sampleAnswers:
|
|
30
|
-
maxPoints:
|
|
31
|
-
rubriclessInstruction:
|
|
26
|
+
}, O = n.shape({
|
|
27
|
+
excludeZero: n.bool,
|
|
28
|
+
points: n.arrayOf(n.string),
|
|
29
|
+
sampleAnswers: n.arrayOf(n.string),
|
|
30
|
+
maxPoints: n.number,
|
|
31
|
+
rubriclessInstruction: n.string
|
|
32
32
|
}), k = (e) => {
|
|
33
|
-
let { value: t, onChange: n, max: r } = e,
|
|
34
|
-
return /* @__PURE__ */ S(
|
|
33
|
+
let { value: t, onChange: n, max: r } = e, u = "max-points-label";
|
|
34
|
+
return /* @__PURE__ */ S(s, {
|
|
35
35
|
sx: {
|
|
36
36
|
minWidth: 120,
|
|
37
37
|
m: 1
|
|
38
38
|
},
|
|
39
39
|
variant: "outlined",
|
|
40
|
-
children: [/* @__PURE__ */ x(
|
|
41
|
-
id:
|
|
40
|
+
children: [/* @__PURE__ */ x(i, {
|
|
41
|
+
id: u,
|
|
42
42
|
children: "Max Points"
|
|
43
|
-
}), /* @__PURE__ */ x(
|
|
44
|
-
labelId:
|
|
43
|
+
}), /* @__PURE__ */ x(o, {
|
|
44
|
+
labelId: u,
|
|
45
45
|
label: "Max Points",
|
|
46
46
|
value: t,
|
|
47
47
|
onChange: (e) => n(e.target.value),
|
|
48
|
-
input: /* @__PURE__ */ x(
|
|
48
|
+
input: /* @__PURE__ */ x(a, { label: "Max Points" }),
|
|
49
49
|
MenuProps: { transitionDuration: {
|
|
50
50
|
enter: 225,
|
|
51
51
|
exit: 195
|
|
52
52
|
} },
|
|
53
|
-
children:
|
|
53
|
+
children: l(1, r + 1).map((e) => /* @__PURE__ */ x(c, {
|
|
54
54
|
value: e,
|
|
55
55
|
children: e
|
|
56
56
|
}, `${e}`))
|
|
57
57
|
})]
|
|
58
58
|
});
|
|
59
|
-
}, A = (e) => e === null || e === "null", j =
|
|
59
|
+
}, A = (e) => e === null || e === "null", j = r("div")(() => ({
|
|
60
60
|
display: "flex",
|
|
61
61
|
width: "100%",
|
|
62
62
|
position: "relative"
|
|
63
|
-
})), M =
|
|
63
|
+
})), M = r("div")(({ theme: e }) => ({
|
|
64
64
|
width: "100%",
|
|
65
65
|
backgroundColor: `${e.palette.common.white}`
|
|
66
|
-
})), N =
|
|
66
|
+
})), N = r(g)(({ theme: e }) => ({
|
|
67
67
|
paddingTop: e.spacing(1),
|
|
68
68
|
color: T[500]
|
|
69
|
-
})), P =
|
|
69
|
+
})), P = r(h)(({ theme: e }) => ({
|
|
70
70
|
color: T[500],
|
|
71
71
|
paddingBottom: e.spacing(1),
|
|
72
72
|
textTransform: "uppercase"
|
|
73
|
-
})), F =
|
|
73
|
+
})), F = r("div")(({ theme: e }) => ({ paddingLeft: e.spacing(3) })), I = r("div")(({ theme: e }) => ({
|
|
74
74
|
fontSize: e.typography.fontSize - 2,
|
|
75
75
|
color: e.palette.error.main,
|
|
76
76
|
paddingLeft: e.spacing(3),
|
|
77
77
|
paddingTop: e.spacing(1)
|
|
78
|
-
})), L =
|
|
78
|
+
})), L = r("div")(() => ({
|
|
79
79
|
position: "absolute",
|
|
80
80
|
right: 0
|
|
81
|
-
})), R = (
|
|
82
|
-
let { points:
|
|
81
|
+
})), R = (t) => {
|
|
82
|
+
let { points: n, content: r, sampleAnswer: i, mathMlOptions: a = {}, error: o, pluginOpts: s = {} } = t, c = `${n} ${n <= 1 ? "pt" : "pts"}`, l = A(i);
|
|
83
83
|
return /* @__PURE__ */ S("div", { children: [
|
|
84
84
|
/* @__PURE__ */ x(P, {
|
|
85
85
|
variant: "overline",
|
|
@@ -90,35 +90,35 @@ var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
|
90
90
|
/* @__PURE__ */ x(M, { children: /* @__PURE__ */ x(C, {
|
|
91
91
|
error: o,
|
|
92
92
|
pluginProps: s,
|
|
93
|
-
markup:
|
|
94
|
-
onChange:
|
|
93
|
+
markup: r,
|
|
94
|
+
onChange: t.onChange,
|
|
95
95
|
mathMlOptions: a
|
|
96
96
|
}) }),
|
|
97
|
-
/* @__PURE__ */ x(L, { children: /* @__PURE__ */ x(
|
|
97
|
+
/* @__PURE__ */ x(L, { children: /* @__PURE__ */ x(e, {
|
|
98
98
|
showSampleAnswer: l,
|
|
99
|
-
onChange:
|
|
99
|
+
onChange: t.onMenuChange
|
|
100
100
|
}) })
|
|
101
101
|
] }),
|
|
102
102
|
o && /* @__PURE__ */ x(I, { children: o }),
|
|
103
103
|
!l && /* @__PURE__ */ S(F, { children: [/* @__PURE__ */ x(N, {
|
|
104
|
-
as:
|
|
104
|
+
as: h,
|
|
105
105
|
variant: "overline",
|
|
106
106
|
children: "Sample Response"
|
|
107
107
|
}), /* @__PURE__ */ x(M, { children: /* @__PURE__ */ x(C, {
|
|
108
108
|
markup: i,
|
|
109
109
|
pluginProps: s,
|
|
110
|
-
onChange:
|
|
110
|
+
onChange: t.onSampleChange,
|
|
111
111
|
mathMlOptions: a
|
|
112
112
|
}) })] })
|
|
113
113
|
] });
|
|
114
|
-
}, z =
|
|
114
|
+
}, z = r("div")(({ theme: e }) => ({
|
|
115
115
|
backgroundColor: T[200],
|
|
116
116
|
borderWidth: 1,
|
|
117
117
|
borderStyle: "solid",
|
|
118
118
|
borderColor: T[300],
|
|
119
119
|
padding: e.spacing(2),
|
|
120
120
|
margin: e.spacing(1)
|
|
121
|
-
})), B =
|
|
121
|
+
})), B = r(w)(({ theme: e }) => ({
|
|
122
122
|
width: "100%",
|
|
123
123
|
paddingTop: e.spacing(2.5),
|
|
124
124
|
marginBottom: e.spacing(2),
|
|
@@ -128,19 +128,19 @@ var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
|
128
128
|
fontSize: e.typography.fontSize + 2,
|
|
129
129
|
transform: "translate(0, 1.5px) scale(0.75)"
|
|
130
130
|
}
|
|
131
|
-
})), V =
|
|
131
|
+
})), V = r("div")(() => ({ display: "none" })), H = r("div")(({ theme: e }) => ({
|
|
132
132
|
paddingTop: e.spacing(1),
|
|
133
133
|
paddingBottom: e.spacing(1)
|
|
134
|
-
})), U =
|
|
134
|
+
})), U = r(h)(({ theme: e }) => ({
|
|
135
135
|
paddingLeft: e.spacing(1),
|
|
136
136
|
margin: e.spacing(1)
|
|
137
|
-
})), W = class extends
|
|
137
|
+
})), W = class extends t.Component {
|
|
138
138
|
static propTypes = {
|
|
139
139
|
value: O,
|
|
140
|
-
config:
|
|
141
|
-
pluginOpts:
|
|
142
|
-
rubricless:
|
|
143
|
-
onChange:
|
|
140
|
+
config: n.object,
|
|
141
|
+
pluginOpts: n.object,
|
|
142
|
+
rubricless: n.bool,
|
|
143
|
+
onChange: n.func
|
|
144
144
|
};
|
|
145
145
|
static defaultProps = {};
|
|
146
146
|
dragEnd = (e) => {
|
|
@@ -163,7 +163,7 @@ var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
|
163
163
|
let { value: t, onChange: n, rubricless: r } = this.props, i = t.points.length - 1;
|
|
164
164
|
E("current", i, "new: ", e);
|
|
165
165
|
let a, o;
|
|
166
|
-
e > i && (a =
|
|
166
|
+
e > i && (a = d(e - i).map(() => "").concat(t.points), o = d(e - i).map(() => null).concat(t.sampleAnswers)), e < i && (E("less than"), a = u(t.points, e + 1), o = u(t.sampleAnswers, e + 1)), n(a && !r ? {
|
|
167
167
|
...t,
|
|
168
168
|
points: a,
|
|
169
169
|
sampleAnswers: o,
|
|
@@ -198,69 +198,69 @@ var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
render() {
|
|
201
|
-
let { value:
|
|
202
|
-
|
|
203
|
-
let
|
|
201
|
+
let { value: e, mathMlOptions: t = {}, config: n = {}, rubricless: r = !1, pluginOpts: i = {} } = this.props, { excludeZeroEnabled: a = !0, maxPointsEnabled: o = !0, errors: s = {}, rubriclessInstructionEnabled: c = !1, maxPoints: l = 10 } = e || {}, { rubriclessInstruction: u = {}, maxMaxPoints: d = 10 } = n || {}, { pointsDescriptorsErrors: h } = s || {};
|
|
202
|
+
e && Number.isFinite(e.maxPoints) && console.warn("maxPoints is deprecated - remove from model");
|
|
203
|
+
let g = r ? l : e.excludeZero ? e.points.length : e.points.length - 1;
|
|
204
204
|
return /* @__PURE__ */ S("div", { children: [
|
|
205
205
|
/* @__PURE__ */ x(U, {
|
|
206
206
|
variant: "h5",
|
|
207
207
|
children: "Rubric"
|
|
208
208
|
}),
|
|
209
|
-
/* @__PURE__ */ S(
|
|
209
|
+
/* @__PURE__ */ S(p, {
|
|
210
210
|
row: !0,
|
|
211
|
-
children: [
|
|
212
|
-
max:
|
|
213
|
-
value:
|
|
211
|
+
children: [o && /* @__PURE__ */ x(k, {
|
|
212
|
+
max: d < 100 ? d : 100,
|
|
213
|
+
value: g,
|
|
214
214
|
onChange: this.changeMaxPoints,
|
|
215
|
-
pluginOpts:
|
|
216
|
-
}),
|
|
215
|
+
pluginOpts: i
|
|
216
|
+
}), a && /* @__PURE__ */ x(m, {
|
|
217
217
|
label: "Exclude zeros",
|
|
218
|
-
control: /* @__PURE__ */ x(
|
|
219
|
-
checked:
|
|
218
|
+
control: /* @__PURE__ */ x(f, {
|
|
219
|
+
checked: e.excludeZero,
|
|
220
220
|
onChange: this.excludeZeros
|
|
221
221
|
})
|
|
222
222
|
})]
|
|
223
223
|
}),
|
|
224
|
-
|
|
225
|
-
label:
|
|
224
|
+
c && r && /* @__PURE__ */ x(B, {
|
|
225
|
+
label: u.label,
|
|
226
226
|
children: /* @__PURE__ */ x(C, {
|
|
227
|
-
markup:
|
|
227
|
+
markup: e.rubriclessInstruction || "",
|
|
228
228
|
onChange: this.changeRubriclessInstruction,
|
|
229
|
-
pluginProps:
|
|
229
|
+
pluginProps: i,
|
|
230
230
|
nonEmpty: !1,
|
|
231
231
|
disableUnderline: !0,
|
|
232
232
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
233
|
-
mathMlOptions:
|
|
233
|
+
mathMlOptions: t,
|
|
234
234
|
autoWidthToolbar: !0
|
|
235
235
|
})
|
|
236
236
|
}),
|
|
237
|
-
/* @__PURE__ */ x("div", { children:
|
|
237
|
+
/* @__PURE__ */ x("div", { children: r ? /* @__PURE__ */ x(V, {}) : /* @__PURE__ */ x(z, { children: /* @__PURE__ */ x(_, {
|
|
238
238
|
onDragEnd: this.dragEnd,
|
|
239
|
-
children: /* @__PURE__ */ x(
|
|
239
|
+
children: /* @__PURE__ */ x(y, {
|
|
240
240
|
droppableId: "droppable",
|
|
241
|
-
children: (
|
|
242
|
-
...
|
|
243
|
-
ref:
|
|
244
|
-
children: [
|
|
245
|
-
index:
|
|
246
|
-
draggableId:
|
|
247
|
-
children: (
|
|
248
|
-
ref:
|
|
249
|
-
...
|
|
250
|
-
...
|
|
241
|
+
children: (n) => /* @__PURE__ */ S("div", {
|
|
242
|
+
...n.droppableProps,
|
|
243
|
+
ref: n.innerRef,
|
|
244
|
+
children: [e.points.map((n, r) => this.shouldRenderPoint(r, e) && /* @__PURE__ */ x(v, {
|
|
245
|
+
index: r,
|
|
246
|
+
draggableId: r.toString(),
|
|
247
|
+
children: (a) => /* @__PURE__ */ x(H, {
|
|
248
|
+
ref: a.innerRef,
|
|
249
|
+
...a.draggableProps,
|
|
250
|
+
...a.dragHandleProps,
|
|
251
251
|
children: /* @__PURE__ */ x(R, {
|
|
252
|
-
points: this.getPointForIndex(
|
|
253
|
-
content:
|
|
254
|
-
error:
|
|
255
|
-
sampleAnswer:
|
|
256
|
-
onChange: (e) => this.changeContent(
|
|
257
|
-
onSampleChange: (e) => this.changeContent(
|
|
258
|
-
onMenuChange: (e) => this.onPointMenuChange(
|
|
259
|
-
mathMlOptions:
|
|
260
|
-
pluginOpts:
|
|
252
|
+
points: this.getPointForIndex(r, e),
|
|
253
|
+
content: n,
|
|
254
|
+
error: h && h[e.points.length - 1 - r],
|
|
255
|
+
sampleAnswer: e.sampleAnswers && e.sampleAnswers[r],
|
|
256
|
+
onChange: (e) => this.changeContent(r, e, "points"),
|
|
257
|
+
onSampleChange: (e) => this.changeContent(r, e, "sampleAnswers"),
|
|
258
|
+
onMenuChange: (e) => this.onPointMenuChange(r, e),
|
|
259
|
+
mathMlOptions: t,
|
|
260
|
+
pluginOpts: i
|
|
261
261
|
})
|
|
262
262
|
})
|
|
263
|
-
}, `${
|
|
263
|
+
}, `${n.points}-${r}`)), n.placeholder]
|
|
264
264
|
})
|
|
265
265
|
})
|
|
266
266
|
}) }) })
|
|
@@ -268,7 +268,7 @@ var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
|
268
268
|
}
|
|
269
269
|
}, G = (e) => {
|
|
270
270
|
let { rubricless: t = !1, config: n = {}, pluginOpts: r = {} } = e || {}, i = Array.from(e.value.points || []).reverse(), a = Array.from(e.value.sampleAnswers || []).reverse();
|
|
271
|
-
return i.length > a.length && (a =
|
|
271
|
+
return i.length > a.length && (a = d(i.length - a.length).map(() => null).concat(a)), /* @__PURE__ */ x(W, {
|
|
272
272
|
value: {
|
|
273
273
|
...e.value,
|
|
274
274
|
points: i,
|
|
@@ -288,11 +288,11 @@ var E = b("pie-lib:rubric:authoring"), D = (e, t, n) => {
|
|
|
288
288
|
};
|
|
289
289
|
G.propTypes = {
|
|
290
290
|
value: O,
|
|
291
|
-
config:
|
|
292
|
-
pluginOpts:
|
|
293
|
-
rubricless:
|
|
294
|
-
getIndex:
|
|
295
|
-
onChange:
|
|
291
|
+
config: n.object,
|
|
292
|
+
pluginOpts: n.object,
|
|
293
|
+
rubricless: n.bool,
|
|
294
|
+
getIndex: n.func,
|
|
295
|
+
onChange: n.func
|
|
296
296
|
};
|
|
297
297
|
//#endregion
|
|
298
298
|
export { R as PointConfig, W as RawAuthoring, O as RubricType, G as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/rubric",
|
|
3
|
-
"version": "2.0.4-next.
|
|
3
|
+
"version": "2.0.4-next.33",
|
|
4
4
|
"description": "React implementation of @pie-lib/rubric synced from pie-lib",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"@hello-pangea/dnd": "^18.0.1",
|
|
14
14
|
"@mui/icons-material": "^7.3.4",
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
|
-
"@pie-lib/editable-html-tip-tap": "2.1.2-next.
|
|
16
|
+
"@pie-lib/editable-html-tip-tap": "2.1.2-next.33",
|
|
17
17
|
"debug": "^4.1.1",
|
|
18
18
|
"prop-types": "^15.7.2",
|
|
19
19
|
"@pie-element/shared-lodash": "0.1.1-next.1",
|
|
20
|
-
"@pie-lib/config-ui": "13.0.4-next.
|
|
20
|
+
"@pie-lib/config-ui": "13.0.4-next.33",
|
|
21
21
|
"@pie-lib/render-ui": "6.1.1-next.39"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), t = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
3
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
-
});
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as __commonJSMin, t as __require };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
2
|
-
function e() {
|
|
3
|
-
return e = Object.assign ? Object.assign.bind() : function(e) {
|
|
4
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
5
|
-
var n = arguments[t];
|
|
6
|
-
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
7
|
-
}
|
|
8
|
-
return e;
|
|
9
|
-
}, e.apply(null, arguments);
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { e as default };
|