@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.
Files changed (105) hide show
  1. package/author.js +2 -0
  2. package/configure.js +2 -0
  3. package/controller.js +1 -0
  4. package/dist/author/defaults.d.ts +194 -0
  5. package/dist/author/defaults.js +130 -0
  6. package/dist/author/index.d.ts +44 -0
  7. package/dist/author/index.js +86 -0
  8. package/dist/author/inline-dropdown-toolbar.d.ts +49 -0
  9. package/dist/author/inline-dropdown-toolbar.js +266 -0
  10. package/dist/author/main.d.ts +49 -0
  11. package/dist/author/main.js +379 -0
  12. package/dist/author/markupUtils.d.ts +12 -0
  13. package/dist/author/markupUtils.js +23 -0
  14. package/dist/author/response-area.d.ts +20 -0
  15. package/dist/author/response-area.js +32 -0
  16. package/dist/author/utils.d.ts +10 -0
  17. package/dist/author/utils.js +10 -0
  18. package/dist/browser/Close-BtVRakGm.js +9145 -0
  19. package/dist/browser/Close-BtVRakGm.js.map +1 -0
  20. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  21. package/dist/browser/author/index.js +35963 -0
  22. package/dist/browser/author/index.js.map +1 -0
  23. package/dist/browser/controller/index.js +196 -0
  24. package/dist/browser/controller/index.js.map +1 -0
  25. package/dist/browser/delivery/index.js +2804 -0
  26. package/dist/browser/delivery/index.js.map +1 -0
  27. package/dist/browser/dist-BJd6t-uW.js +137 -0
  28. package/dist/browser/dist-BJd6t-uW.js.map +1 -0
  29. package/dist/browser/editor-runtime/Close-Z_UL2IH9.js +9145 -0
  30. package/dist/browser/editor-runtime/Close-Z_UL2IH9.js.map +1 -0
  31. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  32. package/dist/browser/editor-runtime/author/index.js +19554 -0
  33. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  34. package/dist/browser/editor-runtime/controller/index.js +196 -0
  35. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  36. package/dist/browser/editor-runtime/delivery/index.js +2804 -0
  37. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  38. package/dist/browser/editor-runtime/dist-BJd6t-uW.js +137 -0
  39. package/dist/browser/editor-runtime/dist-BJd6t-uW.js.map +1 -0
  40. package/dist/browser/editor-runtime/rolldown-runtime-CHQKHQ89.js +32 -0
  41. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  42. package/dist/controller/defaults.d.ts +27 -0
  43. package/dist/controller/defaults.js +21 -0
  44. package/dist/controller/index.d.ts +54 -0
  45. package/dist/controller/index.js +124 -0
  46. package/dist/controller/utils.d.ts +12 -0
  47. package/dist/controller/utils.js +13 -0
  48. package/dist/delivery/index.d.ts +20 -0
  49. package/dist/delivery/index.js +60 -0
  50. package/dist/delivery/inline-dropdown.d.ts +38 -0
  51. package/dist/delivery/inline-dropdown.js +109 -0
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.iife.d.ts +8 -0
  54. package/dist/index.iife.js +148 -0
  55. package/dist/index.js +2 -0
  56. package/dist/runtime-support.d.ts +12 -0
  57. package/dist/runtime-support.js +12 -0
  58. package/package.json +94 -21
  59. package/CHANGELOG.json +0 -1082
  60. package/CHANGELOG.md +0 -2237
  61. package/LICENSE.md +0 -5
  62. package/README.md +0 -1
  63. package/configure/CHANGELOG.json +0 -647
  64. package/configure/CHANGELOG.md +0 -1994
  65. package/configure/lib/__tests__/inline-dropdown-toolbar.test.js +0 -1654
  66. package/configure/lib/__tests__/main.test.js +0 -598
  67. package/configure/lib/__tests__/markupUtils.test.js +0 -107
  68. package/configure/lib/defaults.js +0 -192
  69. package/configure/lib/defaults.js.map +0 -1
  70. package/configure/lib/index.js +0 -139
  71. package/configure/lib/index.js.map +0 -1
  72. package/configure/lib/inline-dropdown-toolbar.js +0 -462
  73. package/configure/lib/inline-dropdown-toolbar.js.map +0 -1
  74. package/configure/lib/main.js +0 -612
  75. package/configure/lib/main.js.map +0 -1
  76. package/configure/lib/markupUtils.js +0 -50
  77. package/configure/lib/markupUtils.js.map +0 -1
  78. package/configure/lib/response-area.js +0 -48
  79. package/configure/lib/response-area.js.map +0 -1
  80. package/configure/lib/utils.js +0 -22
  81. package/configure/lib/utils.js.map +0 -1
  82. package/configure/package.json +0 -24
  83. package/controller/CHANGELOG.json +0 -467
  84. package/controller/CHANGELOG.md +0 -1325
  85. package/controller/lib/__tests__/index.test.js +0 -705
  86. package/controller/lib/defaults.js +0 -25
  87. package/controller/lib/defaults.js.map +0 -1
  88. package/controller/lib/index.js +0 -295
  89. package/controller/lib/index.js.map +0 -1
  90. package/controller/lib/utils.js +0 -32
  91. package/controller/lib/utils.js.map +0 -1
  92. package/controller/package.json +0 -16
  93. package/docs/config-schema.json +0 -2854
  94. package/docs/config-schema.json.md +0 -2106
  95. package/docs/demo/config.js +0 -8
  96. package/docs/demo/generate.js +0 -76
  97. package/docs/demo/index.html +0 -1
  98. package/docs/demo/pie.manifest.json +0 -11
  99. package/docs/demo/session.js +0 -11
  100. package/docs/pie-schema.json +0 -1152
  101. package/docs/pie-schema.json.md +0 -814
  102. package/lib/index.js +0 -86
  103. package/lib/index.js.map +0 -1
  104. package/lib/inline-dropdown.js +0 -176
  105. 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 };
@@ -0,0 +1 @@
1
+ export { default } from './delivery/index.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * IIFE entry point for inline-dropdown element
3
+ * This file is only used for IIFE builds and includes auto-registration
4
+ *
5
+ * @sync-generated - Auto-generated during sync from pie-elements
6
+ */
7
+ import Element from './index.js';
8
+ export default Element;