@pie-element/inline-dropdown 11.0.4-next.20261011174919 → 11.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 -55
- package/dist/author/index.d.ts +18 -29
- package/dist/author/index.js +6 -1
- package/dist/author/inline-dropdown-toolbar.d.ts +3 -0
- package/dist/author/inline-dropdown-toolbar.js +4 -1
- package/dist/author/main.d.ts +58 -34
- package/dist/author/main.js +86 -102
- package/dist/browser/author/index.js +65 -75
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +5 -3
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +65 -75
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +5 -3
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +9 -9
- package/dist/controller/index.d.ts +66 -17
- package/dist/controller/index.js +5 -3
- package/dist/controller/utils.d.ts +2 -4
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +414 -0
- package/dist/schemas/model.schema.json +453 -0
- package/dist/schemas/session.schema.json +43 -0
- package/dist/types.d.ts +164 -0
- package/package.json +20 -16
|
@@ -35730,15 +35730,12 @@ var tG = class extends bt.Component {
|
|
|
35730
35730
|
}), aG = (e) => typeof e == "string" ? {
|
|
35731
35731
|
label: e,
|
|
35732
35732
|
value: e
|
|
35733
|
-
} : e, oG =
|
|
35734
|
-
|
|
35735
|
-
|
|
35736
|
-
|
|
35737
|
-
|
|
35738
|
-
|
|
35739
|
-
isConfigProperty: n
|
|
35740
|
-
};
|
|
35741
|
-
}, sG = (e, t, n = !1) => ({
|
|
35733
|
+
} : e, oG = (e, t, n = !1) => ({
|
|
35734
|
+
type: "radio",
|
|
35735
|
+
label: e,
|
|
35736
|
+
choices: t && t.map((e) => aG(e)),
|
|
35737
|
+
isConfigProperty: n
|
|
35738
|
+
}), sG = (e, t, n = !1) => ({
|
|
35742
35739
|
type: "dropdown",
|
|
35743
35740
|
label: e,
|
|
35744
35741
|
choices: t,
|
|
@@ -35893,7 +35890,10 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
35893
35890
|
onSelectChoice: U.default.func.isRequired,
|
|
35894
35891
|
onToolbarDone: U.default.func.isRequired,
|
|
35895
35892
|
editor: U.default.object,
|
|
35896
|
-
spellCheck: U.default.bool
|
|
35893
|
+
spellCheck: U.default.bool,
|
|
35894
|
+
mathMlOptions: U.default.object,
|
|
35895
|
+
baseInputConfiguration: U.default.object,
|
|
35896
|
+
responseAreaInputConfiguration: U.default.object
|
|
35897
35897
|
};
|
|
35898
35898
|
clickedInside = !1;
|
|
35899
35899
|
preventDone = !1;
|
|
@@ -36087,21 +36087,6 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36087
36087
|
let t = document.createElement("div");
|
|
36088
36088
|
return t.innerHTML = (e || "").trim(), t;
|
|
36089
36089
|
}, ZG = class extends bt.Component {
|
|
36090
|
-
static propTypes = {
|
|
36091
|
-
configuration: U.default.object.isRequired,
|
|
36092
|
-
model: U.default.object.isRequired,
|
|
36093
|
-
disableSidePanel: U.default.bool,
|
|
36094
|
-
onModelChanged: U.default.func.isRequired,
|
|
36095
|
-
onConfigurationChanged: U.default.func.isRequired,
|
|
36096
|
-
imageSupport: U.default.shape({
|
|
36097
|
-
add: U.default.func.isRequired,
|
|
36098
|
-
delete: U.default.func.isRequired
|
|
36099
|
-
}),
|
|
36100
|
-
uploadSoundSupport: U.default.shape({
|
|
36101
|
-
add: U.default.func.isRequired,
|
|
36102
|
-
delete: U.default.func.isRequired
|
|
36103
|
-
})
|
|
36104
|
-
};
|
|
36105
36090
|
state = { warning: { open: !1 } };
|
|
36106
36091
|
componentDidMount() {
|
|
36107
36092
|
let { model: { choices: e } } = this.props;
|
|
@@ -36149,7 +36134,7 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36149
36134
|
} });
|
|
36150
36135
|
};
|
|
36151
36136
|
validateResponseAreaClose = (e, t, n, r, i) => {
|
|
36152
|
-
let
|
|
36137
|
+
let a = this.state.respAreaChoices, o = e.attrs.index, s = a[o] || [];
|
|
36153
36138
|
if (!(s.length < 2 || !s.find((e) => e.correct))) {
|
|
36154
36139
|
r();
|
|
36155
36140
|
return;
|
|
@@ -36159,21 +36144,21 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36159
36144
|
}, i);
|
|
36160
36145
|
};
|
|
36161
36146
|
onChange = (e) => {
|
|
36162
|
-
let
|
|
36147
|
+
let t = this.state.respAreaChoices, n = XG(e), r = n.querySelectorAll("[data-type=\"inline_dropdown\"]"), i = {};
|
|
36163
36148
|
r.forEach((e) => {
|
|
36164
36149
|
i[e.dataset.index] = e.dataset.value || "";
|
|
36165
36150
|
});
|
|
36166
36151
|
let a = ut(t, (e, n, r) => (_t(i[r]) || (e[r] = t[r]), e), {}), o = {};
|
|
36167
36152
|
r.forEach((e, t) => {
|
|
36168
36153
|
let n = a[e.dataset.index];
|
|
36169
|
-
n && (o[t] = n), e.dataset.index = t
|
|
36154
|
+
n && (o[t] = n), e.dataset.index = `${t}`;
|
|
36170
36155
|
}), this.onModelChange({
|
|
36171
36156
|
choices: ct(o),
|
|
36172
36157
|
slateMarkup: n.innerHTML
|
|
36173
36158
|
});
|
|
36174
36159
|
};
|
|
36175
36160
|
onAddChoice = (e, t, n) => {
|
|
36176
|
-
let
|
|
36161
|
+
let r = this.state.respAreaChoices, { maxResponseAreaChoices: i } = this.props.configuration, a = (e) => this.setState({ warning: {
|
|
36177
36162
|
open: !0,
|
|
36178
36163
|
text: e,
|
|
36179
36164
|
onClose: void 0,
|
|
@@ -36201,18 +36186,18 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36201
36186
|
this.onModelChange({ choices: ct(r) });
|
|
36202
36187
|
};
|
|
36203
36188
|
onRemoveChoice = (e, t) => {
|
|
36204
|
-
let
|
|
36189
|
+
let n = this.state.respAreaChoices;
|
|
36205
36190
|
n[e].splice(t, 1), this.onModelChange({ choices: ct(n) });
|
|
36206
36191
|
};
|
|
36207
36192
|
onSelectChoice = (e, t) => {
|
|
36208
|
-
let
|
|
36193
|
+
let n = this.state.respAreaChoices;
|
|
36209
36194
|
n[e] = n[e].map((e, n) => ({
|
|
36210
36195
|
...e,
|
|
36211
36196
|
correct: n === t
|
|
36212
36197
|
})), this.onModelChange({ choices: ct(n) });
|
|
36213
36198
|
};
|
|
36214
36199
|
render() {
|
|
36215
|
-
let { warning: e } = this.state, { model: t, configuration: n, onConfigurationChanged: r, imageSupport: i, uploadSoundSupport: a } = this.props, { baseInputConfiguration: o = {}, choiceRationale: s = {}, contentDimensions: c = {}, lockChoiceOrder: l = {}, maxResponseAreas: u, maxImageWidth: d = {}, maxImageHeight: f = {}, partialScoring: p = {}, prompt: m = {}, rationale: h = {}, settingsPanelDisabled: g, spellCheck: _ = {}, teacherInstructions: v = {}, template: y = {}, withRubric: b = {}, mathMlOptions: x = {}, language: S = {}, languageChoices: C = {}, responseAreaInputConfiguration: w = {} } = n || {}, { choiceRationaleEnabled: T, choices: E, errors: D,
|
|
36200
|
+
let { warning: e } = this.state, { model: t, configuration: n, onConfigurationChanged: r, imageSupport: i, uploadSoundSupport: a } = this.props, { baseInputConfiguration: o = {}, choiceRationale: s = {}, contentDimensions: c = {}, lockChoiceOrder: l = {}, maxResponseAreas: u, maxImageWidth: d = {}, maxImageHeight: f = {}, partialScoring: p = {}, prompt: m = {}, rationale: h = {}, settingsPanelDisabled: g, spellCheck: _ = {}, teacherInstructions: v = {}, template: y = {}, withRubric: b = {}, mathMlOptions: x = {}, language: S = {}, languageChoices: C = {}, responseAreaInputConfiguration: w = {} } = n || {}, { choiceRationaleEnabled: T, choices: E, errors: D, promptEnabled: ee, rationaleEnabled: te, spellCheckEnabled: O, teacherInstructionsEnabled: k, toolbarEditorPosition: ne } = t || {}, { prompt: re, rationale: ie, responseAreasError: ae, responseAreaChoicesError: oe, teacherInstructions: se } = D || {}, ce = d && d.prompt, le = f && f.prompt, ue = () => (Object.keys(E) || []).map((e, t) => /* @__PURE__ */ P(GG, { children: /* @__PURE__ */ F(PV, {
|
|
36216
36201
|
slotProps: { transition: { timeout: {
|
|
36217
36202
|
enter: 225,
|
|
36218
36203
|
exit: 195
|
|
@@ -36225,31 +36210,31 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36225
36210
|
})
|
|
36226
36211
|
}), /* @__PURE__ */ P(KG, { children: (E[e] || []).map((t) => /* @__PURE__ */ F(bt.Fragment, { children: [/* @__PURE__ */ P(WG, { dangerouslySetInnerHTML: { __html: `${h.label} for ${t.label} (${t.correct ? "correct" : "incorrect"})` } }), /* @__PURE__ */ P(HG, { children: /* @__PURE__ */ P(xV, {
|
|
36227
36212
|
markup: t.rationale || "",
|
|
36228
|
-
spellCheck:
|
|
36229
|
-
pluginProps:
|
|
36213
|
+
spellCheck: O,
|
|
36214
|
+
pluginProps: he(h?.inputConfiguration),
|
|
36230
36215
|
onChange: (n) => this.onChoiceRationaleChanged(e, {
|
|
36231
36216
|
...t,
|
|
36232
36217
|
rationale: n
|
|
36233
36218
|
}),
|
|
36234
36219
|
imageSupport: i,
|
|
36235
|
-
maxImageWidth: d && d.rationale ||
|
|
36236
|
-
maxImageHeight: f && f.rationale ||
|
|
36220
|
+
maxImageWidth: d && d.rationale || ce,
|
|
36221
|
+
maxImageHeight: f && f.rationale || le,
|
|
36237
36222
|
uploadSoundSupport: a,
|
|
36238
36223
|
mathMlOptions: x
|
|
36239
36224
|
}) })] }, t.label)) })]
|
|
36240
|
-
}) }, e)),
|
|
36225
|
+
}) }, e)), de = { position: ne === "top" ? "top" : "bottom" }, fe = yG(n), pe = {
|
|
36241
36226
|
partialScoring: p.settings && RG(p.label),
|
|
36242
36227
|
lockChoiceOrder: l.settings && RG(l.label),
|
|
36243
36228
|
"language.enabled": S.settings && RG(S.label, !0),
|
|
36244
36229
|
language: S.settings && S.enabled && BG(C.label, C.options)
|
|
36245
|
-
},
|
|
36230
|
+
}, me = {
|
|
36246
36231
|
teacherInstructionsEnabled: v.settings && RG(v.label),
|
|
36247
36232
|
rationaleEnabled: h.settings && RG(h.label),
|
|
36248
36233
|
choiceRationaleEnabled: s.settings && RG(s.label),
|
|
36249
36234
|
promptEnabled: m.settings && RG(m.label),
|
|
36250
36235
|
spellCheckEnabled: _.settings && RG(_.label),
|
|
36251
36236
|
rubricEnabled: b?.settings && RG(b?.label)
|
|
36252
|
-
},
|
|
36237
|
+
}, he = (e = {}) => ({
|
|
36253
36238
|
...o,
|
|
36254
36239
|
...e
|
|
36255
36240
|
});
|
|
@@ -36266,30 +36251,30 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36266
36251
|
onChangeModel: (e) => this.onModelChange(e),
|
|
36267
36252
|
onChangeConfiguration: (e) => r(e, !0),
|
|
36268
36253
|
groups: {
|
|
36269
|
-
Settings:
|
|
36270
|
-
Properties:
|
|
36254
|
+
Settings: pe,
|
|
36255
|
+
Properties: me
|
|
36271
36256
|
}
|
|
36272
36257
|
}),
|
|
36273
36258
|
children: [
|
|
36274
|
-
|
|
36259
|
+
k && /* @__PURE__ */ F(VG, {
|
|
36275
36260
|
label: v.label,
|
|
36276
36261
|
children: [/* @__PURE__ */ P(xV, {
|
|
36277
36262
|
markup: t.teacherInstructions || "",
|
|
36278
36263
|
onChange: this.onTeacherInstructionsChanged,
|
|
36279
36264
|
imageSupport: i,
|
|
36280
36265
|
nonEmpty: !1,
|
|
36281
|
-
error:
|
|
36282
|
-
toolbarOpts:
|
|
36283
|
-
pluginProps:
|
|
36284
|
-
spellCheck:
|
|
36285
|
-
maxImageWidth: d && d.teacherInstructions ||
|
|
36286
|
-
maxImageHeight: f && f.teacherInstructions ||
|
|
36266
|
+
error: se,
|
|
36267
|
+
toolbarOpts: de,
|
|
36268
|
+
pluginProps: he(v?.inputConfiguration),
|
|
36269
|
+
spellCheck: O,
|
|
36270
|
+
maxImageWidth: d && d.teacherInstructions || ce,
|
|
36271
|
+
maxImageHeight: f && f.teacherInstructions || le,
|
|
36287
36272
|
uploadSoundSupport: a,
|
|
36288
36273
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
36289
36274
|
mathMlOptions: x
|
|
36290
|
-
}),
|
|
36275
|
+
}), se && /* @__PURE__ */ P(YG, { children: se })]
|
|
36291
36276
|
}),
|
|
36292
|
-
|
|
36277
|
+
ee && /* @__PURE__ */ F(VG, {
|
|
36293
36278
|
label: m.label,
|
|
36294
36279
|
children: [/* @__PURE__ */ P(xV, {
|
|
36295
36280
|
markup: t.prompt,
|
|
@@ -36297,16 +36282,16 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36297
36282
|
imageSupport: i,
|
|
36298
36283
|
nonEmpty: !1,
|
|
36299
36284
|
disableUnderline: !0,
|
|
36300
|
-
error:
|
|
36301
|
-
toolbarOpts:
|
|
36302
|
-
pluginProps:
|
|
36303
|
-
spellCheck:
|
|
36304
|
-
maxImageWidth:
|
|
36305
|
-
maxImageHeight:
|
|
36285
|
+
error: re,
|
|
36286
|
+
toolbarOpts: de,
|
|
36287
|
+
pluginProps: he(m?.inputConfiguration),
|
|
36288
|
+
spellCheck: O,
|
|
36289
|
+
maxImageWidth: ce,
|
|
36290
|
+
maxImageHeight: le,
|
|
36306
36291
|
uploadSoundSupport: a,
|
|
36307
36292
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
36308
36293
|
mathMlOptions: x
|
|
36309
|
-
}),
|
|
36294
|
+
}), re && /* @__PURE__ */ P(YG, { children: re })]
|
|
36310
36295
|
}),
|
|
36311
36296
|
/* @__PURE__ */ F(qG, { children: [/* @__PURE__ */ P(UG, {
|
|
36312
36297
|
component: "div",
|
|
@@ -36315,17 +36300,17 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36315
36300
|
disableFocusListener: !0,
|
|
36316
36301
|
disableTouchListener: !0,
|
|
36317
36302
|
placement: "right",
|
|
36318
|
-
title:
|
|
36303
|
+
title: fe,
|
|
36319
36304
|
children: /* @__PURE__ */ P(vG, {
|
|
36320
36305
|
fontSize: "small",
|
|
36321
36306
|
color: "primary"
|
|
36322
36307
|
})
|
|
36323
36308
|
})] }),
|
|
36324
36309
|
/* @__PURE__ */ P(LG, {
|
|
36325
|
-
responseAreasError:
|
|
36326
|
-
responseAreaChoicesError:
|
|
36310
|
+
responseAreasError: ae,
|
|
36311
|
+
responseAreaChoicesError: oe,
|
|
36327
36312
|
editableHtmlProps: {
|
|
36328
|
-
pluginProps:
|
|
36313
|
+
pluginProps: he(y?.inputConfiguration),
|
|
36329
36314
|
activePlugins: _r,
|
|
36330
36315
|
toolbarOpts: { position: "top" },
|
|
36331
36316
|
extraCSSRules: {
|
|
@@ -36340,7 +36325,7 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36340
36325
|
this.validateResponseAreaClose(e, t, n, r, i);
|
|
36341
36326
|
},
|
|
36342
36327
|
respAreaToolbar: (e, t, n) => {
|
|
36343
|
-
let [r, i] = e,
|
|
36328
|
+
let [r, i] = e, s = this.state.respAreaChoices;
|
|
36344
36329
|
return (e) => /* @__PURE__ */ P(PG, {
|
|
36345
36330
|
...e,
|
|
36346
36331
|
onAddChoice: this.onAddChoice,
|
|
@@ -36351,7 +36336,7 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36351
36336
|
editor: t,
|
|
36352
36337
|
onToolbarDone: n,
|
|
36353
36338
|
choices: s[r.attrs.index],
|
|
36354
|
-
spellCheck:
|
|
36339
|
+
spellCheck: O,
|
|
36355
36340
|
uploadSoundSupport: a,
|
|
36356
36341
|
mathMlOptions: x,
|
|
36357
36342
|
baseInputConfiguration: o,
|
|
@@ -36359,36 +36344,36 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36359
36344
|
});
|
|
36360
36345
|
}
|
|
36361
36346
|
},
|
|
36362
|
-
spellCheck:
|
|
36347
|
+
spellCheck: O,
|
|
36363
36348
|
markup: t.slateMarkup || "",
|
|
36364
36349
|
onChange: this.onChange,
|
|
36365
36350
|
imageSupport: i,
|
|
36366
36351
|
disableImageAlignmentButtons: !0,
|
|
36367
36352
|
disabled: !1,
|
|
36368
36353
|
highlightShape: !1,
|
|
36369
|
-
error:
|
|
36354
|
+
error: ae,
|
|
36370
36355
|
uploadSoundSupport: a,
|
|
36371
36356
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
36372
36357
|
mathMlOptions: x
|
|
36373
36358
|
}
|
|
36374
36359
|
}),
|
|
36375
|
-
T &&
|
|
36376
|
-
|
|
36360
|
+
T && ue(),
|
|
36361
|
+
te && /* @__PURE__ */ F(VG, {
|
|
36377
36362
|
label: h.label,
|
|
36378
36363
|
children: [/* @__PURE__ */ P(xV, {
|
|
36379
36364
|
markup: t.rationale || "",
|
|
36380
36365
|
onChange: this.onRationaleChanged,
|
|
36381
36366
|
imageSupport: i,
|
|
36382
|
-
error:
|
|
36383
|
-
toolbarOpts:
|
|
36384
|
-
pluginProps:
|
|
36385
|
-
spellCheck:
|
|
36386
|
-
maxImageWidth: d && d.rationale ||
|
|
36387
|
-
maxImageHeight: f && f.rationale ||
|
|
36367
|
+
error: ie,
|
|
36368
|
+
toolbarOpts: de,
|
|
36369
|
+
pluginProps: he(h?.inputConfiguration),
|
|
36370
|
+
spellCheck: O,
|
|
36371
|
+
maxImageWidth: d && d.rationale || ce,
|
|
36372
|
+
maxImageHeight: f && f.rationale || le,
|
|
36388
36373
|
uploadSoundSupport: a,
|
|
36389
36374
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
36390
36375
|
mathMlOptions: x
|
|
36391
|
-
}),
|
|
36376
|
+
}), ie && /* @__PURE__ */ P(YG, { children: ie })]
|
|
36392
36377
|
}),
|
|
36393
36378
|
/* @__PURE__ */ P(aU, {
|
|
36394
36379
|
open: e.open,
|
|
@@ -36548,6 +36533,10 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36548
36533
|
};
|
|
36549
36534
|
return n.replace(aK, (e, t) => r(t));
|
|
36550
36535
|
}, sK = (0, Yt.default)("multiple-choice:configure"), cK = class e extends HTMLElement {
|
|
36536
|
+
_root;
|
|
36537
|
+
_model;
|
|
36538
|
+
_configuration;
|
|
36539
|
+
_disableSidePanel;
|
|
36551
36540
|
static prepareModel = (e = {}) => {
|
|
36552
36541
|
let t = {
|
|
36553
36542
|
...QG.model,
|
|
@@ -36566,7 +36555,8 @@ var mG = ve, hG = mG.default, gG = hG && typeof hG == "object" ? hG : mG, _G = p
|
|
|
36566
36555
|
this._model = e.prepareModel(t), this._render();
|
|
36567
36556
|
}
|
|
36568
36557
|
set configuration(e) {
|
|
36569
|
-
|
|
36558
|
+
let t = st(e, QG.configuration);
|
|
36559
|
+
this._configuration = t, e.language?.enabled ? e.languageChoices?.options?.length && (this._model.language = e.languageChoices.options[0].value) : e.language.settings && this._model.language ? (t.language.enabled = !0, (!t.languageChoices.options || !t.languageChoices.options.length) && (t.languageChoices.options = []), t.languageChoices.options.find((e) => e.value === this._model.language) || t.languageChoices.options.push({
|
|
36570
36560
|
value: this._model.language,
|
|
36571
36561
|
label: this._model.language
|
|
36572
36562
|
})) : delete this._model.language, this._render();
|