@pie-element/math-templated 8.0.4-next.20261011174919 → 8.0.4
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/defaults.d.ts +56 -54
- package/dist/author/design.d.ts +41 -22
- package/dist/author/design.js +93 -106
- package/dist/author/index.d.ts +18 -28
- package/dist/author/index.js +15 -5
- package/dist/author/utils.d.ts +2 -1
- package/dist/browser/author/index.js +24 -29
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +15 -12
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +24 -29
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +15 -12
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +12 -11
- package/dist/controller/index.d.ts +72 -21
- package/dist/controller/index.js +15 -12
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +382 -0
- package/dist/schemas/model.schema.json +474 -0
- package/dist/schemas/session.schema.json +36 -0
- package/dist/types.d.ts +177 -0
- package/package.json +22 -18
|
@@ -13101,15 +13101,12 @@ var Fg = class extends K.Component {
|
|
|
13101
13101
|
}), zg = (e) => typeof e == "string" ? {
|
|
13102
13102
|
label: e,
|
|
13103
13103
|
value: e
|
|
13104
|
-
} : e, Bg =
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
isConfigProperty: n
|
|
13111
|
-
};
|
|
13112
|
-
}, Vg = (e, t, n = !1) => ({
|
|
13104
|
+
} : e, Bg = (e, t, n = !1) => ({
|
|
13105
|
+
type: "radio",
|
|
13106
|
+
label: e,
|
|
13107
|
+
choices: t && t.map((e) => zg(e)),
|
|
13108
|
+
isConfigProperty: n
|
|
13109
|
+
}), Vg = (e, t, n = !1) => ({
|
|
13113
13110
|
type: "dropdown",
|
|
13114
13111
|
label: e,
|
|
13115
13112
|
choices: t,
|
|
@@ -13410,17 +13407,6 @@ var d_ = class extends G.Component {
|
|
|
13410
13407
|
let t = document.createElement("div");
|
|
13411
13408
|
return t.innerHTML = e.trim(), t;
|
|
13412
13409
|
}, F_ = class extends K.Component {
|
|
13413
|
-
static propTypes = {
|
|
13414
|
-
model: Q.default.object.isRequired,
|
|
13415
|
-
configuration: Q.default.object.isRequired,
|
|
13416
|
-
onModelChanged: Q.default.func.isRequired,
|
|
13417
|
-
onConfigurationChanged: Q.default.func.isRequired,
|
|
13418
|
-
imageSupport: Q.default.shape({
|
|
13419
|
-
add: Q.default.func.isRequired,
|
|
13420
|
-
delete: Q.default.func.isRequired
|
|
13421
|
-
}),
|
|
13422
|
-
uploadSoundSupport: Q.default.object
|
|
13423
|
-
};
|
|
13424
13410
|
state = {};
|
|
13425
13411
|
componentDidMount() {
|
|
13426
13412
|
let { model: { slateMarkup: e } } = this.props;
|
|
@@ -13442,7 +13428,7 @@ var d_ = class extends G.Component {
|
|
|
13442
13428
|
});
|
|
13443
13429
|
};
|
|
13444
13430
|
onChangeResponse = (e, t) => {
|
|
13445
|
-
let { model: n, onModelChanged: r } = this.props,
|
|
13431
|
+
let { model: n, onModelChanged: r } = this.props, i = n.responses;
|
|
13446
13432
|
i[e] ? i[e][0].answer = t || "" : i[e] = [{
|
|
13447
13433
|
answer: t || "",
|
|
13448
13434
|
id: "response" + e,
|
|
@@ -13504,10 +13490,10 @@ var d_ = class extends G.Component {
|
|
|
13504
13490
|
function i(e, t = 0) {
|
|
13505
13491
|
if (!e || t >= 4) return null;
|
|
13506
13492
|
let n = e?.children?.[0];
|
|
13507
|
-
return n ? n.attributes && n.attributes
|
|
13493
|
+
return n ? n.attributes && n.attributes.getNamedItem("data-keypad") ? n : i(n, t + 1) : null;
|
|
13508
13494
|
}
|
|
13509
13495
|
let a = r(t), o = a ? i(a) : null;
|
|
13510
|
-
(!t || !n || !o?.attributes
|
|
13496
|
+
(!t || !n || !o?.attributes.getNamedItem("data-keypad")) && this.setState({ activeAnswerBlock: "" });
|
|
13511
13497
|
};
|
|
13512
13498
|
render() {
|
|
13513
13499
|
let { configuration: e, imageSupport: t, model: n, onConfigurationChanged: r, onModelChanged: i, uploadSoundSupport: a } = this.props, { baseInputConfiguration: o = {}, contentDimensions: s = {}, prompt: c = {}, rationale: l = {}, settingsPanelDisabled: u, teacherInstructions: d = {}, language: f = {}, languageChoices: p = {}, spellCheck: m = {}, playerSpellCheck: h = {}, maxImageWidth: g = {}, maxImageHeight: _ = {}, mathMlOptions: v = {}, template: y = {}, editSource: b = {}, ignoreOrder: x = {}, allowTrailingZeros: S = {}, partialScoring: C = {}, maxResponseAreas: w } = e || {}, { errors: T, extraCSSRules: ee, promptEnabled: E, rationaleEnabled: D, spellCheckEnabled: O, teacherInstructionsEnabled: k, toolbarEditorPosition: te, responses: A, equationEditor: j } = n || {}, { prompt: M, rationale: N, responseAreas: ne, teacherInstructions: re, responses: ie = {} } = T || {}, ae = b_(e), P = {
|
|
@@ -13685,7 +13671,6 @@ var d_ = class extends G.Component {
|
|
|
13685
13671
|
response: n,
|
|
13686
13672
|
onResponseChange: this.onResponseChange,
|
|
13687
13673
|
onResponseDone: this.onResponseDone,
|
|
13688
|
-
index: t,
|
|
13689
13674
|
cIgnoreOrder: x,
|
|
13690
13675
|
cAllowTrailingZeros: S,
|
|
13691
13676
|
error: ie && ie[t]
|
|
@@ -13835,6 +13820,10 @@ var d_ = class extends G.Component {
|
|
|
13835
13820
|
maxResponseAreas: 10
|
|
13836
13821
|
}
|
|
13837
13822
|
}, L_ = (0, an.default)("math-templated:configure"), R_ = class e extends HTMLElement {
|
|
13823
|
+
_root;
|
|
13824
|
+
_model;
|
|
13825
|
+
_configuration;
|
|
13826
|
+
_disableSidePanel;
|
|
13838
13827
|
static prepareModel = (e = {}) => {
|
|
13839
13828
|
let { validationDefault: t, allowTrailingZerosDefault: n, ignoreOrderDefault: r, responses: i = {} } = e, a = Object.keys(i).reduce((e, a) => {
|
|
13840
13829
|
let o = i[a];
|
|
@@ -13850,7 +13839,8 @@ var d_ = class extends G.Component {
|
|
|
13850
13839
|
responses: a
|
|
13851
13840
|
}, s = o.slateMarkup || y_(o.markup, o.responses), c = __(s);
|
|
13852
13841
|
return o.responses && Object.keys(o.responses).forEach((e) => {
|
|
13853
|
-
|
|
13842
|
+
let t = o.responses[e];
|
|
13843
|
+
Ye(t) && (o.responses[e] = (t || []).map((e, t) => e.answer ? e : (L_("Choice does not contain \"answer\" property, which is required.", e), {
|
|
13854
13844
|
answer: `${t}`,
|
|
13855
13845
|
...e
|
|
13856
13846
|
})));
|
|
@@ -13867,10 +13857,15 @@ var d_ = class extends G.Component {
|
|
|
13867
13857
|
this._model = e.prepareModel(t), this._render();
|
|
13868
13858
|
}
|
|
13869
13859
|
set configuration(e) {
|
|
13870
|
-
this._configuration = Ue(e, I_.configuration), e.language?.enabled
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13860
|
+
if (this._configuration = Ue(e, I_.configuration), e.language?.enabled) e.languageChoices?.options?.length && (this._model.language = e.languageChoices.options[0].value);
|
|
13861
|
+
else if (e.language.settings && this._model.language) {
|
|
13862
|
+
let e = this._configuration.language, t = this._configuration.languageChoices, n = this._model.language;
|
|
13863
|
+
e.enabled = !0, (!t.options || !t.options.length) && (t.options = []), t.options.find((e) => e.value === n) || t.options.push({
|
|
13864
|
+
value: n,
|
|
13865
|
+
label: n
|
|
13866
|
+
});
|
|
13867
|
+
} else delete this._model.language;
|
|
13868
|
+
this._render();
|
|
13874
13869
|
}
|
|
13875
13870
|
set disableSidePanel(e) {
|
|
13876
13871
|
this._disableSidePanel = e, this._render();
|