@pie-element/multi-trait-rubric 8.1.2-next.2 → 8.1.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.
- package/CHANGELOG.json +1 -0
- package/CHANGELOG.md +1590 -0
- package/LICENSE.md +5 -0
- package/README.md +55 -0
- package/configure/CHANGELOG.json +1 -0
- package/configure/CHANGELOG.md +1485 -0
- package/configure/lib/common.js +424 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/defaults.js +184 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +157 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +454 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/lib/modals.js +206 -0
- package/configure/lib/modals.js.map +1 -0
- package/configure/lib/scale.js +478 -0
- package/configure/lib/scale.js.map +1 -0
- package/configure/lib/trait.js +275 -0
- package/configure/lib/trait.js.map +1 -0
- package/configure/lib/traitsHeader.js +235 -0
- package/configure/lib/traitsHeader.js.map +1 -0
- package/configure/lib/utils.js +87 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +24 -0
- package/controller/CHANGELOG.json +1 -0
- package/controller/CHANGELOG.md +911 -0
- package/controller/lib/defaults.js +18 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +158 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +11 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +14 -0
- package/docs/config-schema.json +1628 -0
- package/docs/config-schema.json.md +1202 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +117 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +861 -0
- package/docs/pie-schema.json.md +614 -0
- package/lib/index.js +54 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +123 -0
- package/lib/main.js.map +1 -0
- package/lib/scale.js +248 -0
- package/lib/scale.js.map +1 -0
- package/lib/trait.js +83 -0
- package/lib/trait.js.map +1 -0
- package/package.json +15 -84
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/common.d.ts +0 -90
- package/dist/author/common.js +0 -275
- package/dist/author/defaults.d.ts +0 -153
- package/dist/author/defaults.js +0 -113
- package/dist/author/index.d.ts +0 -22
- package/dist/author/index.js +0 -89
- package/dist/author/main.d.ts +0 -43
- package/dist/author/main.js +0 -247
- package/dist/author/modals.d.ts +0 -94
- package/dist/author/modals.js +0 -171
- package/dist/author/scale.d.ts +0 -46
- package/dist/author/scale.js +0 -280
- package/dist/author/trait.d.ts +0 -70
- package/dist/author/trait.js +0 -202
- package/dist/author/traitsHeader.d.ts +0 -28
- package/dist/author/traitsHeader.js +0 -172
- package/dist/author/utils.d.ts +0 -10
- package/dist/author/utils.js +0 -41
- package/dist/browser/Typography-CGQjcqGj.js +0 -9000
- package/dist/browser/Typography-CGQjcqGj.js.map +0 -1
- package/dist/browser/author/index.js +0 -41731
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/controller/index.js +0 -70
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -523
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/multi-trait-rubric.css +0 -2
- package/dist/controller/defaults.d.ts +0 -20
- package/dist/controller/defaults.js +0 -14
- package/dist/controller/index.d.ts +0 -26
- package/dist/controller/index.js +0 -57
- package/dist/controller/utils.d.ts +0 -9
- package/dist/controller/utils.js +0 -4
- package/dist/delivery/index.d.ts +0 -17
- package/dist/delivery/index.js +0 -37
- package/dist/delivery/main.d.ts +0 -15
- package/dist/delivery/main.js +0 -95
- package/dist/delivery/scale.d.ts +0 -17
- package/dist/delivery/scale.js +0 -175
- package/dist/delivery/trait.d.ts +0 -27
- package/dist/delivery/trait.js +0 -44
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -145
- package/dist/index.js +0 -2
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
package/dist/author/scale.js
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import { DecreaseMaxPoints as e, DeleteScale as t, DeleteTrait as n, InfoDialog as r } from "./modals.js";
|
|
2
|
-
import { Arrow as i, MultiTraitButton as a } from "./common.js";
|
|
3
|
-
import o from "./traitsHeader.js";
|
|
4
|
-
import s from "./trait.js";
|
|
5
|
-
import c from "react";
|
|
6
|
-
import l from "prop-types";
|
|
7
|
-
import { styled as u } from "@mui/material/styles";
|
|
8
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
-
import p from "@mui/icons-material/ArrowBackIos";
|
|
10
|
-
import m from "@mui/icons-material/ArrowForwardIos";
|
|
11
|
-
import { DragProvider as h } from "@pie-lib/drag";
|
|
12
|
-
//#region src/author/scale.tsx
|
|
13
|
-
var g = 216, _ = u("div")(({ theme: e }) => ({
|
|
14
|
-
display: "flex",
|
|
15
|
-
flexDirection: "column",
|
|
16
|
-
wordBreak: "break-word",
|
|
17
|
-
position: "relative",
|
|
18
|
-
marginBottom: e.spacing(2.5)
|
|
19
|
-
})), v = class extends c.Component {
|
|
20
|
-
state = {
|
|
21
|
-
showDecreaseMaxPointsDialog: !1,
|
|
22
|
-
showDeleteScaleDialog: !1,
|
|
23
|
-
showDeleteTraitDialog: !1,
|
|
24
|
-
currentPosition: 0,
|
|
25
|
-
showRight: null,
|
|
26
|
-
showLeft: null,
|
|
27
|
-
showInfoDialog: !1,
|
|
28
|
-
infoDialogText: ""
|
|
29
|
-
};
|
|
30
|
-
set = (e) => this.setState(e);
|
|
31
|
-
componentDidMount() {
|
|
32
|
-
this.state.showRight === null && this.secondaryBlockRef && this.setState({ showRight: this.getMaxScroll() });
|
|
33
|
-
}
|
|
34
|
-
componentDidUpdate(e) {
|
|
35
|
-
(e.scale.maxPoints !== this.props.scale.maxPoints || e.showDescription !== this.props.showDescription || e.excludeZero !== this.props.excludeZero) && this.setState({ showRight: this.getMaxScroll() });
|
|
36
|
-
}
|
|
37
|
-
UNSAFE_componentWillReceiveProps(e) {
|
|
38
|
-
(e.excludeZero !== this.props.excludeZero || e.showStandards !== this.props.showStandards || e.showDescription !== this.props.showDescription) && this.setState({
|
|
39
|
-
currentPosition: 0,
|
|
40
|
-
showLeft: !1,
|
|
41
|
-
showRight: this.getMaxScroll()
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
updateMaxPointsFieldValue = ({ target: e }) => {
|
|
45
|
-
let { scale: t, scaleIndex: n, onScaleChanged: r } = this.props || {}, { maxPoints: i } = t, a = parseInt(e.value, 10);
|
|
46
|
-
this.setState({
|
|
47
|
-
currentPosition: 0,
|
|
48
|
-
showLeft: !1,
|
|
49
|
-
showRight: this.getMaxScroll()
|
|
50
|
-
}), a < i ? this.showDecreaseMaxPointsModal({ newMaxPoints: a }) : r(n, { maxPoints: a });
|
|
51
|
-
};
|
|
52
|
-
showDecreaseMaxPointsModal = ({ newMaxPoints: e }) => this.set({
|
|
53
|
-
showDecreaseMaxPointsDialog: !0,
|
|
54
|
-
newMaxPoints: e
|
|
55
|
-
});
|
|
56
|
-
hideDecreaseMaxPointsModal = () => this.set({
|
|
57
|
-
showDecreaseMaxPointsDialog: !1,
|
|
58
|
-
newMaxPoints: void 0
|
|
59
|
-
});
|
|
60
|
-
changeMaxPoints = () => {
|
|
61
|
-
let { newMaxPoints: e } = this.state || {}, { scaleIndex: t, onScaleChanged: n } = this.props || {};
|
|
62
|
-
e && n(t, { maxPoints: e }), this.hideDecreaseMaxPointsModal();
|
|
63
|
-
};
|
|
64
|
-
showDeleteScaleModal = () => this.set({ showDeleteScaleDialog: !0 });
|
|
65
|
-
hideDeleteScaleModal = () => this.set({ showDeleteScaleDialog: !1 });
|
|
66
|
-
deleteScale = () => {
|
|
67
|
-
let { scaleIndex: e, onScaleRemoved: t } = this.props || {};
|
|
68
|
-
this.hideDeleteScaleModal(), t(e);
|
|
69
|
-
};
|
|
70
|
-
showDeleteTraitModal = (e) => this.set({
|
|
71
|
-
showDeleteTraitDialog: !0,
|
|
72
|
-
traitToDeleteIndex: e
|
|
73
|
-
});
|
|
74
|
-
hideDeleteTraitModal = () => this.set({
|
|
75
|
-
showDeleteTraitDialog: !1,
|
|
76
|
-
traitToDeleteIndex: void 0
|
|
77
|
-
});
|
|
78
|
-
onTraitRemoved = () => {
|
|
79
|
-
let { traitToDeleteIndex: e } = this.state, { scale: t, scaleIndex: n, onScaleChanged: r, minNoOfTraits: i } = this.props || {}, { traits: a, traitLabel: o } = t || {};
|
|
80
|
-
if (!(e < 0 || e >= a.length)) {
|
|
81
|
-
if (a.length === i) return this.set({
|
|
82
|
-
infoDialogText: `There can't be less than ${i} ${(o || "trait").toLowerCase()}s.`,
|
|
83
|
-
showInfoDialog: !0
|
|
84
|
-
}), !1;
|
|
85
|
-
a = [...a.slice(0, e), ...a.slice(e + 1)], r(n, { traits: a }), this.hideDeleteTraitModal();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
onTraitAdded = () => {
|
|
89
|
-
let { scale: e, scaleIndex: t, onScaleChanged: n, maxNoOfTraits: r } = this.props || {}, { traits: i, scorePointsLabels: a } = e || {};
|
|
90
|
-
if (i.length === r) return this.set({
|
|
91
|
-
infoDialogText: `There can't be more than ${r} scales.`,
|
|
92
|
-
showInfoDialog: !0
|
|
93
|
-
}), !1;
|
|
94
|
-
i.push({
|
|
95
|
-
name: "",
|
|
96
|
-
description: "",
|
|
97
|
-
standards: [],
|
|
98
|
-
scorePointsDescriptors: Array.from({ length: a.length }, () => "")
|
|
99
|
-
}), n(t, { traits: i });
|
|
100
|
-
};
|
|
101
|
-
onTraitChanged = (e, t) => {
|
|
102
|
-
let { scale: n, scaleIndex: r, onScaleChanged: i } = this.props || {}, { traits: a } = n || {};
|
|
103
|
-
e >= 0 && e < a.length && (a[e] = t, i(r, { traits: a }));
|
|
104
|
-
};
|
|
105
|
-
onTraitDropped = (e) => {
|
|
106
|
-
let { active: t, over: n } = e;
|
|
107
|
-
if (!n || !t) return;
|
|
108
|
-
let r = t.data.current, i = n.data.current;
|
|
109
|
-
if (r?.type === "trait" && i?.type === "trait") {
|
|
110
|
-
let e = r.index, t = i.index;
|
|
111
|
-
if (e === t) return;
|
|
112
|
-
let { scale: n, scaleIndex: a, onScaleChanged: o } = this.props || {}, { traits: s } = n || {}, c = s[e], l = s.filter((t, n) => n !== e);
|
|
113
|
-
o(a, { traits: [
|
|
114
|
-
...l.slice(0, t),
|
|
115
|
-
c,
|
|
116
|
-
...l.slice(t)
|
|
117
|
-
] });
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
decreasePosition = () => {
|
|
121
|
-
let { currentPosition: e } = this.state, t = Math.max(e - g, 0), n = this.getMaxScroll();
|
|
122
|
-
this.setState({
|
|
123
|
-
currentPosition: t,
|
|
124
|
-
showRight: t < n,
|
|
125
|
-
showLeft: t > 0
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
getMaxScroll = () => {
|
|
129
|
-
if (!this.secondaryBlockRef) return 0;
|
|
130
|
-
let e = this.secondaryBlockRef.scrollWidth, t = this.getNumberOfBlocks() * 200;
|
|
131
|
-
return Math.max(0, Math.min(e, t) - this.secondaryBlockRef.offsetWidth);
|
|
132
|
-
};
|
|
133
|
-
getNumberOfBlocks = () => {
|
|
134
|
-
let { scale: e, showStandards: t, showDescription: n, excludeZero: r } = this.props, { maxPoints: i } = e || {}, a = i - +!!r + 1;
|
|
135
|
-
return +!!t + +!!n + a;
|
|
136
|
-
};
|
|
137
|
-
increasePosition = () => {
|
|
138
|
-
let { currentPosition: e } = this.state, t = this.getMaxScroll(), n = Math.min(e + g, t);
|
|
139
|
-
this.setState({
|
|
140
|
-
currentPosition: n,
|
|
141
|
-
showRight: n < t,
|
|
142
|
-
showLeft: n > 0
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
render() {
|
|
146
|
-
let { errors: c, scale: l, scaleIndex: u, showStandards: v, onScaleChanged: y, excludeZero: b, showDescription: x, showLevelTagInput: S, showScorePointLabels: C, enableDragAndDrop: w, spellCheck: T, width: E, uploadSoundSupport: D, maxPointsEnabled: O, mathMlOptions: k = {}, maxMaxPoints: A, expandedPluginProps: j = {}, labelPluginProps: M = {}, imageSupport: N = {} } = this.props || {}, { maxPoints: P, scorePointsLabels: F, traitLabel: I, traits: L } = l || {}, { showDecreaseMaxPointsDialog: R, showDeleteScaleDialog: z, showDeleteTraitDialog: B, currentPosition: V, showRight: H, showLeft: U, showInfoDialog: W, infoDialogText: G } = this.state, { traitsErrors: K, scorePointsErrors: q } = c || {}, J = K && K[u] || {}, Y = q && q[u] || {}, X = [], Z = parseInt(E) - 32 - 200 || 320;
|
|
147
|
-
for (let e = P; +(e >= b); --e) X.push(e);
|
|
148
|
-
return /* @__PURE__ */ d(h, {
|
|
149
|
-
onDragEnd: this.onTraitDropped,
|
|
150
|
-
children: /* @__PURE__ */ f(_, {
|
|
151
|
-
ref: (e) => {
|
|
152
|
-
this.scaleWrapper = e;
|
|
153
|
-
},
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ d(o, {
|
|
156
|
-
setSecondaryBlockRef: (e) => {
|
|
157
|
-
e && (this.secondaryBlockRef = e);
|
|
158
|
-
},
|
|
159
|
-
errors: Y,
|
|
160
|
-
traitLabel: I,
|
|
161
|
-
scorePointsValues: X,
|
|
162
|
-
scorePointsLabels: F,
|
|
163
|
-
onScaleChange: (e) => y(u, e),
|
|
164
|
-
onTraitLabelChange: (e) => y(u, { traitLabel: e }),
|
|
165
|
-
showStandards: v,
|
|
166
|
-
showDescription: x,
|
|
167
|
-
showLevelTagInput: S,
|
|
168
|
-
showScorePointLabels: C,
|
|
169
|
-
maxPoints: P,
|
|
170
|
-
updateMaxPointsFieldValue: this.updateMaxPointsFieldValue,
|
|
171
|
-
scaleIndex: u,
|
|
172
|
-
showDeleteScaleModal: this.showDeleteScaleModal,
|
|
173
|
-
currentPosition: V,
|
|
174
|
-
secondaryBlockWidth: Z,
|
|
175
|
-
spellCheck: T,
|
|
176
|
-
uploadSoundSupport: D,
|
|
177
|
-
maxPointsEnabled: O,
|
|
178
|
-
mathMlOptions: k,
|
|
179
|
-
maxMaxPoints: A,
|
|
180
|
-
expandedPluginProps: j,
|
|
181
|
-
labelPluginProps: M,
|
|
182
|
-
imageSupport: N
|
|
183
|
-
}, "header-key"),
|
|
184
|
-
L.map((e, t) => /* @__PURE__ */ d(s, {
|
|
185
|
-
index: t,
|
|
186
|
-
error: J && J[t],
|
|
187
|
-
trait: e,
|
|
188
|
-
traitLabel: I || "Trait",
|
|
189
|
-
scorePointsValues: X,
|
|
190
|
-
scorePointsLabels: F,
|
|
191
|
-
onTraitRemoved: () => this.showDeleteTraitModal(t),
|
|
192
|
-
onTraitChanged: (e) => this.onTraitChanged(t, e),
|
|
193
|
-
showStandards: v,
|
|
194
|
-
showDescription: x,
|
|
195
|
-
maxPoints: P,
|
|
196
|
-
currentPosition: V,
|
|
197
|
-
enableDragAndDrop: w,
|
|
198
|
-
secondaryBlockWidth: Z,
|
|
199
|
-
spellCheck: T,
|
|
200
|
-
uploadSoundSupport: D,
|
|
201
|
-
mathMlOptions: k,
|
|
202
|
-
expandedPluginProps: j,
|
|
203
|
-
labelPluginProps: M,
|
|
204
|
-
imageSupport: N
|
|
205
|
-
}, t)),
|
|
206
|
-
/* @__PURE__ */ d(i, {
|
|
207
|
-
width: `${g / 2}px`,
|
|
208
|
-
show: U,
|
|
209
|
-
onClick: this.decreasePosition,
|
|
210
|
-
left: "200px",
|
|
211
|
-
showLevelTagInput: S,
|
|
212
|
-
children: /* @__PURE__ */ d(p, {})
|
|
213
|
-
}),
|
|
214
|
-
/* @__PURE__ */ d(i, {
|
|
215
|
-
width: `${g / 2}px`,
|
|
216
|
-
show: H,
|
|
217
|
-
onClick: this.increasePosition,
|
|
218
|
-
showLevelTagInput: S,
|
|
219
|
-
children: /* @__PURE__ */ d(m, {})
|
|
220
|
-
}),
|
|
221
|
-
/* @__PURE__ */ d(a, {
|
|
222
|
-
onClick: this.onTraitAdded,
|
|
223
|
-
children: /* @__PURE__ */ d("div", { dangerouslySetInnerHTML: { __html: `Add ${I || " Trait"}` } })
|
|
224
|
-
}),
|
|
225
|
-
/* @__PURE__ */ d(e, {
|
|
226
|
-
open: !!R,
|
|
227
|
-
deleteScorePoints: this.changeMaxPoints,
|
|
228
|
-
cancel: this.hideDecreaseMaxPointsModal
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ d(t, {
|
|
231
|
-
open: !!z,
|
|
232
|
-
scaleIndex: u,
|
|
233
|
-
deleteScale: this.deleteScale,
|
|
234
|
-
cancel: this.hideDeleteScaleModal
|
|
235
|
-
}),
|
|
236
|
-
/* @__PURE__ */ d(n, {
|
|
237
|
-
open: !!B,
|
|
238
|
-
deleteTrait: this.onTraitRemoved,
|
|
239
|
-
cancel: this.hideDeleteTraitModal,
|
|
240
|
-
traitLabel: I.toLowerCase()
|
|
241
|
-
}),
|
|
242
|
-
/* @__PURE__ */ d(r, {
|
|
243
|
-
open: W,
|
|
244
|
-
text: G,
|
|
245
|
-
onClose: () => this.set({ showInfoDialog: !1 })
|
|
246
|
-
})
|
|
247
|
-
]
|
|
248
|
-
}, `scale-${u}`)
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
v.propTypes = {
|
|
253
|
-
errors: l.object,
|
|
254
|
-
scale: l.shape({
|
|
255
|
-
maxPoints: l.number,
|
|
256
|
-
scorePointsLabels: l.arrayOf(l.string),
|
|
257
|
-
traitLabel: l.string,
|
|
258
|
-
traits: l.arrayOf(l.shape({
|
|
259
|
-
name: l.string,
|
|
260
|
-
standards: l.arrayOf(l.string),
|
|
261
|
-
scorePointsDescriptors: l.arrayOf(l.string),
|
|
262
|
-
description: l.string
|
|
263
|
-
}))
|
|
264
|
-
}),
|
|
265
|
-
width: l.string,
|
|
266
|
-
excludeZero: l.bool,
|
|
267
|
-
scaleIndex: l.number,
|
|
268
|
-
onScaleChanged: l.func,
|
|
269
|
-
onScaleRemoved: l.func,
|
|
270
|
-
showStandards: l.bool,
|
|
271
|
-
showLevelTagInput: l.bool,
|
|
272
|
-
showDescription: l.bool,
|
|
273
|
-
uploadSoundSupport: l.object,
|
|
274
|
-
showScorePointLabels: l.bool,
|
|
275
|
-
enableDragAndDrop: l.bool,
|
|
276
|
-
expandedPluginProps: l.object,
|
|
277
|
-
labelPluginProps: l.object
|
|
278
|
-
};
|
|
279
|
-
//#endregion
|
|
280
|
-
export { v as default };
|
package/dist/author/trait.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/configure/src/trait.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
declare function TraitTile({ error, trait: { name, standards, description, scorePointsDescriptors }, traitLabel, scorePointsValues, showStandards, showDescription, enableDragAndDrop, currentPosition, secondaryBlockWidth, spellCheck, maxPoints, uploadSoundSupport, mathMlOptions, expandedPluginProps, labelPluginProps, imageSupport, index, onTraitChanged, onTraitRemoved, onTraitDropped, }: {
|
|
12
|
-
error: any;
|
|
13
|
-
trait: {
|
|
14
|
-
name: any;
|
|
15
|
-
standards: any;
|
|
16
|
-
description: any;
|
|
17
|
-
scorePointsDescriptors: any;
|
|
18
|
-
};
|
|
19
|
-
traitLabel: any;
|
|
20
|
-
scorePointsValues: any;
|
|
21
|
-
showStandards: any;
|
|
22
|
-
showDescription: any;
|
|
23
|
-
enableDragAndDrop: any;
|
|
24
|
-
currentPosition: any;
|
|
25
|
-
secondaryBlockWidth: any;
|
|
26
|
-
spellCheck: any;
|
|
27
|
-
maxPoints: any;
|
|
28
|
-
uploadSoundSupport: any;
|
|
29
|
-
mathMlOptions?: {} | undefined;
|
|
30
|
-
expandedPluginProps?: {} | undefined;
|
|
31
|
-
labelPluginProps?: {} | undefined;
|
|
32
|
-
imageSupport?: {} | undefined;
|
|
33
|
-
index: any;
|
|
34
|
-
onTraitChanged: any;
|
|
35
|
-
onTraitRemoved: any;
|
|
36
|
-
onTraitDropped: any;
|
|
37
|
-
}): React.JSX.Element;
|
|
38
|
-
declare namespace TraitTile {
|
|
39
|
-
var propTypes: {
|
|
40
|
-
error: PropTypes.Requireable<object>;
|
|
41
|
-
index: PropTypes.Validator<number>;
|
|
42
|
-
onTraitChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
43
|
-
onTraitRemoved: PropTypes.Validator<(...args: any[]) => any>;
|
|
44
|
-
onTraitDropped: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
-
trait: PropTypes.Requireable<PropTypes.InferProps<{
|
|
46
|
-
name: PropTypes.Requireable<string>;
|
|
47
|
-
standards: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
48
|
-
scorePointsDescriptors: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
49
|
-
description: PropTypes.Requireable<string>;
|
|
50
|
-
}>>;
|
|
51
|
-
traitLabel: PropTypes.Requireable<string>;
|
|
52
|
-
scorePointsValues: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
53
|
-
showStandards: PropTypes.Requireable<boolean>;
|
|
54
|
-
showDescription: PropTypes.Requireable<boolean>;
|
|
55
|
-
maxPoints: PropTypes.Requireable<number>;
|
|
56
|
-
enableDragAndDrop: PropTypes.Requireable<boolean>;
|
|
57
|
-
currentPosition: PropTypes.Requireable<number>;
|
|
58
|
-
secondaryBlockWidth: PropTypes.Requireable<number>;
|
|
59
|
-
spellCheck: PropTypes.Requireable<boolean>;
|
|
60
|
-
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
61
|
-
mathMlOptions: PropTypes.Requireable<object>;
|
|
62
|
-
expandedPluginProps: PropTypes.Requireable<object>;
|
|
63
|
-
labelPluginProps: PropTypes.Requireable<object>;
|
|
64
|
-
imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
|
-
add: PropTypes.Validator<(...args: any[]) => any>;
|
|
66
|
-
delete: PropTypes.Validator<(...args: any[]) => any>;
|
|
67
|
-
}>>;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
export default TraitTile;
|
package/dist/author/trait.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { Block as e, ExpandedInput as t, PrimaryBlock as n, Row as r, SecondaryBlock as i, UnderlinedInput as a } from "./common.js";
|
|
2
|
-
import o from "react";
|
|
3
|
-
import s from "prop-types";
|
|
4
|
-
import { styled as c } from "@mui/material/styles";
|
|
5
|
-
import { InlineMenu as l, color as u } from "@pie-lib/render-ui";
|
|
6
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
-
import { isEmpty as p } from "@pie-element/shared-lodash";
|
|
8
|
-
import m from "@mui/material/IconButton";
|
|
9
|
-
import h from "@mui/material/MenuItem";
|
|
10
|
-
import g from "@mui/icons-material/MoreVert";
|
|
11
|
-
import _ from "debug";
|
|
12
|
-
import { useDraggable as v, useDroppable as y } from "@dnd-kit/core";
|
|
13
|
-
import b from "@mui/icons-material/DragIndicator";
|
|
14
|
-
//#region src/author/trait.tsx
|
|
15
|
-
_("@pie-element:placement-ordering:configure:trait-tile");
|
|
16
|
-
var x = c(b)({ color: u.text() }), S = c(n)(({ theme: e }) => ({
|
|
17
|
-
display: "flex",
|
|
18
|
-
flexDirection: "column",
|
|
19
|
-
justifyContent: "space-between",
|
|
20
|
-
marginBottom: e.spacing(5),
|
|
21
|
-
touchAction: "none"
|
|
22
|
-
})), C = c("div")({
|
|
23
|
-
display: "flex",
|
|
24
|
-
alignItems: "center",
|
|
25
|
-
width: "100%",
|
|
26
|
-
cursor: "pointer"
|
|
27
|
-
}), w = c(m)({ marginLeft: "auto" }), ee = c("div")({
|
|
28
|
-
display: "flex",
|
|
29
|
-
whiteSpace: "break-spaces"
|
|
30
|
-
}), T = c("div")(({ theme: e }) => ({
|
|
31
|
-
fontSize: e.typography.fontSize - 2,
|
|
32
|
-
color: e.palette.error.main,
|
|
33
|
-
paddingBottom: e.spacing(1)
|
|
34
|
-
}));
|
|
35
|
-
function E({ error: n, trait: { name: s, standards: c, description: u, scorePointsDescriptors: m }, traitLabel: _, scorePointsValues: b, showStandards: E, showDescription: D, enableDragAndDrop: O, currentPosition: k, secondaryBlockWidth: A, spellCheck: j, maxPoints: M, uploadSoundSupport: N, mathMlOptions: P = {}, expandedPluginProps: F = {}, labelPluginProps: I = {}, imageSupport: L = {}, index: R, onTraitChanged: z, onTraitRemoved: B, onTraitDropped: te }) {
|
|
36
|
-
let [V, H] = o.useState(null), U = o.useRef(null), { attributes: W, listeners: G, setNodeRef: K, transform: q, isDragging: J } = v({
|
|
37
|
-
id: `trait-${R}`,
|
|
38
|
-
data: {
|
|
39
|
-
type: "trait",
|
|
40
|
-
index: R,
|
|
41
|
-
name: s
|
|
42
|
-
}
|
|
43
|
-
}), { setNodeRef: Y } = y({
|
|
44
|
-
id: `trait-drop-${R}`,
|
|
45
|
-
data: {
|
|
46
|
-
type: "trait",
|
|
47
|
-
index: R
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
o.useLayoutEffect(() => {
|
|
51
|
-
k !== void 0 && U.current && U.current.scrollTo({ left: k });
|
|
52
|
-
}, [k]);
|
|
53
|
-
let X = (e) => {
|
|
54
|
-
p(e) || z({
|
|
55
|
-
name: s,
|
|
56
|
-
standards: c,
|
|
57
|
-
description: u,
|
|
58
|
-
scorePointsDescriptors: m,
|
|
59
|
-
...e
|
|
60
|
-
});
|
|
61
|
-
}, Z = ({ descriptor: e, value: t }) => {
|
|
62
|
-
if (t < 0 || t >= m.length) return;
|
|
63
|
-
let n = [...m];
|
|
64
|
-
n[t] = e, X({ scorePointsDescriptors: n });
|
|
65
|
-
}, Q = (e) => H(e.currentTarget), $ = () => H(null), ne = () => {
|
|
66
|
-
B(), $();
|
|
67
|
-
};
|
|
68
|
-
return /* @__PURE__ */ d("div", {
|
|
69
|
-
ref: Y,
|
|
70
|
-
style: q ? {
|
|
71
|
-
transform: `translate3d(${q.x}px, ${q.y}px, 0)`,
|
|
72
|
-
opacity: J ? .5 : 1
|
|
73
|
-
} : {},
|
|
74
|
-
children: /* @__PURE__ */ f(r, { children: [/* @__PURE__ */ f(S, { children: [
|
|
75
|
-
/* @__PURE__ */ f(C, { children: [
|
|
76
|
-
O && /* @__PURE__ */ d("span", {
|
|
77
|
-
ref: K,
|
|
78
|
-
...W,
|
|
79
|
-
...G,
|
|
80
|
-
children: /* @__PURE__ */ d(x, {})
|
|
81
|
-
}),
|
|
82
|
-
/* @__PURE__ */ d(w, {
|
|
83
|
-
"aria-label": "more",
|
|
84
|
-
"aria-controls": "long-menu",
|
|
85
|
-
"aria-haspopup": "true",
|
|
86
|
-
onClick: Q,
|
|
87
|
-
size: "large",
|
|
88
|
-
children: /* @__PURE__ */ d(g, {})
|
|
89
|
-
}),
|
|
90
|
-
/* @__PURE__ */ d(l, {
|
|
91
|
-
id: "long-menu",
|
|
92
|
-
anchorEl: V,
|
|
93
|
-
keepMounted: !0,
|
|
94
|
-
open: !!V,
|
|
95
|
-
onClose: $,
|
|
96
|
-
transitionDuration: {
|
|
97
|
-
enter: 225,
|
|
98
|
-
exit: 195
|
|
99
|
-
},
|
|
100
|
-
children: /* @__PURE__ */ d(h, {
|
|
101
|
-
onClick: ne,
|
|
102
|
-
children: /* @__PURE__ */ d(ee, { dangerouslySetInnerHTML: { __html: `Remove ${s || _}` } })
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
] }),
|
|
106
|
-
/* @__PURE__ */ d(a, {
|
|
107
|
-
markup: s,
|
|
108
|
-
error: n?.name || "",
|
|
109
|
-
onChange: (e) => X({ name: e }),
|
|
110
|
-
pluginProps: I,
|
|
111
|
-
placeholder: `Enter ${_}`,
|
|
112
|
-
spellCheck: j,
|
|
113
|
-
uploadSoundSupport: N,
|
|
114
|
-
mathMlOptions: P,
|
|
115
|
-
imageSupport: L
|
|
116
|
-
}),
|
|
117
|
-
n && /* @__PURE__ */ d(T, { children: n.name || "" })
|
|
118
|
-
] }), /* @__PURE__ */ f(i, {
|
|
119
|
-
setRef: (e) => {
|
|
120
|
-
U.current = e;
|
|
121
|
-
},
|
|
122
|
-
width: `${A}px`,
|
|
123
|
-
children: [
|
|
124
|
-
E && c && /* @__PURE__ */ d(e, { children: /* @__PURE__ */ d(t, {
|
|
125
|
-
placeholder: "Standards",
|
|
126
|
-
markup: c.join(","),
|
|
127
|
-
onChange: (e) => X({ standards: e.split(",") }),
|
|
128
|
-
pluginProps: F,
|
|
129
|
-
spellCheck: j,
|
|
130
|
-
uploadSoundSupport: N,
|
|
131
|
-
mathMlOptions: P,
|
|
132
|
-
imageSupport: L
|
|
133
|
-
}) }),
|
|
134
|
-
D && /* @__PURE__ */ f(e, { children: [/* @__PURE__ */ d(t, {
|
|
135
|
-
placeholder: "Enter Description",
|
|
136
|
-
markup: u,
|
|
137
|
-
error: n?.description || "",
|
|
138
|
-
onChange: (e) => X({ description: e }),
|
|
139
|
-
pluginProps: F,
|
|
140
|
-
spellCheck: j,
|
|
141
|
-
uploadSoundSupport: N,
|
|
142
|
-
mathMlOptions: P,
|
|
143
|
-
imageSupport: L
|
|
144
|
-
}), n && /* @__PURE__ */ d(T, { children: n.description || "" })] }),
|
|
145
|
-
(b || []).map((n, r) => {
|
|
146
|
-
let i = A - 216 * r + k - 98, a = b.length - r - 1, o;
|
|
147
|
-
try {
|
|
148
|
-
o = m[a] || "";
|
|
149
|
-
} catch {
|
|
150
|
-
o = "";
|
|
151
|
-
}
|
|
152
|
-
return /* @__PURE__ */ d(e, { children: /* @__PURE__ */ d(t, {
|
|
153
|
-
placeholder: "Enter Descriptor",
|
|
154
|
-
markup: o,
|
|
155
|
-
onChange: (e) => Z({
|
|
156
|
-
descriptor: e,
|
|
157
|
-
value: a
|
|
158
|
-
}),
|
|
159
|
-
pluginProps: F,
|
|
160
|
-
alignToRight: i < 296 && n < M,
|
|
161
|
-
spellCheck: j,
|
|
162
|
-
uploadSoundSupport: N,
|
|
163
|
-
mathMlOptions: P,
|
|
164
|
-
imageSupport: L
|
|
165
|
-
}) }, `key-key-${r}`);
|
|
166
|
-
})
|
|
167
|
-
]
|
|
168
|
-
})] })
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
E.propTypes = {
|
|
172
|
-
error: s.object,
|
|
173
|
-
index: s.number.isRequired,
|
|
174
|
-
onTraitChanged: s.func.isRequired,
|
|
175
|
-
onTraitRemoved: s.func.isRequired,
|
|
176
|
-
onTraitDropped: s.func,
|
|
177
|
-
trait: s.shape({
|
|
178
|
-
name: s.string,
|
|
179
|
-
standards: s.arrayOf(s.string),
|
|
180
|
-
scorePointsDescriptors: s.arrayOf(s.string),
|
|
181
|
-
description: s.string
|
|
182
|
-
}),
|
|
183
|
-
traitLabel: s.string,
|
|
184
|
-
scorePointsValues: s.arrayOf(s.number),
|
|
185
|
-
showStandards: s.bool,
|
|
186
|
-
showDescription: s.bool,
|
|
187
|
-
maxPoints: s.number,
|
|
188
|
-
enableDragAndDrop: s.bool,
|
|
189
|
-
currentPosition: s.number,
|
|
190
|
-
secondaryBlockWidth: s.number,
|
|
191
|
-
spellCheck: s.bool,
|
|
192
|
-
uploadSoundSupport: s.object,
|
|
193
|
-
mathMlOptions: s.object,
|
|
194
|
-
expandedPluginProps: s.object,
|
|
195
|
-
labelPluginProps: s.object,
|
|
196
|
-
imageSupport: s.shape({
|
|
197
|
-
add: s.func.isRequired,
|
|
198
|
-
delete: s.func.isRequired
|
|
199
|
-
})
|
|
200
|
-
};
|
|
201
|
-
//#endregion
|
|
202
|
-
export { E as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/configure/src/traitsHeader.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class TraitsHeaderTile extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
maxPointsEnabled: PropTypes.Requireable<boolean>;
|
|
14
|
-
spellCheck: PropTypes.Requireable<boolean>;
|
|
15
|
-
errors: PropTypes.Requireable<object>;
|
|
16
|
-
};
|
|
17
|
-
state: {
|
|
18
|
-
anchorEl: null;
|
|
19
|
-
};
|
|
20
|
-
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
21
|
-
onScorePointLabelChange: any;
|
|
22
|
-
handleClick: (event: any) => void;
|
|
23
|
-
handleClose: () => void;
|
|
24
|
-
scrollToPosition: any;
|
|
25
|
-
openMenu: any;
|
|
26
|
-
render(): React.JSX.Element;
|
|
27
|
-
}
|
|
28
|
-
export default TraitsHeaderTile;
|