@pie-element/inline-dropdown 10.4.0-beta.7 → 11.0.0-next.20261002100925
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/author/defaults.d.ts +194 -0
- package/dist/author/defaults.js +130 -0
- package/dist/author/index.d.ts +44 -0
- package/dist/author/index.js +86 -0
- package/dist/author/inline-dropdown-toolbar.d.ts +49 -0
- package/dist/author/inline-dropdown-toolbar.js +266 -0
- package/dist/author/main.d.ts +49 -0
- package/dist/author/main.js +379 -0
- package/dist/author/markupUtils.d.ts +12 -0
- package/dist/author/markupUtils.js +23 -0
- package/dist/author/response-area.d.ts +20 -0
- package/dist/author/response-area.js +32 -0
- package/dist/author/utils.d.ts +10 -0
- package/dist/author/utils.js +10 -0
- package/dist/browser/Close-BtVRakGm.js +9145 -0
- package/dist/browser/Close-BtVRakGm.js.map +1 -0
- package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/author/index.js +35963 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/controller/index.js +196 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +2804 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-BJd6t-uW.js +137 -0
- package/dist/browser/dist-BJd6t-uW.js.map +1 -0
- package/dist/browser/editor-runtime/Close-Z_UL2IH9.js +9145 -0
- package/dist/browser/editor-runtime/Close-Z_UL2IH9.js.map +1 -0
- package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/editor-runtime/author/index.js +19554 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -0
- package/dist/browser/editor-runtime/controller/index.js +196 -0
- package/dist/browser/editor-runtime/controller/index.js.map +1 -0
- package/dist/browser/editor-runtime/delivery/index.js +2804 -0
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
- package/dist/browser/editor-runtime/dist-BJd6t-uW.js +137 -0
- package/dist/browser/editor-runtime/dist-BJd6t-uW.js.map +1 -0
- package/dist/browser/editor-runtime/rolldown-runtime-CHQKHQ89.js +32 -0
- package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
- package/dist/controller/defaults.d.ts +27 -0
- package/dist/controller/defaults.js +21 -0
- package/dist/controller/index.d.ts +54 -0
- package/dist/controller/index.js +124 -0
- package/dist/controller/utils.d.ts +12 -0
- package/dist/controller/utils.js +13 -0
- package/dist/delivery/index.d.ts +20 -0
- package/dist/delivery/index.js +60 -0
- package/dist/delivery/inline-dropdown.d.ts +38 -0
- package/dist/delivery/inline-dropdown.js +109 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +148 -0
- package/dist/index.js +2 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +94 -21
- package/CHANGELOG.json +0 -1082
- package/CHANGELOG.md +0 -2237
- package/LICENSE.md +0 -5
- package/README.md +0 -1
- package/configure/CHANGELOG.json +0 -647
- package/configure/CHANGELOG.md +0 -1994
- package/configure/lib/__tests__/inline-dropdown-toolbar.test.js +0 -1654
- package/configure/lib/__tests__/main.test.js +0 -598
- package/configure/lib/__tests__/markupUtils.test.js +0 -107
- package/configure/lib/defaults.js +0 -192
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -139
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/inline-dropdown-toolbar.js +0 -462
- package/configure/lib/inline-dropdown-toolbar.js.map +0 -1
- package/configure/lib/main.js +0 -612
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/markupUtils.js +0 -50
- package/configure/lib/markupUtils.js.map +0 -1
- package/configure/lib/response-area.js +0 -48
- package/configure/lib/response-area.js.map +0 -1
- package/configure/lib/utils.js +0 -22
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -24
- package/controller/CHANGELOG.json +0 -467
- package/controller/CHANGELOG.md +0 -1325
- package/controller/lib/__tests__/index.test.js +0 -705
- package/controller/lib/defaults.js +0 -25
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -295
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -32
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -16
- package/docs/config-schema.json +0 -2854
- package/docs/config-schema.json.md +0 -2106
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -76
- package/docs/demo/index.html +0 -1
- package/docs/demo/pie.manifest.json +0 -11
- package/docs/demo/session.js +0 -11
- package/docs/pie-schema.json +0 -1152
- package/docs/pie-schema.json.md +0 -814
- package/lib/index.js +0 -86
- package/lib/index.js.map +0 -1
- package/lib/inline-dropdown.js +0 -176
- package/lib/inline-dropdown.js.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { renderMath as t } from "@pie-element/shared-math-rendering-mathjax";
|
|
3
|
+
import n from "react-dom";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { isEmpty as i } from "@pie-element/shared-lodash";
|
|
6
|
+
import a from "@pie-lib/correct-answer-toggle";
|
|
7
|
+
import { InlineDropdown as o } from "@pie-lib/mask-markup";
|
|
8
|
+
import * as s from "@pie-lib/render-ui";
|
|
9
|
+
import { Collapsible as c, PreviewPrompt as l, UiLayout as u, color as d, hasMedia as f, hasText as p } from "@pie-lib/render-ui";
|
|
10
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { styled as g } from "@mui/material/styles";
|
|
12
|
+
//#region src/delivery/inline-dropdown.tsx
|
|
13
|
+
function _(e) {
|
|
14
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
15
|
+
}
|
|
16
|
+
function v(e, t) {
|
|
17
|
+
return !e || _(e) ? e : _(e.default) ? e.default : t && _(e[t]) ? e[t] : t && _(e[t]?.default) ? e[t].default : e;
|
|
18
|
+
}
|
|
19
|
+
var y = v(u, "UiLayout") || v(w.UiLayout, "UiLayout"), b = v(l, "PreviewPrompt") || v(w.PreviewPrompt, "PreviewPrompt"), x = v(c, "Collapsible") || v(w.Collapsible, "Collapsible"), S = s, C = S.default, w = C && typeof C == "object" ? C : S, T = g(y)({
|
|
20
|
+
color: d.text(),
|
|
21
|
+
backgroundColor: d.background()
|
|
22
|
+
}), E = g(x)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), D = g("div")(({ theme: e }) => ({ "&:not(:last-child)": { marginBottom: e.spacing(2) } })), O = g("div")({
|
|
23
|
+
display: "flex",
|
|
24
|
+
whiteSpace: "break-spaces"
|
|
25
|
+
}), k = g("div")(({ correct: e }) => ({
|
|
26
|
+
display: "flex",
|
|
27
|
+
...e ? { color: d.correct() } : { color: d.incorrectWithIcon() }
|
|
28
|
+
})), A = g("h2")({
|
|
29
|
+
position: "absolute",
|
|
30
|
+
left: "-10000px",
|
|
31
|
+
top: "auto",
|
|
32
|
+
width: "1px",
|
|
33
|
+
height: "1px",
|
|
34
|
+
overflow: "hidden"
|
|
35
|
+
}), j = class extends e.Component {
|
|
36
|
+
static propTypes = {
|
|
37
|
+
prompt: r.string,
|
|
38
|
+
disabled: r.bool,
|
|
39
|
+
markup: r.string,
|
|
40
|
+
mode: r.string,
|
|
41
|
+
displayType: r.string,
|
|
42
|
+
rationale: r.string,
|
|
43
|
+
teacherInstructions: r.string,
|
|
44
|
+
model: r.object.isRequired,
|
|
45
|
+
choices: r.object,
|
|
46
|
+
value: r.object,
|
|
47
|
+
feedback: r.object,
|
|
48
|
+
onChange: r.func,
|
|
49
|
+
language: r.string
|
|
50
|
+
};
|
|
51
|
+
static defaultProps = { value: {} };
|
|
52
|
+
state = { showCorrectAnswer: !1 };
|
|
53
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
54
|
+
i(e.feedback) && this.setState({ showCorrectAnswer: !1 });
|
|
55
|
+
}
|
|
56
|
+
componentDidUpdate() {
|
|
57
|
+
t(n.findDOMNode(this));
|
|
58
|
+
}
|
|
59
|
+
toggleShowCorrect = () => {
|
|
60
|
+
this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
|
|
61
|
+
};
|
|
62
|
+
render() {
|
|
63
|
+
let { showCorrectAnswer: e } = this.state, { prompt: t, mode: n, model: r, rationale: i, teacherInstructions: s, choices: c, displayType: l, language: u } = this.props, { extraCSSRules: d } = r || {}, g = n === "evaluate", _ = !1, v = i && (p(i) || f(i)), y = s && (p(s) || f(s)), S = (Object.keys(c) || []).map((e) => (c[e] || []).reduce((e, t) => (t.rationale && p(t.rationale) && (_ = !0, e.push(t)), e), []));
|
|
64
|
+
return /* @__PURE__ */ h(T, {
|
|
65
|
+
extraCSSRules: d,
|
|
66
|
+
style: { display: `${l}` },
|
|
67
|
+
children: [
|
|
68
|
+
n === "gather" && /* @__PURE__ */ m(A, { children: "Inline Dropdown Question" }),
|
|
69
|
+
y && /* @__PURE__ */ m(E, {
|
|
70
|
+
labels: {
|
|
71
|
+
hidden: "Show Teacher Instructions",
|
|
72
|
+
visible: "Hide Teacher Instructions"
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ m(b, { prompt: s })
|
|
75
|
+
}),
|
|
76
|
+
t && /* @__PURE__ */ m(b, { prompt: t }),
|
|
77
|
+
/* @__PURE__ */ m(a, {
|
|
78
|
+
show: g,
|
|
79
|
+
toggled: e,
|
|
80
|
+
onToggle: this.toggleShowCorrect,
|
|
81
|
+
language: u
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ m(o, {
|
|
84
|
+
...this.props,
|
|
85
|
+
showCorrectAnswer: e
|
|
86
|
+
}),
|
|
87
|
+
_ && /* @__PURE__ */ m(E, {
|
|
88
|
+
labels: {
|
|
89
|
+
hidden: "Show Rationale for choices",
|
|
90
|
+
visible: "Hide Rationale for choices"
|
|
91
|
+
},
|
|
92
|
+
children: S.map((e, t) => /* @__PURE__ */ m(D, { children: e?.length > 0 && e.map((e) => /* @__PURE__ */ h(O, { children: [/* @__PURE__ */ m(k, {
|
|
93
|
+
correct: e.correct,
|
|
94
|
+
dangerouslySetInnerHTML: { __html: `${e.label}: ` }
|
|
95
|
+
}), /* @__PURE__ */ m(b, { prompt: e.rationale })] }, e.label)) }, t))
|
|
96
|
+
}),
|
|
97
|
+
v && /* @__PURE__ */ m(x, {
|
|
98
|
+
labels: {
|
|
99
|
+
hidden: "Show Rationale",
|
|
100
|
+
visible: "Hide Rationale"
|
|
101
|
+
},
|
|
102
|
+
children: /* @__PURE__ */ m(b, { prompt: i })
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
export { j as InlineDropdown, j as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './delivery/index.js';
|