@pie-element/multi-trait-rubric 8.1.2-next.0 → 8.1.2-next.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/dist/author/main.d.ts +1 -1
- package/dist/author/main.js +62 -64
- package/dist/author/trait.js +81 -81
- package/dist/browser/{Typography-CdgSBeUZ.js → Typography-CGQjcqGj.js} +303 -287
- package/dist/browser/Typography-CGQjcqGj.js.map +1 -0
- package/dist/browser/author/index.js +6167 -7335
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +48 -48
- package/dist/index.iife.js +21 -21
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +12 -9
- package/dist/browser/Typography-CdgSBeUZ.js.map +0 -1
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +0 -50
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
package/dist/author/main.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class Main extends React.Component {
|
|
|
23
23
|
componentWillUnmount(): void;
|
|
24
24
|
componentDidUpdate(): void;
|
|
25
25
|
updateDivWidth(): void;
|
|
26
|
-
updateDivWidthDebounced:
|
|
26
|
+
updateDivWidthDebounced: import("@pie-element/shared-lodash").CancelableFunction<() => void>;
|
|
27
27
|
onScaleAdded: any;
|
|
28
28
|
onScaleChanged: any;
|
|
29
29
|
onScaleRemoved: any;
|
package/dist/author/main.js
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import l from "
|
|
8
|
-
import u from "react";
|
|
9
|
-
import
|
|
10
|
-
import { styled as f } from "@mui/material/styles";
|
|
11
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
1
|
+
import { ExcludeZeroDialog as e, IncludeZeroDialog as t, InfoDialog as n, excludeZeroTypes as r } from "./modals.js";
|
|
2
|
+
import { addOrRemoveScaleColumn as i } from "./utils.js";
|
|
3
|
+
import { MultiTraitButton as a } from "./common.js";
|
|
4
|
+
import o from "./scale.js";
|
|
5
|
+
import s from "react";
|
|
6
|
+
import c from "prop-types";
|
|
7
|
+
import { styled as l } from "@mui/material/styles";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
+
import { cloneDeep as f, debounce as p, isEmpty as m } from "@pie-element/shared-lodash";
|
|
12
10
|
import { layout as h, settings as g } from "@pie-lib/config-ui";
|
|
13
11
|
//#region src/author/main.tsx
|
|
14
|
-
var { Panel: _, toggle: v } = g, y = "650px", b =
|
|
12
|
+
var { Panel: _, toggle: v } = g, y = "650px", b = l("div")(({ theme: e }) => ({
|
|
15
13
|
fontFamily: "Cerebri Sans",
|
|
16
14
|
fontSize: e.typography.fontSize + 2,
|
|
17
15
|
padding: "16px 0"
|
|
18
|
-
})), x = ({ showExcludeZeroDialog:
|
|
19
|
-
open:
|
|
20
|
-
changeExcludeZero:
|
|
16
|
+
})), x = ({ showExcludeZeroDialog: n, excludeZero: r, changeExcludeZero: i, cancel: a }) => n && !r ? /* @__PURE__ */ u(e, {
|
|
17
|
+
open: n && !r,
|
|
18
|
+
changeExcludeZero: i,
|
|
21
19
|
cancel: a
|
|
22
|
-
}) :
|
|
23
|
-
open:
|
|
24
|
-
changeExcludeZero:
|
|
20
|
+
}) : n && r ? /* @__PURE__ */ u(t, {
|
|
21
|
+
open: n && r,
|
|
22
|
+
changeExcludeZero: i,
|
|
25
23
|
cancel: a
|
|
26
24
|
}) : null;
|
|
27
25
|
x.propTypes = {
|
|
28
|
-
showExcludeZeroDialog:
|
|
29
|
-
excludeZero:
|
|
30
|
-
changeExcludeZero:
|
|
31
|
-
cancel:
|
|
26
|
+
showExcludeZeroDialog: c.bool,
|
|
27
|
+
excludeZero: c.bool,
|
|
28
|
+
changeExcludeZero: c.func,
|
|
29
|
+
cancel: c.func
|
|
32
30
|
};
|
|
33
|
-
var S = class extends
|
|
31
|
+
var S = class extends s.Component {
|
|
34
32
|
constructor(e) {
|
|
35
|
-
super(e), this.divRef =
|
|
33
|
+
super(e), this.divRef = s.createRef(), this.updateDivWidth = this.updateDivWidth.bind(this);
|
|
36
34
|
}
|
|
37
35
|
state = {
|
|
38
36
|
showDecreaseMaxPointsDialog: !1,
|
|
@@ -59,7 +57,7 @@ var S = class extends u.Component {
|
|
|
59
57
|
e !== this.state.adjustedWidth && this.set({ adjustedWidth: e });
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
updateDivWidthDebounced =
|
|
60
|
+
updateDivWidthDebounced = p(() => this.updateDivWidth(), 50);
|
|
63
61
|
onScaleAdded = () => {
|
|
64
62
|
let { model: e, onModelChanged: t, configuration: n } = this.props, { scales: r, excludeZero: i } = e || {}, { maxNoOfScales: a } = n || {}, { defaultTraitLabel: o } = n || "";
|
|
65
63
|
if (r.length || (r = []), o = typeof o == "string" ? o : r[0]?.traitLabel || "", r.length === a) return this.set({
|
|
@@ -76,14 +74,14 @@ var S = class extends u.Component {
|
|
|
76
74
|
scales: r
|
|
77
75
|
});
|
|
78
76
|
};
|
|
79
|
-
onScaleChanged = (
|
|
80
|
-
let { model:
|
|
81
|
-
if (
|
|
82
|
-
Object.keys(
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
...
|
|
86
|
-
scales:
|
|
77
|
+
onScaleChanged = (e, t) => {
|
|
78
|
+
let { model: n, onModelChanged: a } = this.props, o = f((n || {}).scales);
|
|
79
|
+
if (e < 0 || e >= o.length || m(t)) return !1;
|
|
80
|
+
Object.keys(t).forEach((n) => {
|
|
81
|
+
o[e][n] = t[n];
|
|
82
|
+
}), n.excludeZero && t.maxPoints === 1 && (n.excludeZero = !1, o = i(o, r.add0)), a({
|
|
83
|
+
...n,
|
|
84
|
+
scales: o
|
|
87
85
|
});
|
|
88
86
|
};
|
|
89
87
|
onScaleRemoved = (e) => {
|
|
@@ -140,14 +138,14 @@ var S = class extends u.Component {
|
|
|
140
138
|
};
|
|
141
139
|
onCloseInfoDialog = () => this.set({ showInfoDialog: !1 });
|
|
142
140
|
changeExcludeZero = (e) => {
|
|
143
|
-
let { model: t, onModelChanged: n } = this.props || {}, { scales: r } = t || {}, { excludeZero:
|
|
141
|
+
let { model: t, onModelChanged: n } = this.props || {}, { scales: r } = t || {}, { excludeZero: a } = t || {};
|
|
144
142
|
if (!r || !r.length) return;
|
|
145
|
-
|
|
146
|
-
let
|
|
143
|
+
a = !a;
|
|
144
|
+
let o = i(r, e);
|
|
147
145
|
n({
|
|
148
146
|
...t,
|
|
149
|
-
scales:
|
|
150
|
-
excludeZero:
|
|
147
|
+
scales: o,
|
|
148
|
+
excludeZero: a
|
|
151
149
|
}), this.hideToggleExcludeZeroModal();
|
|
152
150
|
};
|
|
153
151
|
onModelChanged = (e, t) => {
|
|
@@ -155,34 +153,34 @@ var S = class extends u.Component {
|
|
|
155
153
|
t === "excludeZero" ? this.showToggleExcludeZeroModal() : n(e);
|
|
156
154
|
};
|
|
157
155
|
render() {
|
|
158
|
-
let { model: e, configuration: t, onConfigurationChanged:
|
|
156
|
+
let { model: e, configuration: t, onConfigurationChanged: r, uploadSoundSupport: i, imageSupport: s } = this.props || {}, { addScale: c, baseInputConfiguration: l = {}, dragAndDrop: f, contentDimensions: p = {}, showDescription: m, showExcludeZero: g, showLevelTagInput: y, showStandards: S, showHalfScoring: C, showMaxPoint: w, showScorePointLabels: T, showVisibleToStudent: E, spellCheck: D = {}, settingsPanelDisabled: O, maxNoOfTraits: k, minNoOfTraits: A, width: j, mathMlOptions: M = {}, maxMaxPoints: N, expandedInput: P = {}, labelInput: F = {} } = t || {}, { errors: I, extraCSSRules: L, scales: R, excludeZero: z, description: B, pointLabels: V, standards: H, spellCheckEnabled: U, maxPointsEnabled: W, addScaleEnabled: G } = e || {}, { showExcludeZeroDialog: K, showInfoDialog: q, infoDialogText: J, adjustedWidth: Y } = this.state || {}, X = R?.some((e) => e.maxPoints === 1), Z = {
|
|
159
157
|
standards: S.settings && v(S.label),
|
|
160
158
|
"showLevelTagInput.enabled": y.settings && v(y.label, !0),
|
|
161
159
|
visibleToStudent: E.settings && v(E.label),
|
|
162
160
|
excludeZero: g.settings && v(g.label, !1, X),
|
|
163
161
|
halfScoring: C.settings && v(C.label),
|
|
164
|
-
"dragAndDrop.enabled":
|
|
162
|
+
"dragAndDrop.enabled": f.settings && v(f.label, !0)
|
|
165
163
|
}, Q = {
|
|
166
|
-
description:
|
|
164
|
+
description: m.settings && v(m.label),
|
|
167
165
|
pointLabels: T.settings && v(T.label),
|
|
168
166
|
spellCheckEnabled: D.settings && v(D.label),
|
|
169
167
|
maxPointsEnabled: w.settings && v(w.label),
|
|
170
|
-
addScaleEnabled:
|
|
171
|
-
}, $ = (e) => Object.assign({ ...
|
|
172
|
-
return /* @__PURE__ */
|
|
168
|
+
addScaleEnabled: c.settings && v(c.label)
|
|
169
|
+
}, $ = (e) => Object.assign({ ...l }, e || {});
|
|
170
|
+
return /* @__PURE__ */ d(h.ConfigLayout, {
|
|
173
171
|
extraCSSRules: L,
|
|
174
|
-
dimensions:
|
|
172
|
+
dimensions: p,
|
|
175
173
|
hideSettings: O,
|
|
176
|
-
settings: /* @__PURE__ */
|
|
174
|
+
settings: /* @__PURE__ */ u(_, {
|
|
177
175
|
model: e,
|
|
178
176
|
onChangeModel: this.onModelChanged,
|
|
179
177
|
configuration: t,
|
|
180
|
-
onChangeConfiguration:
|
|
178
|
+
onChangeConfiguration: r,
|
|
181
179
|
groups: {
|
|
182
180
|
Settings: Z,
|
|
183
181
|
Properties: Q
|
|
184
182
|
},
|
|
185
|
-
modal: /* @__PURE__ */
|
|
183
|
+
modal: /* @__PURE__ */ u(x, {
|
|
186
184
|
showExcludeZeroDialog: K,
|
|
187
185
|
excludeZero: z,
|
|
188
186
|
changeExcludeZero: this.changeExcludeZero,
|
|
@@ -190,13 +188,13 @@ var S = class extends u.Component {
|
|
|
190
188
|
})
|
|
191
189
|
}),
|
|
192
190
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ u("div", {
|
|
194
192
|
style: { width: "100%" },
|
|
195
193
|
ref: this.divRef
|
|
196
194
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ d(b, {
|
|
198
196
|
style: { width: j || Y },
|
|
199
|
-
children: [(R || []).map((e, t) => /* @__PURE__ */
|
|
197
|
+
children: [(R || []).map((e, t) => /* @__PURE__ */ u(o, {
|
|
200
198
|
scale: e,
|
|
201
199
|
scaleIndex: t,
|
|
202
200
|
errors: I,
|
|
@@ -207,25 +205,25 @@ var S = class extends u.Component {
|
|
|
207
205
|
showDescription: B,
|
|
208
206
|
showLevelTagInput: y.enabled,
|
|
209
207
|
excludeZero: z,
|
|
210
|
-
enableDragAndDrop:
|
|
208
|
+
enableDragAndDrop: f.enabled,
|
|
211
209
|
spellCheck: U,
|
|
212
210
|
width: Y,
|
|
213
|
-
uploadSoundSupport:
|
|
211
|
+
uploadSoundSupport: i,
|
|
214
212
|
maxPointsEnabled: W,
|
|
215
213
|
maxNoOfTraits: k,
|
|
216
214
|
minNoOfTraits: A,
|
|
217
|
-
imageSupport:
|
|
215
|
+
imageSupport: s,
|
|
218
216
|
...this.props,
|
|
219
217
|
mathMlOptions: M,
|
|
220
218
|
maxMaxPoints: N,
|
|
221
219
|
expandedPluginProps: $(P?.inputConfiguration),
|
|
222
220
|
labelPluginProps: $(F?.inputConfiguration)
|
|
223
|
-
}, `scale-${t}`)), G && /* @__PURE__ */
|
|
221
|
+
}, `scale-${t}`)), G && /* @__PURE__ */ u(a, {
|
|
224
222
|
onClick: this.onScaleAdded,
|
|
225
223
|
children: "Add Scale"
|
|
226
224
|
})]
|
|
227
225
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ u(n, {
|
|
229
227
|
open: q,
|
|
230
228
|
text: J,
|
|
231
229
|
onClose: () => this.set({ showInfoDialog: !1 })
|
|
@@ -235,14 +233,14 @@ var S = class extends u.Component {
|
|
|
235
233
|
}
|
|
236
234
|
};
|
|
237
235
|
S.propTypes = {
|
|
238
|
-
model:
|
|
239
|
-
uploadSoundSupport:
|
|
240
|
-
configuration:
|
|
241
|
-
onModelChanged:
|
|
242
|
-
onConfigurationChanged:
|
|
243
|
-
imageSupport:
|
|
244
|
-
add:
|
|
245
|
-
delete:
|
|
236
|
+
model: c.object,
|
|
237
|
+
uploadSoundSupport: c.object,
|
|
238
|
+
configuration: c.object,
|
|
239
|
+
onModelChanged: c.func,
|
|
240
|
+
onConfigurationChanged: c.func,
|
|
241
|
+
imageSupport: c.shape({
|
|
242
|
+
add: c.func.isRequired,
|
|
243
|
+
delete: c.func.isRequired
|
|
246
244
|
})
|
|
247
245
|
};
|
|
248
246
|
//#endregion
|
package/dist/author/trait.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import s from "
|
|
4
|
-
import c from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
8
|
import m from "@mui/material/IconButton";
|
|
9
9
|
import h from "@mui/material/MenuItem";
|
|
10
10
|
import g from "@mui/icons-material/MoreVert";
|
|
@@ -13,32 +13,32 @@ import { useDraggable as v, useDroppable as y } from "@dnd-kit/core";
|
|
|
13
13
|
import b from "@mui/icons-material/DragIndicator";
|
|
14
14
|
//#region src/author/trait.tsx
|
|
15
15
|
_("@pie-element:placement-ordering:configure:trait-tile");
|
|
16
|
-
var x =
|
|
16
|
+
var x = c(b)({ color: u.text() }), S = c(n)(({ theme: e }) => ({
|
|
17
17
|
display: "flex",
|
|
18
18
|
flexDirection: "column",
|
|
19
19
|
justifyContent: "space-between",
|
|
20
20
|
marginBottom: e.spacing(5),
|
|
21
21
|
touchAction: "none"
|
|
22
|
-
})), C =
|
|
22
|
+
})), C = c("div")({
|
|
23
23
|
display: "flex",
|
|
24
24
|
alignItems: "center",
|
|
25
25
|
width: "100%",
|
|
26
26
|
cursor: "pointer"
|
|
27
|
-
}), w =
|
|
27
|
+
}), w = c(m)({ marginLeft: "auto" }), ee = c("div")({
|
|
28
28
|
display: "flex",
|
|
29
29
|
whiteSpace: "break-spaces"
|
|
30
|
-
}),
|
|
30
|
+
}), T = c("div")(({ theme: e }) => ({
|
|
31
31
|
fontSize: e.typography.fontSize - 2,
|
|
32
32
|
color: e.palette.error.main,
|
|
33
33
|
paddingBottom: e.spacing(1)
|
|
34
34
|
}));
|
|
35
|
-
function
|
|
36
|
-
let [V, H] =
|
|
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
37
|
id: `trait-${R}`,
|
|
38
38
|
data: {
|
|
39
39
|
type: "trait",
|
|
40
40
|
index: R,
|
|
41
|
-
name:
|
|
41
|
+
name: s
|
|
42
42
|
}
|
|
43
43
|
}), { setNodeRef: Y } = y({
|
|
44
44
|
id: `trait-drop-${R}`,
|
|
@@ -47,16 +47,16 @@ function D({ error: r, trait: { name: c, standards: l, description: d, scorePoin
|
|
|
47
47
|
index: R
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
let X = (
|
|
54
|
-
e
|
|
55
|
-
name:
|
|
56
|
-
standards:
|
|
57
|
-
description:
|
|
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
58
|
scorePointsDescriptors: m,
|
|
59
|
-
...
|
|
59
|
+
...e
|
|
60
60
|
});
|
|
61
61
|
}, Z = ({ descriptor: e, value: t }) => {
|
|
62
62
|
if (t < 0 || t >= m.length) return;
|
|
@@ -65,29 +65,29 @@ function D({ error: r, trait: { name: c, standards: l, description: d, scorePoin
|
|
|
65
65
|
}, Q = (e) => H(e.currentTarget), $ = () => H(null), ne = () => {
|
|
66
66
|
B(), $();
|
|
67
67
|
};
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ d("div", {
|
|
69
69
|
ref: Y,
|
|
70
70
|
style: q ? {
|
|
71
71
|
transform: `translate3d(${q.x}px, ${q.y}px, 0)`,
|
|
72
72
|
opacity: J ? .5 : 1
|
|
73
73
|
} : {},
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
74
|
+
children: /* @__PURE__ */ f(r, { children: [/* @__PURE__ */ f(S, { children: [
|
|
75
|
+
/* @__PURE__ */ f(C, { children: [
|
|
76
|
+
O && /* @__PURE__ */ d("span", {
|
|
77
77
|
ref: K,
|
|
78
78
|
...W,
|
|
79
79
|
...G,
|
|
80
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ d(x, {})
|
|
81
81
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ d(w, {
|
|
83
83
|
"aria-label": "more",
|
|
84
84
|
"aria-controls": "long-menu",
|
|
85
85
|
"aria-haspopup": "true",
|
|
86
86
|
onClick: Q,
|
|
87
87
|
size: "large",
|
|
88
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ d(g, {})
|
|
89
89
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ d(l, {
|
|
91
91
|
id: "long-menu",
|
|
92
92
|
anchorEl: V,
|
|
93
93
|
keepMounted: !0,
|
|
@@ -97,59 +97,59 @@ function D({ error: r, trait: { name: c, standards: l, description: d, scorePoin
|
|
|
97
97
|
enter: 225,
|
|
98
98
|
exit: 195
|
|
99
99
|
},
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ d(h, {
|
|
101
101
|
onClick: ne,
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ d(ee, { dangerouslySetInnerHTML: { __html: `Remove ${s || _}` } })
|
|
103
103
|
})
|
|
104
104
|
})
|
|
105
105
|
] }),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
markup:
|
|
108
|
-
error:
|
|
106
|
+
/* @__PURE__ */ d(a, {
|
|
107
|
+
markup: s,
|
|
108
|
+
error: n?.name || "",
|
|
109
109
|
onChange: (e) => X({ name: e }),
|
|
110
110
|
pluginProps: I,
|
|
111
111
|
placeholder: `Enter ${_}`,
|
|
112
|
-
spellCheck:
|
|
112
|
+
spellCheck: j,
|
|
113
113
|
uploadSoundSupport: N,
|
|
114
114
|
mathMlOptions: P,
|
|
115
115
|
imageSupport: L
|
|
116
116
|
}),
|
|
117
|
-
|
|
118
|
-
] }), /* @__PURE__ */
|
|
117
|
+
n && /* @__PURE__ */ d(T, { children: n.name || "" })
|
|
118
|
+
] }), /* @__PURE__ */ f(i, {
|
|
119
119
|
setRef: (e) => {
|
|
120
120
|
U.current = e;
|
|
121
121
|
},
|
|
122
|
-
width: `${
|
|
122
|
+
width: `${A}px`,
|
|
123
123
|
children: [
|
|
124
|
-
|
|
124
|
+
E && c && /* @__PURE__ */ d(e, { children: /* @__PURE__ */ d(t, {
|
|
125
125
|
placeholder: "Standards",
|
|
126
|
-
markup:
|
|
126
|
+
markup: c.join(","),
|
|
127
127
|
onChange: (e) => X({ standards: e.split(",") }),
|
|
128
128
|
pluginProps: F,
|
|
129
|
-
spellCheck:
|
|
129
|
+
spellCheck: j,
|
|
130
130
|
uploadSoundSupport: N,
|
|
131
131
|
mathMlOptions: P,
|
|
132
132
|
imageSupport: L
|
|
133
133
|
}) }),
|
|
134
|
-
|
|
134
|
+
D && /* @__PURE__ */ f(e, { children: [/* @__PURE__ */ d(t, {
|
|
135
135
|
placeholder: "Enter Description",
|
|
136
|
-
markup:
|
|
137
|
-
error:
|
|
136
|
+
markup: u,
|
|
137
|
+
error: n?.description || "",
|
|
138
138
|
onChange: (e) => X({ description: e }),
|
|
139
139
|
pluginProps: F,
|
|
140
|
-
spellCheck:
|
|
140
|
+
spellCheck: j,
|
|
141
141
|
uploadSoundSupport: N,
|
|
142
142
|
mathMlOptions: P,
|
|
143
143
|
imageSupport: L
|
|
144
|
-
}),
|
|
145
|
-
(b || []).map((
|
|
146
|
-
let i =
|
|
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
147
|
try {
|
|
148
148
|
o = m[a] || "";
|
|
149
149
|
} catch {
|
|
150
150
|
o = "";
|
|
151
151
|
}
|
|
152
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ d(e, { children: /* @__PURE__ */ d(t, {
|
|
153
153
|
placeholder: "Enter Descriptor",
|
|
154
154
|
markup: o,
|
|
155
155
|
onChange: (e) => Z({
|
|
@@ -157,8 +157,8 @@ function D({ error: r, trait: { name: c, standards: l, description: d, scorePoin
|
|
|
157
157
|
value: a
|
|
158
158
|
}),
|
|
159
159
|
pluginProps: F,
|
|
160
|
-
alignToRight: i < 296 &&
|
|
161
|
-
spellCheck:
|
|
160
|
+
alignToRight: i < 296 && n < M,
|
|
161
|
+
spellCheck: j,
|
|
162
162
|
uploadSoundSupport: N,
|
|
163
163
|
mathMlOptions: P,
|
|
164
164
|
imageSupport: L
|
|
@@ -168,35 +168,35 @@ function D({ error: r, trait: { name: c, standards: l, description: d, scorePoin
|
|
|
168
168
|
})] })
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
error:
|
|
173
|
-
index:
|
|
174
|
-
onTraitChanged:
|
|
175
|
-
onTraitRemoved:
|
|
176
|
-
onTraitDropped:
|
|
177
|
-
trait:
|
|
178
|
-
name:
|
|
179
|
-
standards:
|
|
180
|
-
scorePointsDescriptors:
|
|
181
|
-
description:
|
|
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
182
|
}),
|
|
183
|
-
traitLabel:
|
|
184
|
-
scorePointsValues:
|
|
185
|
-
showStandards:
|
|
186
|
-
showDescription:
|
|
187
|
-
maxPoints:
|
|
188
|
-
enableDragAndDrop:
|
|
189
|
-
currentPosition:
|
|
190
|
-
secondaryBlockWidth:
|
|
191
|
-
spellCheck:
|
|
192
|
-
uploadSoundSupport:
|
|
193
|
-
mathMlOptions:
|
|
194
|
-
expandedPluginProps:
|
|
195
|
-
labelPluginProps:
|
|
196
|
-
imageSupport:
|
|
197
|
-
add:
|
|
198
|
-
delete:
|
|
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
199
|
})
|
|
200
200
|
};
|
|
201
201
|
//#endregion
|
|
202
|
-
export {
|
|
202
|
+
export { E as default };
|