@pie-element/ebsr 14.2.2-next.2 → 14.2.2-next.3
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/index.js +32 -30
- package/dist/author/main.d.ts +1 -0
- package/dist/author/main.js +72 -70
- package/dist/browser/author/index.js +44225 -12187
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/delivery/index.js +25 -25
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/delivery-Cux64B2b.js +1282 -0
- package/dist/browser/delivery-Cux64B2b.js.map +1 -0
- package/dist/browser/dist-nl5urzAW.js +107 -0
- package/dist/browser/{dist-CaWRqnXk.js.map → dist-nl5urzAW.js.map} +1 -1
- package/dist/browser/ebsr.css +2 -0
- package/dist/browser/print/index.js +27 -27
- package/dist/browser/print/index.js.map +1 -1
- package/dist/browser/private-tags-a8AK69v5.js +9579 -0
- package/dist/browser/private-tags-a8AK69v5.js.map +1 -0
- package/dist/delivery/index.js +29 -28
- package/dist/index.iife.js +4 -4
- package/dist/print/index.js +32 -31
- package/dist/private-tags.d.ts +2 -0
- package/dist/private-tags.js +3 -0
- package/package.json +2 -2
- package/dist/browser/browser-CdX8WGiZ.js +0 -207
- package/dist/browser/browser-CdX8WGiZ.js.map +0 -1
- package/dist/browser/dist-CaWRqnXk.js +0 -62
- package/dist/browser/dist-DQkngCcw.js +0 -36
- package/dist/browser/dist-DQkngCcw.js.map +0 -1
package/dist/author/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "./
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import o from "@pie-element/
|
|
1
|
+
import { EBSR_MULTIPLE_CHOICE_CONFIGURE_TAG as e } from "../private-tags.js";
|
|
2
|
+
import t from "./main.js";
|
|
3
|
+
import n from "./defaults.js";
|
|
4
|
+
import { defaults as r } from "@pie-element/shared-lodash";
|
|
5
|
+
import i from "react";
|
|
6
|
+
import { createRoot as a } from "react-dom/client";
|
|
7
|
+
import { ModelUpdatedEvent as o } from "@pie-element/shared-configure-events";
|
|
8
|
+
import s from "@pie-element/multiple-choice/author";
|
|
8
9
|
//#region src/author/index.ts
|
|
9
|
-
var
|
|
10
|
-
customElements.get(
|
|
11
|
-
var
|
|
12
|
-
configuration:
|
|
13
|
-
model:
|
|
14
|
-
}), { model:
|
|
15
|
-
static createDefaultModel = ({ partA: e = {}, partB: t = {}, ...n } = {}, r =
|
|
10
|
+
var c = o.TYPE, l = e, u = class extends s {};
|
|
11
|
+
customElements.get(l) || customElements.define(l, u);
|
|
12
|
+
var d = (e, t) => ({
|
|
13
|
+
configuration: r(e, n.configuration),
|
|
14
|
+
model: t
|
|
15
|
+
}), { model: f } = n || {}, p = class e extends HTMLElement {
|
|
16
|
+
static createDefaultModel = ({ partA: e = {}, partB: t = {}, ...n } = {}, r = f) => ({
|
|
16
17
|
...r,
|
|
17
18
|
...n,
|
|
18
19
|
partA: {
|
|
@@ -27,22 +28,22 @@ var u = (e, r) => ({
|
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
30
|
constructor() {
|
|
30
|
-
super(), this._root = null, this._model =
|
|
31
|
+
super(), this._root = null, this._model = e.createDefaultModel(), this._configuration = n.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
31
32
|
}
|
|
32
|
-
set model(
|
|
33
|
-
this._model =
|
|
33
|
+
set model(t) {
|
|
34
|
+
this._model = e.createDefaultModel(t, this._model), this._render();
|
|
34
35
|
}
|
|
35
36
|
dispatchModelUpdated(e) {
|
|
36
37
|
let t = !!e;
|
|
37
|
-
this.dispatchEvent(new
|
|
38
|
+
this.dispatchEvent(new o(this._model, t));
|
|
38
39
|
}
|
|
39
|
-
onModelChanged = (
|
|
40
|
-
this._model =
|
|
40
|
+
onModelChanged = (t, n) => {
|
|
41
|
+
this._model = e.createDefaultModel(t, this._model), this.dispatchModelUpdated(n), this._render();
|
|
41
42
|
};
|
|
42
43
|
set configuration(e) {
|
|
43
|
-
let
|
|
44
|
-
...
|
|
45
|
-
...
|
|
44
|
+
let t = d(e, this._model), r = {
|
|
45
|
+
...n.configuration,
|
|
46
|
+
...t.configuration
|
|
46
47
|
};
|
|
47
48
|
this._configuration = r, r?.language?.enabled ? r?.languageChoices?.options?.length && (this._model.language = r?.languageChoices.options[0].value) : r.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
|
|
48
49
|
value: this._model.language,
|
|
@@ -50,29 +51,30 @@ var u = (e, r) => ({
|
|
|
50
51
|
})) : delete this._model.language, this._render();
|
|
51
52
|
}
|
|
52
53
|
onConfigurationChanged(e) {
|
|
53
|
-
this._configuration =
|
|
54
|
+
this._configuration = d(e, this._model).configuration, this._model && this.onModelChanged(this._model), this._render();
|
|
54
55
|
}
|
|
55
56
|
onModelUpdated = (e) => {
|
|
56
57
|
if (e.target === this) return;
|
|
57
58
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
58
59
|
let t = e.target && e.target.getAttribute("id");
|
|
59
|
-
t && (e.update && (this._model[`part${t}`] = e.update), this.dispatchEvent(new
|
|
60
|
+
t && (e.update && (this._model[`part${t}`] = e.update), this.dispatchEvent(new o(this._model)));
|
|
60
61
|
};
|
|
61
62
|
connectedCallback() {
|
|
62
|
-
this.addEventListener(
|
|
63
|
+
this.addEventListener(c, this.onModelUpdated), this._render();
|
|
63
64
|
}
|
|
64
65
|
_render() {
|
|
65
|
-
let
|
|
66
|
+
let e = i.createElement(t, {
|
|
66
67
|
model: this._model,
|
|
67
68
|
configuration: this._configuration,
|
|
69
|
+
multipleChoiceTagName: l,
|
|
68
70
|
onModelChanged: this.onModelChanged,
|
|
69
71
|
onConfigurationChanged: this.onConfigurationChanged
|
|
70
72
|
});
|
|
71
|
-
this._root ||=
|
|
73
|
+
this._root ||= a(this), this._root.render(e);
|
|
72
74
|
}
|
|
73
75
|
disconnectedCallback() {
|
|
74
|
-
this.removeEventListener(
|
|
76
|
+
this.removeEventListener(c, this.onModelUpdated), this._root && this._root.unmount();
|
|
75
77
|
}
|
|
76
78
|
};
|
|
77
79
|
//#endregion
|
|
78
|
-
export {
|
|
80
|
+
export { p as default };
|
package/dist/author/main.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare class Main extends React.Component {
|
|
|
12
12
|
static propTypes: {
|
|
13
13
|
configuration: PropTypes.Requireable<object>;
|
|
14
14
|
model: PropTypes.Requireable<object>;
|
|
15
|
+
multipleChoiceTagName: PropTypes.Requireable<string>;
|
|
15
16
|
onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
17
|
onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
18
|
};
|
package/dist/author/main.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { EBSR_MULTIPLE_CHOICE_CONFIGURE_TAG as e } from "../private-tags.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { layout as r, settings as i } from "@pie-lib/config-ui";
|
|
5
|
+
import { styled as a } from "@mui/material/styles";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
7
|
//#region src/author/main.tsx
|
|
7
|
-
var { Panel:
|
|
8
|
+
var { Panel: c, toggle: l, radio: u, dropdown: d } = i, f = a("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), p = a("div")(({ theme: e }) => ({
|
|
8
9
|
flex: 1,
|
|
9
10
|
height: e.spacing(2.5)
|
|
10
|
-
})),
|
|
11
|
+
})), m = class extends t.Component {
|
|
11
12
|
static propTypes = {
|
|
12
|
-
configuration:
|
|
13
|
-
model:
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
configuration: n.object,
|
|
14
|
+
model: n.object,
|
|
15
|
+
multipleChoiceTagName: n.string,
|
|
16
|
+
onModelChanged: n.func,
|
|
17
|
+
onConfigurationChanged: n.func
|
|
16
18
|
};
|
|
17
19
|
removeExtraChoices = (e) => {
|
|
18
20
|
let t = !1;
|
|
@@ -23,93 +25,93 @@ var { Panel: s, toggle: c, radio: l, dropdown: u } = r, d = i("div")(({ theme: e
|
|
|
23
25
|
return t === "partA.choiceMode" && e.partA.choiceMode === "radio" ? (e.partA.choices = this.removeExtraChoices(e.partA.choices), n(e, !0)) : t === "partB.choiceMode" && e.partB.choiceMode === "radio" ? (e.partB.choices = this.removeExtraChoices(e.partB.choices), n(e, !0)) : n(e);
|
|
24
26
|
};
|
|
25
27
|
render() {
|
|
26
|
-
let { model:
|
|
27
|
-
partA:
|
|
28
|
-
partB:
|
|
29
|
-
},
|
|
30
|
-
partLabels:
|
|
31
|
-
partLabelType:
|
|
32
|
-
partialScoring:
|
|
33
|
-
scoringType:
|
|
34
|
-
"language.enabled":
|
|
35
|
-
language:
|
|
36
|
-
},
|
|
37
|
-
"partA.choiceMode":
|
|
38
|
-
"partA.choicePrefix":
|
|
39
|
-
"partA.lockChoiceOrder":
|
|
40
|
-
"partA.choicesLayout":
|
|
28
|
+
let { model: t, configuration: n, multipleChoiceTagName: i = e, onConfigurationChanged: a } = this.props, m = i, { partLabelType: h, partA: g, partB: _, extraCSSRules: v } = t, { contentDimensions: ee = {}, partA: y = {}, partB: b = {}, partialScoring: x = {}, settingsPanelDisabled: S, scoringType: C = {}, language: w = {}, languageChoices: T = {}, ...E } = n, { feedback: D = {}, choiceMode: O = {}, choicePrefix: k = {}, lockChoiceOrder: A = {}, prompt: j = {}, teacherInstructions: M = {}, studentInstructions: N = {}, choicesLayout: P = {}, gridColumns: F = {}, rationale: I = {}, spellCheck: L = {} } = y || {}, { feedback: R = {}, choiceMode: z = {}, choicePrefix: B = {}, lockChoiceOrder: V = {}, prompt: H = {}, teacherInstructions: U = {}, studentInstructions: W = {}, choicesLayout: G = {}, gridColumns: K = {}, rationale: q = {}, spellCheck: J = {} } = b || {}, Y = (h || "Numbers") === "Numbers", X = `Part ${Y ? "1" : "A"}`, Z = `Part ${Y ? "2" : "B"}`, Q = {
|
|
29
|
+
partA: g.choices && g.choices.length ? Array.from({ length: g.choices.length }, (e, t) => `${t + 1}`) : [],
|
|
30
|
+
partB: _.choices && _.choices.length ? Array.from({ length: _.choices.length }, (e, t) => `${t + 1}`) : []
|
|
31
|
+
}, $ = {
|
|
32
|
+
partLabels: E.partLabels.settings && l(E.partLabels.label),
|
|
33
|
+
partLabelType: t.partLabels && d("", ["Numbers", "Letters"]),
|
|
34
|
+
partialScoring: x.settings && l(x.label),
|
|
35
|
+
scoringType: C.settings && u(C.label, ["auto", "rubric"]),
|
|
36
|
+
"language.enabled": w.settings && l(w.label, !0),
|
|
37
|
+
language: w.settings && w.enabled && d(T.label, T.options)
|
|
38
|
+
}, te = {
|
|
39
|
+
"partA.choiceMode": O.settings && u(O.label, ["checkbox", "radio"]),
|
|
40
|
+
"partA.choicePrefix": k.settings && u(k.label, ["numbers", "letters"]),
|
|
41
|
+
"partA.lockChoiceOrder": A.settings && l(A.label),
|
|
42
|
+
"partA.choicesLayout": P.settings && d(P.label, [
|
|
41
43
|
"vertical",
|
|
42
44
|
"grid",
|
|
43
45
|
"horizontal"
|
|
44
46
|
]),
|
|
45
|
-
"partA.gridColumns":
|
|
46
|
-
},
|
|
47
|
-
"partA.feedbackEnabled":
|
|
48
|
-
"partA.promptEnabled":
|
|
49
|
-
"partA.teacherInstructionsEnabled":
|
|
50
|
-
"partA.studentInstructionsEnabled":
|
|
51
|
-
"partA.rationaleEnabled":
|
|
52
|
-
"partA.spellCheckEnabled":
|
|
53
|
-
},
|
|
54
|
-
"partB.choiceMode":
|
|
55
|
-
"partB.choicePrefix":
|
|
56
|
-
"partB.lockChoiceOrder":
|
|
57
|
-
"partB.choicesLayout":
|
|
47
|
+
"partA.gridColumns": P.settings && g.choicesLayout === "grid" && Q.partA.length > 0 && d(F.label, Q.partA)
|
|
48
|
+
}, ne = {
|
|
49
|
+
"partA.feedbackEnabled": D.settings && l(D.label),
|
|
50
|
+
"partA.promptEnabled": j.settings && l(j.label),
|
|
51
|
+
"partA.teacherInstructionsEnabled": M.settings && l(M.label),
|
|
52
|
+
"partA.studentInstructionsEnabled": N.settings && l(N.label),
|
|
53
|
+
"partA.rationaleEnabled": I.settings && l(I.label),
|
|
54
|
+
"partA.spellCheckEnabled": L.settings && l(L.label)
|
|
55
|
+
}, re = {
|
|
56
|
+
"partB.choiceMode": z.settings && u(z.label, ["checkbox", "radio"]),
|
|
57
|
+
"partB.choicePrefix": B.settings && u(B.label, ["numbers", "letters"]),
|
|
58
|
+
"partB.lockChoiceOrder": V.settings && l(V.label),
|
|
59
|
+
"partB.choicesLayout": G.settings && d(G.label, [
|
|
58
60
|
"vertical",
|
|
59
61
|
"grid",
|
|
60
62
|
"horizontal"
|
|
61
63
|
]),
|
|
62
|
-
"partB.gridColumns":
|
|
63
|
-
},
|
|
64
|
-
"partB.feedbackEnabled":
|
|
65
|
-
"partB.promptEnabled":
|
|
66
|
-
"partB.teacherInstructionsEnabled":
|
|
67
|
-
"partB.studentInstructionsEnabled":
|
|
68
|
-
"partB.rationaleEnabled":
|
|
69
|
-
"partB.spellCheckEnabled":
|
|
64
|
+
"partB.gridColumns": G.settings && _.choicesLayout === "grid" && Q.partB.length > 0 && d(K.label, Q.partB)
|
|
65
|
+
}, ie = {
|
|
66
|
+
"partB.feedbackEnabled": R.settings && l(R.label),
|
|
67
|
+
"partB.promptEnabled": H.settings && l(H.label),
|
|
68
|
+
"partB.teacherInstructionsEnabled": U.settings && l(U.label),
|
|
69
|
+
"partB.studentInstructionsEnabled": W.settings && l(W.label),
|
|
70
|
+
"partB.rationaleEnabled": q.settings && l(q.label),
|
|
71
|
+
"partB.spellCheckEnabled": J.settings && l(J.label)
|
|
70
72
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
extraCSSRules:
|
|
73
|
-
dimensions:
|
|
74
|
-
hideSettings:
|
|
75
|
-
settings: /* @__PURE__ */
|
|
76
|
-
model:
|
|
73
|
+
return /* @__PURE__ */ s(r.ConfigLayout, {
|
|
74
|
+
extraCSSRules: v,
|
|
75
|
+
dimensions: ee,
|
|
76
|
+
hideSettings: S,
|
|
77
|
+
settings: /* @__PURE__ */ o(c, {
|
|
78
|
+
model: t,
|
|
77
79
|
onChangeModel: this.onModelChanged,
|
|
78
|
-
configuration:
|
|
79
|
-
onChangeConfiguration:
|
|
80
|
+
configuration: n,
|
|
81
|
+
onChangeConfiguration: a,
|
|
80
82
|
groups: {
|
|
81
|
-
"Settings for both":
|
|
82
|
-
[`Settings ${
|
|
83
|
-
[`Properties ${
|
|
84
|
-
[`Settings ${
|
|
85
|
-
[`Properties ${
|
|
83
|
+
"Settings for both": $,
|
|
84
|
+
[`Settings ${X}`]: te,
|
|
85
|
+
[`Properties ${X}`]: ne,
|
|
86
|
+
[`Settings ${Z}`]: re,
|
|
87
|
+
[`Properties ${Z}`]: ie
|
|
86
88
|
}
|
|
87
89
|
}),
|
|
88
90
|
children: [
|
|
89
|
-
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
+
t.partLabels && /* @__PURE__ */ o(f, { children: X }),
|
|
92
|
+
/* @__PURE__ */ o(m, {
|
|
91
93
|
id: "A",
|
|
92
94
|
ref: (e) => {
|
|
93
95
|
e && (this.partA = e, this.partA._model = {
|
|
94
96
|
...this.props.model.partA,
|
|
95
97
|
errors: this.props.model.errors && this.props.model.errors.partA || {}
|
|
96
98
|
}, this.partA.configuration = {
|
|
97
|
-
...
|
|
98
|
-
...
|
|
99
|
+
...y,
|
|
100
|
+
...E
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
}, "partA"),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ o(p, {}),
|
|
105
|
+
t.partLabels && /* @__PURE__ */ o(f, { children: Z }),
|
|
106
|
+
/* @__PURE__ */ o(m, {
|
|
105
107
|
id: "B",
|
|
106
108
|
ref: (e) => {
|
|
107
109
|
e && (this.partB = e, this.partB._model = {
|
|
108
110
|
...this.props.model.partB,
|
|
109
111
|
errors: this.props.model.errors && this.props.model.errors.partB || {}
|
|
110
112
|
}, this.partB.configuration = {
|
|
111
|
-
...
|
|
112
|
-
...
|
|
113
|
+
...b,
|
|
114
|
+
...E
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
117
|
}, "partB")
|
|
@@ -118,4 +120,4 @@ var { Panel: s, toggle: c, radio: l, dropdown: u } = r, d = i("div")(({ theme: e
|
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
122
|
//#endregion
|
|
121
|
-
export {
|
|
123
|
+
export { m as default };
|