@pie-element/explicit-constructed-response 11.4.0-beta.7 → 12.0.0-next.20261002094057
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/author.js +2 -0
- package/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/_virtual/_rolldown/runtime.js +4 -0
- package/dist/author/alternateResponses.d.ts +34 -0
- package/dist/author/alternateResponses.js +113 -0
- package/dist/author/alternateSection.d.ts +58 -0
- package/dist/author/alternateSection.js +214 -0
- package/dist/author/defaults.d.ts +186 -0
- package/dist/author/defaults.js +128 -0
- package/dist/author/ecr-toolbar.d.ts +41 -0
- package/dist/author/ecr-toolbar.js +100 -0
- package/dist/author/index.d.ts +43 -0
- package/dist/author/index.js +99 -0
- package/dist/author/main.d.ts +38 -0
- package/dist/author/main.js +291 -0
- package/dist/author/markupUtils.d.ts +14 -0
- package/dist/author/markupUtils.js +13 -0
- package/dist/author/utils.d.ts +9 -0
- package/dist/author/utils.js +7 -0
- package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/author/index.js +3381 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/browser-xPiwYICU.js +364 -0
- package/dist/browser/browser-xPiwYICU.js.map +1 -0
- package/dist/browser/controller/index.js +4152 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +156 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-DCmVXYeO.js +1528 -0
- package/dist/browser/dist-DCmVXYeO.js.map +1 -0
- package/dist/browser/dist-HcoWRT6l.js +41187 -0
- package/dist/browser/dist-HcoWRT6l.js.map +1 -0
- package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/editor-runtime/author/index.js +3381 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -0
- package/dist/browser/editor-runtime/browser-Dj-HJ-qm.js +364 -0
- package/dist/browser/editor-runtime/browser-Dj-HJ-qm.js.map +1 -0
- package/dist/browser/editor-runtime/controller/index.js +4152 -0
- package/dist/browser/editor-runtime/controller/index.js.map +1 -0
- package/dist/browser/editor-runtime/delivery/index.js +156 -0
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
- package/dist/browser/editor-runtime/dist-DCmVXYeO.js +1528 -0
- package/dist/browser/editor-runtime/dist-DCmVXYeO.js.map +1 -0
- package/dist/browser/editor-runtime/dist-dG5D5e9t.js +24778 -0
- package/dist/browser/editor-runtime/dist-dG5D5e9t.js.map +1 -0
- package/dist/browser/editor-runtime/main-CfUFuZ3G.js +954 -0
- package/dist/browser/editor-runtime/main-CfUFuZ3G.js.map +1 -0
- package/dist/browser/editor-runtime/print/index.js +42 -0
- package/dist/browser/editor-runtime/print/index.js.map +1 -0
- package/dist/browser/main-Dc-VXHKW.js +954 -0
- package/dist/browser/main-Dc-VXHKW.js.map +1 -0
- package/dist/browser/print/index.js +42 -0
- package/dist/browser/print/index.js.map +1 -0
- package/dist/controller/defaults.d.ts +25 -0
- package/dist/controller/defaults.js +19 -0
- package/dist/controller/index.d.ts +64 -0
- package/dist/controller/index.js +139 -0
- package/dist/delivery/index.d.ts +20 -0
- package/dist/delivery/index.js +76 -0
- package/dist/delivery/main.d.ts +46 -0
- package/dist/delivery/main.js +113 -0
- package/dist/explicit-constructed-response.css +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +357 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/he@1.2.0/node_modules/he/he.js +3993 -0
- package/dist/print/index.d.ts +15 -0
- package/dist/print/index.js +42 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/module/assets/Symbola-4c507403.woff2 +0 -0
- package/module/print.js +49847 -0
- package/module/print.js.map +1 -0
- package/package.json +109 -25
- package/print.js +2 -0
- package/CHANGELOG.json +0 -1102
- package/CHANGELOG.md +0 -2237
- package/LICENSE.md +0 -5
- package/README.md +0 -1
- package/configure/CHANGELOG.json +0 -652
- package/configure/CHANGELOG.md +0 -1978
- package/configure/lib/__tests__/alternateResponses.test.js +0 -503
- package/configure/lib/__tests__/alternateSection.test.js +0 -372
- package/configure/lib/__tests__/ecr-toolbar.test.js +0 -214
- package/configure/lib/__tests__/main.test.js +0 -470
- package/configure/lib/__tests__/markupUtils.test.js +0 -55
- package/configure/lib/__tests__/utils.test.js +0 -62
- package/configure/lib/alternateResponses.js +0 -199
- package/configure/lib/alternateResponses.js.map +0 -1
- package/configure/lib/alternateSection.js +0 -329
- package/configure/lib/alternateSection.js.map +0 -1
- package/configure/lib/defaults.js +0 -184
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/ecr-toolbar.js +0 -181
- package/configure/lib/ecr-toolbar.js.map +0 -1
- package/configure/lib/index.js +0 -165
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -501
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/markupUtils.js +0 -70
- package/configure/lib/markupUtils.js.map +0 -1
- package/configure/lib/utils.js +0 -15
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -22
- package/controller/CHANGELOG.json +0 -517
- package/controller/CHANGELOG.md +0 -1386
- package/controller/lib/__tests__/index.spec.js +0 -30
- package/controller/lib/__tests__/index.test.js +0 -950
- package/controller/lib/defaults.js +0 -23
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -368
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -18
- package/docs/config-schema.json +0 -2629
- package/docs/config-schema.json.md +0 -1941
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -20
- package/docs/demo/index.html +0 -1
- package/docs/demo/pie.manifest.json +0 -11
- package/docs/demo/session.js +0 -10
- package/docs/pie-schema.json +0 -1130
- package/docs/pie-schema.json.md +0 -814
- package/lib/__tests__/main.test.js +0 -166
- package/lib/index.js +0 -92
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -205
- package/lib/main.js.map +0 -1
- package/lib/print.js +0 -71
- package/lib/print.js.map +0 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { isEmpty as n } from "@pie-element/shared-lodash";
|
|
4
|
+
import r from "@pie-lib/correct-answer-toggle";
|
|
5
|
+
import { ConstructedResponse as i } from "@pie-lib/mask-markup";
|
|
6
|
+
import * as a from "@pie-lib/render-ui";
|
|
7
|
+
import { Collapsible as o, PreviewPrompt as s, UiLayout as c, color as l, hasMedia as u, hasText as d } from "@pie-lib/render-ui";
|
|
8
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
import { styled as m } from "@mui/material/styles";
|
|
10
|
+
import h from "@pie-lib/translator";
|
|
11
|
+
//#region src/delivery/main.tsx
|
|
12
|
+
function g(e) {
|
|
13
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
14
|
+
}
|
|
15
|
+
function _(e, t) {
|
|
16
|
+
return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
|
|
17
|
+
}
|
|
18
|
+
var v = _(c, "UiLayout") || _(C.UiLayout, "UiLayout"), y = _(s, "PreviewPrompt") || _(C.PreviewPrompt, "PreviewPrompt"), b = _(o, "Collapsible") || _(C.Collapsible, "Collapsible"), x = a, S = x.default, C = S && typeof S == "object" ? S : x, { translator: w } = h, T = m(v)(({ alwaysShowCorrect: e }) => ({
|
|
19
|
+
color: l.text(),
|
|
20
|
+
backgroundColor: l.background(),
|
|
21
|
+
...e && { "& *": { borderColor: `${l.text()} !important` } }
|
|
22
|
+
})), E = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), D = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), O = m("h2")({
|
|
23
|
+
position: "absolute",
|
|
24
|
+
left: "-10000px",
|
|
25
|
+
top: "auto",
|
|
26
|
+
width: "1px",
|
|
27
|
+
height: "1px",
|
|
28
|
+
overflow: "hidden"
|
|
29
|
+
}), k = class extends e.Component {
|
|
30
|
+
static propTypes = {
|
|
31
|
+
alwaysShowCorrect: t.bool,
|
|
32
|
+
animationsDisabled: t.bool,
|
|
33
|
+
disabled: t.bool,
|
|
34
|
+
displayType: t.string,
|
|
35
|
+
feedback: t.object,
|
|
36
|
+
language: t.string,
|
|
37
|
+
markup: t.string,
|
|
38
|
+
maxLengthPerChoice: t.array,
|
|
39
|
+
maxLengthPerChoiceEnabled: t.bool,
|
|
40
|
+
mode: t.string,
|
|
41
|
+
note: t.string,
|
|
42
|
+
onChange: t.func,
|
|
43
|
+
playerSpellCheckEnabled: t.bool,
|
|
44
|
+
prompt: t.string,
|
|
45
|
+
rationale: t.string,
|
|
46
|
+
role: t.string,
|
|
47
|
+
showNote: t.bool,
|
|
48
|
+
teacherInstructions: t.string,
|
|
49
|
+
value: t.object,
|
|
50
|
+
responseAreaInputConfiguration: t.object,
|
|
51
|
+
model: t.object.isRequired
|
|
52
|
+
};
|
|
53
|
+
static defaultProps = { value: {} };
|
|
54
|
+
state = { showCorrectAnswer: this.props.alwaysShowCorrect || !1 };
|
|
55
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
56
|
+
let { language: t } = this.props, { note: r } = this.props;
|
|
57
|
+
n(e.feedback) && this.setState({ showCorrectAnswer: !1 }), e.alwaysShowCorrect && this.setState({ showCorrectAnswer: !0 }), r && t && t !== e.language && r === w.t("common:commonCorrectAnswerWithAlternates", { lng: t }) && (r = w.t("common:commonCorrectAnswerWithAlternates", { lng: e.language }));
|
|
58
|
+
}
|
|
59
|
+
toggleShowCorrect = () => {
|
|
60
|
+
this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
|
|
61
|
+
};
|
|
62
|
+
onChange = (e) => {
|
|
63
|
+
this.props.onChange(e);
|
|
64
|
+
};
|
|
65
|
+
render() {
|
|
66
|
+
let { showCorrectAnswer: e } = this.state, { alwaysShowCorrect: t, animationsDisabled: n, mode: a, displayType: o, role: s, language: c, maxLengthPerChoice: l, maxLengthPerChoiceEnabled: m, note: h, playerSpellCheckEnabled: g, prompt: _, rationale: v, showNote: x, teacherInstructions: S, responseAreaInputConfiguration: C, model: w, value: k } = this.props, { extraCSSRules: A } = w || {}, j = (e || a === "view" && s === "instructor") && x && h, M = /* @__PURE__ */ f(y, {
|
|
67
|
+
defaultClassName: "teacher-instructions",
|
|
68
|
+
prompt: S
|
|
69
|
+
}), N = /* @__PURE__ */ f(y, { prompt: v }), P = v && (d(v) || u(v)), F = S && (d(S) || u(S));
|
|
70
|
+
return /* @__PURE__ */ p(T, {
|
|
71
|
+
extraCSSRules: A,
|
|
72
|
+
alwaysShowCorrect: t,
|
|
73
|
+
style: { display: `${o}` },
|
|
74
|
+
children: [
|
|
75
|
+
a === "gather" && /* @__PURE__ */ f(O, { children: "Fill in the Blank Question" }),
|
|
76
|
+
F && /* @__PURE__ */ f(D, { children: n ? M : /* @__PURE__ */ f(b, {
|
|
77
|
+
labels: {
|
|
78
|
+
hidden: "Show Teacher Instructions",
|
|
79
|
+
visible: "Hide Teacher Instructions"
|
|
80
|
+
},
|
|
81
|
+
children: M
|
|
82
|
+
}) }),
|
|
83
|
+
_ && /* @__PURE__ */ f(y, { prompt: _ }),
|
|
84
|
+
!t && a === "evaluate" && /* @__PURE__ */ f(r, {
|
|
85
|
+
show: !0,
|
|
86
|
+
toggled: e,
|
|
87
|
+
onToggle: this.toggleShowCorrect,
|
|
88
|
+
language: c
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ f(i, {
|
|
91
|
+
...this.props,
|
|
92
|
+
onChange: this.onChange,
|
|
93
|
+
showCorrectAnswer: e,
|
|
94
|
+
value: k,
|
|
95
|
+
maxLength: l,
|
|
96
|
+
adjustedLimit: m,
|
|
97
|
+
spellCheck: g,
|
|
98
|
+
pluginProps: C
|
|
99
|
+
}),
|
|
100
|
+
j && /* @__PURE__ */ f(E, { dangerouslySetInnerHTML: { __html: h } }),
|
|
101
|
+
P && /* @__PURE__ */ f(D, { children: n ? N : /* @__PURE__ */ f(b, {
|
|
102
|
+
labels: {
|
|
103
|
+
hidden: "Show Rationale",
|
|
104
|
+
visible: "Hide Rationale"
|
|
105
|
+
},
|
|
106
|
+
children: N
|
|
107
|
+
}) })
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { k as Main, k as default };
|