@pie-element/likert 4.1.0-next.28 → 4.1.1-next.0

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 (171) hide show
  1. package/dist/author/choiceGenerator.d.ts +13 -0
  2. package/dist/author/choiceGenerator.js +255 -0
  3. package/dist/author/defaults.d.ts +102 -0
  4. package/dist/author/defaults.js +60 -0
  5. package/dist/author/index.d.ts +31 -0
  6. package/dist/author/index.js +73 -0
  7. package/dist/author/likertEntities.d.ts +25 -0
  8. package/dist/author/likertEntities.js +18 -0
  9. package/dist/author/main.d.ts +27 -0
  10. package/dist/author/main.js +298 -0
  11. package/dist/controller/defaults.d.ts +19 -0
  12. package/dist/controller/defaults.js +13 -0
  13. package/dist/controller/index.d.ts +19 -0
  14. package/dist/controller/index.js +41 -0
  15. package/dist/delivery/choice-input.d.ts +27 -0
  16. package/dist/delivery/choice-input.js +59 -0
  17. package/dist/delivery/index.d.ts +19 -0
  18. package/dist/delivery/index.js +44 -0
  19. package/dist/delivery/likert.d.ts +26 -0
  20. package/dist/delivery/likert.js +70 -0
  21. package/dist/delivery/likertEntities.d.ts +12 -0
  22. package/dist/delivery/likertEntities.js +7 -0
  23. package/dist/delivery/main.d.ts +23 -0
  24. package/dist/delivery/main.js +37 -0
  25. package/dist/delivery/session-updater.d.ts +9 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.iife.d.ts +8 -0
  28. package/dist/index.iife.js +145 -0
  29. package/dist/index.js +2 -0
  30. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  33. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  34. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  35. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  36. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js +8 -0
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +5 -0
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js +19 -0
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +15 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +12 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js +6 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js +14 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/merge.js +8 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js +8 -0
  127. package/package.json +54 -20
  128. package/CHANGELOG.json +0 -1
  129. package/CHANGELOG.md +0 -1443
  130. package/LICENSE.md +0 -5
  131. package/configure/CHANGELOG.json +0 -1
  132. package/configure/CHANGELOG.md +0 -1361
  133. package/configure/lib/choiceGenerator.js +0 -219
  134. package/configure/lib/choiceGenerator.js.map +0 -1
  135. package/configure/lib/defaults.js +0 -100
  136. package/configure/lib/defaults.js.map +0 -1
  137. package/configure/lib/index.js +0 -106
  138. package/configure/lib/index.js.map +0 -1
  139. package/configure/lib/likertEntities.js +0 -24
  140. package/configure/lib/likertEntities.js.map +0 -1
  141. package/configure/lib/main.js +0 -388
  142. package/configure/lib/main.js.map +0 -1
  143. package/configure/package.json +0 -27
  144. package/controller/CHANGELOG.json +0 -1
  145. package/controller/CHANGELOG.md +0 -82
  146. package/controller/lib/defaults.js +0 -17
  147. package/controller/lib/defaults.js.map +0 -1
  148. package/controller/lib/index.js +0 -81
  149. package/controller/lib/index.js.map +0 -1
  150. package/controller/package.json +0 -17
  151. package/docs/config-schema.json +0 -2011
  152. package/docs/config-schema.json.md +0 -1487
  153. package/docs/demo/config.js +0 -8
  154. package/docs/demo/generate.js +0 -22
  155. package/docs/demo/index.html +0 -1
  156. package/docs/demo/session.js +0 -6
  157. package/docs/pie-schema.json +0 -966
  158. package/docs/pie-schema.json.md +0 -711
  159. package/lib/choice-input.js +0 -90
  160. package/lib/choice-input.js.map +0 -1
  161. package/lib/index.js +0 -64
  162. package/lib/index.js.map +0 -1
  163. package/lib/likert.js +0 -97
  164. package/lib/likert.js.map +0 -1
  165. package/lib/likertEntities.js +0 -11
  166. package/lib/likertEntities.js.map +0 -1
  167. package/lib/main.js +0 -42
  168. package/lib/main.js.map +0 -1
  169. package/lib/session-updater.js +0 -15
  170. package/lib/session-updater.js.map +0 -1
  171. package/readme.md +0 -55
@@ -0,0 +1,298 @@
1
+ import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/merge.js";
2
+ import { LIKERT_ORIENTATION as t, LIKERT_SCALE as n, LIKERT_TYPE as r } from "./likertEntities.js";
3
+ import i from "./choiceGenerator.js";
4
+ import a from "react";
5
+ import o from "prop-types";
6
+ import { color as s } from "@pie-lib/render-ui";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import u from "@mui/material/FormControlLabel";
9
+ import { styled as d } from "@mui/material/styles";
10
+ import f from "@mui/material/Radio";
11
+ import p from "@pie-lib/editable-html-tip-tap";
12
+ import m from "@mui/material/RadioGroup";
13
+ import { InputContainer as h, NumberTextField as g, layout as _, settings as v } from "@pie-lib/config-ui";
14
+ //#region src/author/main.tsx
15
+ var { Panel: y, toggle: b, radio: x } = v, S = d(h)(({ theme: e }) => ({
16
+ width: "100%",
17
+ paddingTop: e.spacing(2),
18
+ marginBottom: e.spacing(2)
19
+ })), C = d("div")({
20
+ display: "flex",
21
+ flexDirection: "column"
22
+ }), w = d("p")(({ theme: e }) => ({
23
+ color: e.palette.grey[400],
24
+ fontSize: e.typography.fontSize - 2
25
+ })), T = d("div")(({ theme: e }) => ({
26
+ display: "flex",
27
+ width: "100%",
28
+ alignItems: "flex-start",
29
+ marginBottom: e.spacing(2)
30
+ })), E = d("div")(({ theme: e }) => ({
31
+ display: "flex",
32
+ width: "100%",
33
+ justifyContent: "space-around",
34
+ marginBottom: e.spacing(2.5)
35
+ })), D = d(h)({
36
+ width: "calc(100% - 200px)",
37
+ marginRight: 0
38
+ }), O = d("p")(({ theme: e }) => ({
39
+ color: e.palette.error.main,
40
+ fontSize: e.typography.fontSize - 2
41
+ })), k = d(g)({ width: "100%" }), A = d("div")({
42
+ display: "flex",
43
+ flexDirection: "row"
44
+ }), j = d("div")(({ theme: e }) => ({
45
+ paddingLeft: e.spacing(2.5),
46
+ width: "150px"
47
+ })), M = d(p)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), N = d("span")(({ theme: e }) => ({
48
+ width: "30px",
49
+ paddingTop: e.spacing(4)
50
+ })), P = d("div")(({ theme: e }) => ({
51
+ fontSize: e.typography.fontSize - 2,
52
+ color: e.palette.error.main,
53
+ paddingTop: e.spacing(1)
54
+ })), F = d(f)({ color: `${s.tertiary()} !important` }), I = (e) => {
55
+ let { model: n, onChangeModel: r } = e;
56
+ return /* @__PURE__ */ l(C, { children: [/* @__PURE__ */ c(w, { children: "Likert Orientation" }), /* @__PURE__ */ l(m, {
57
+ "aria-label": "likertOrientation",
58
+ name: "likertOrientation",
59
+ value: n.likertOrientation,
60
+ onChange: (e) => {
61
+ let t = e.target.value;
62
+ r({
63
+ ...n,
64
+ likertOrientation: t
65
+ });
66
+ },
67
+ children: [/* @__PURE__ */ c(u, {
68
+ value: t.horizontal,
69
+ control: /* @__PURE__ */ c(F, {}),
70
+ label: "Horizontal"
71
+ }), /* @__PURE__ */ c(u, {
72
+ value: t.vertical,
73
+ control: /* @__PURE__ */ c(F, {}),
74
+ label: "Vertical"
75
+ })]
76
+ })] });
77
+ }, L = (e) => {
78
+ let { model: t, onChangeModel: r } = e;
79
+ return /* @__PURE__ */ l(C, { children: [/* @__PURE__ */ c(w, { children: "Likert Scale" }), /* @__PURE__ */ l(m, {
80
+ "aria-label": "likertScale",
81
+ name: "likertScale",
82
+ value: t.likertScale,
83
+ onChange: (e) => {
84
+ let n = e.target.value;
85
+ r({
86
+ ...t,
87
+ likertScale: n,
88
+ choices: i(n, t.likertType)
89
+ });
90
+ },
91
+ children: [
92
+ /* @__PURE__ */ c(u, {
93
+ value: n.likert3,
94
+ control: /* @__PURE__ */ c(F, {}),
95
+ label: "Likert 3"
96
+ }),
97
+ /* @__PURE__ */ c(u, {
98
+ value: n.likert5,
99
+ control: /* @__PURE__ */ c(F, {}),
100
+ label: "Likert 5"
101
+ }),
102
+ /* @__PURE__ */ c(u, {
103
+ value: n.likert7,
104
+ control: /* @__PURE__ */ c(F, {}),
105
+ label: "Likert 7"
106
+ })
107
+ ]
108
+ })] });
109
+ }, R = (e) => {
110
+ let { model: t, onChangeModel: n } = e, a = (e) => {
111
+ let r = e.target.value;
112
+ n({
113
+ ...t,
114
+ likertType: r,
115
+ choices: i(t.likertScale, r)
116
+ });
117
+ };
118
+ return /* @__PURE__ */ l(C, { children: [/* @__PURE__ */ c(w, { children: "Label Type" }), /* @__PURE__ */ l(A, { children: [/* @__PURE__ */ l(m, {
119
+ "aria-label": "likertLabelType",
120
+ name: "likertLabelType",
121
+ value: t.likertType,
122
+ onChange: a,
123
+ children: [
124
+ /* @__PURE__ */ c(u, {
125
+ value: r.agreement,
126
+ control: /* @__PURE__ */ c(F, {}),
127
+ label: "Agreement"
128
+ }),
129
+ /* @__PURE__ */ c(u, {
130
+ value: r.frequency,
131
+ control: /* @__PURE__ */ c(F, {}),
132
+ label: "Frequency"
133
+ }),
134
+ /* @__PURE__ */ c(u, {
135
+ value: r.yesNo,
136
+ control: /* @__PURE__ */ c(F, {}),
137
+ label: "Yes/No"
138
+ })
139
+ ]
140
+ }), /* @__PURE__ */ l(m, {
141
+ "aria-label": "likertLabelType",
142
+ name: "likertLabelType",
143
+ value: t.likertType,
144
+ onChange: a,
145
+ children: [
146
+ /* @__PURE__ */ c(u, {
147
+ value: r.importance,
148
+ control: /* @__PURE__ */ c(F, {}),
149
+ label: "Importance"
150
+ }),
151
+ /* @__PURE__ */ c(u, {
152
+ value: r.likelihood,
153
+ control: /* @__PURE__ */ c(F, {}),
154
+ label: "Likelihood"
155
+ }),
156
+ /* @__PURE__ */ c(u, {
157
+ value: r.like,
158
+ control: /* @__PURE__ */ c(F, {}),
159
+ label: "Like"
160
+ })
161
+ ]
162
+ })] })] });
163
+ }, z = (e) => e.choices.reduce((e, t) => {
164
+ let n = { ...e }, r = parseInt(t.value);
165
+ return n[r] || (n[r] = 0), {
166
+ ...n,
167
+ [r]: n[r] + 1
168
+ };
169
+ }, {}), B = (e) => {
170
+ let { configuration: t, imageSupport: n, model: r, onChangeModel: i, onChoiceChanged: a, onConfigurationChanged: o, onPromptChanged: s, onTeacherInstructionsChanged: u, uploadSoundSupport: d } = e, { contentDimensions: f = {}, prompt: m = {}, scoringType: h = {}, settingsPanelDisabled: g, spellCheck: v = {}, teacherInstructions: C = {}, baseInputConfiguration: w = {}, likertChoice: A = {} } = t || {}, { errors: F = {}, extraCSSRules: B, spellCheckEnabled: V, teacherInstructionsEnabled: H } = r || {}, { prompt: U, teacherInstructions: W } = F, G = z(r), K = {
171
+ teacherInstructionsEnabled: C.settings && b(C.label),
172
+ spellCheckEnabled: v.settings && b(v.label),
173
+ scoringType: h.settings && x(h.label, ["auto", "rubric"])
174
+ }, q = (e = {}) => Object.assign({ ...w }, e || {});
175
+ return /* @__PURE__ */ l(_.ConfigLayout, {
176
+ extraCSSRules: B,
177
+ dimensions: f,
178
+ hideSettings: g,
179
+ settings: /* @__PURE__ */ c(y, {
180
+ model: r,
181
+ onChangeModel: i,
182
+ configuration: t,
183
+ onChangeConfiguration: o,
184
+ groups: { Properties: K }
185
+ }),
186
+ children: [
187
+ H && /* @__PURE__ */ l(S, {
188
+ label: C.label,
189
+ children: [/* @__PURE__ */ c(p, {
190
+ markup: r.teacherInstructions || "",
191
+ onChange: u,
192
+ imageSupport: n,
193
+ nonEmpty: !1,
194
+ error: W,
195
+ spellCheck: V,
196
+ uploadSoundSupport: d,
197
+ pluginProps: q(C?.inputConfiguration)
198
+ }), W && /* @__PURE__ */ c(P, { children: W })]
199
+ }),
200
+ /* @__PURE__ */ l(S, {
201
+ label: m.label,
202
+ children: [/* @__PURE__ */ c(p, {
203
+ markup: r.prompt,
204
+ onChange: s,
205
+ imageSupport: n,
206
+ nonEmpty: !1,
207
+ error: U,
208
+ spellCheck: V,
209
+ disableUnderline: !0,
210
+ uploadSoundSupport: d,
211
+ pluginProps: q(m?.inputConfiguration)
212
+ }), U && /* @__PURE__ */ c(P, { children: U })]
213
+ }),
214
+ /* @__PURE__ */ l(E, { children: [
215
+ /* @__PURE__ */ c(L, {
216
+ model: r,
217
+ onChangeModel: i
218
+ }),
219
+ /* @__PURE__ */ c(R, {
220
+ model: r,
221
+ onChangeModel: i
222
+ }),
223
+ /* @__PURE__ */ c(I, {
224
+ model: r,
225
+ onChangeModel: i
226
+ })
227
+ ] }),
228
+ r.choices.map((e, t) => /* @__PURE__ */ l(T, { children: [
229
+ /* @__PURE__ */ l(N, { children: [t + 1, "."] }),
230
+ /* @__PURE__ */ c(D, {
231
+ label: "Likert Label",
232
+ children: /* @__PURE__ */ c(M, {
233
+ markup: e.label || "",
234
+ onChange: (n) => a(t, {
235
+ ...e,
236
+ label: n
237
+ }),
238
+ imageSupport: n,
239
+ spellCheck: V,
240
+ uploadSoundSupport: d,
241
+ pluginProps: q(A?.inputConfiguration)
242
+ })
243
+ }, `likert-label-${t}`),
244
+ /* @__PURE__ */ l(j, { children: [/* @__PURE__ */ c(k, {
245
+ label: "Likert Value",
246
+ value: e.value,
247
+ max: 100,
248
+ min: -100,
249
+ onChange: (n, r) => {
250
+ a(t, {
251
+ ...e,
252
+ value: r
253
+ });
254
+ },
255
+ imageSupport: n
256
+ }), G[e.value] && G[e.value] > 1 && /* @__PURE__ */ c(O, { children: "Value should be unique" })] })
257
+ ] }, `choice-${t}`))
258
+ ]
259
+ });
260
+ }, V = class extends a.Component {
261
+ static propTypes = {
262
+ model: o.object.isRequired,
263
+ disableSidePanel: o.bool,
264
+ onModelChanged: o.func.isRequired,
265
+ onConfigurationChanged: o.func.isRequired,
266
+ imageSupport: o.shape({
267
+ add: o.func.isRequired,
268
+ delete: o.func.isRequired
269
+ })
270
+ };
271
+ onChoiceChanged = (t, n) => {
272
+ let { model: r, onModelChanged: i } = this.props;
273
+ r.choices = r.choices.map((t) => e({}, t)), r.choices.splice(t, 1, n), i(r);
274
+ };
275
+ onPromptChanged = (e) => {
276
+ this.props.onModelChanged({
277
+ ...this.props.model,
278
+ prompt: e
279
+ });
280
+ };
281
+ onTeacherInstructionsChanged = (e) => {
282
+ this.props.onModelChanged({
283
+ ...this.props.model,
284
+ teacherInstructions: e
285
+ });
286
+ };
287
+ render() {
288
+ return /* @__PURE__ */ c(B, {
289
+ ...this.props,
290
+ onChangeModel: this.props.onModelChanged,
291
+ onChoiceChanged: this.onChoiceChanged,
292
+ onPromptChanged: this.onPromptChanged,
293
+ onTeacherInstructionsChanged: this.onTeacherInstructionsChanged
294
+ });
295
+ }
296
+ };
297
+ //#endregion
298
+ export { V as default };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/controller/src/defaults.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const _default: {
10
+ choices: never[];
11
+ likertOrientation: string;
12
+ likertScale: string;
13
+ likertType: string;
14
+ prompt: string;
15
+ promptEnabled: boolean;
16
+ teacherInstructions: string;
17
+ teacherInstructionsEnabled: boolean;
18
+ };
19
+ export default _default;
@@ -0,0 +1,13 @@
1
+ //#region src/controller/defaults.ts
2
+ var e = {
3
+ choices: [],
4
+ likertOrientation: "horizontal",
5
+ likertScale: "likert3",
6
+ likertType: "agreement",
7
+ prompt: "",
8
+ promptEnabled: !0,
9
+ teacherInstructions: "",
10
+ teacherInstructionsEnabled: !0
11
+ };
12
+ //#endregion
13
+ export { e as default };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/controller/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare function createDefaultModel(model?: {}): Promise<unknown>;
10
+ export declare const normalize: (question: any) => any;
11
+ /**
12
+ *
13
+ * @param {*} question
14
+ * @param {*} session
15
+ * @param {*} env
16
+ */
17
+ export declare function model(question: any, session: any, env: any): Promise<any>;
18
+ export declare function outcome(): Promise<unknown>;
19
+ export declare const validate: (model?: {}, config?: {}) => {};
@@ -0,0 +1,41 @@
1
+ import e from "./defaults.js";
2
+ //#region src/controller/index.ts
3
+ var t = (e) => ({
4
+ label: e.label,
5
+ value: e.value
6
+ });
7
+ function n(t = {}) {
8
+ return new Promise((n) => n({
9
+ ...e,
10
+ ...t
11
+ }));
12
+ }
13
+ var r = (t) => ({
14
+ ...e,
15
+ ...t
16
+ });
17
+ async function i(e, n, i) {
18
+ let a = r(e), o = a.choices.map(t), s = {
19
+ ...a,
20
+ choices: o,
21
+ disabled: i.mode !== "gather",
22
+ mode: i.mode
23
+ }, { role: c, mode: l } = i || {};
24
+ return c === "instructor" && (l === "view" || l === "evaluate") ? s.teacherInstructions = a.teacherInstructionsEnabled ? a.teacherInstructions : null : s.teacherInstructions = null, s;
25
+ }
26
+ function a() {
27
+ return new Promise((e) => {
28
+ e({
29
+ score: 0,
30
+ empty: !1
31
+ });
32
+ });
33
+ }
34
+ var o = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), s = (e = {}, t = {}) => {
35
+ let n = {};
36
+ return ["teacherInstructions", "prompt"].forEach((r) => {
37
+ t[r]?.required && !o(e[r]) && (n[r] = "This field is required.");
38
+ }), n;
39
+ };
40
+ //#endregion
41
+ export { n as createDefaultModel, i as model, r as normalize, a as outcome, s as validate };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/src/choice-input.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare const RadioStyled: any;
12
+ export declare class ChoiceInput extends React.Component {
13
+ static propTypes: {
14
+ checked: PropTypes.Validator<boolean>;
15
+ disabled: PropTypes.Validator<boolean>;
16
+ label: PropTypes.Validator<string>;
17
+ likertOrientation: PropTypes.Validator<string>;
18
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
19
+ value: PropTypes.Validator<number>;
20
+ };
21
+ static defaultProps: {
22
+ checked: boolean;
23
+ };
24
+ onToggleChoice: any;
25
+ render(): React.JSX.Element;
26
+ }
27
+ export default ChoiceInput;
@@ -0,0 +1,59 @@
1
+ import { LIKERT_ORIENTATION as e } from "./likertEntities.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { color as r } from "@pie-lib/render-ui";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import o from "@mui/material/FormControlLabel";
7
+ import { styled as s } from "@mui/material/styles";
8
+ import c from "@mui/material/Radio";
9
+ //#region src/delivery/choice-input.tsx
10
+ var l = s(c)({
11
+ color: `var(--choice-input-color, ${r.text()})`,
12
+ "&.Mui-checked": { color: `var(--choice-input-selected-color, ${r.primary()})` },
13
+ "&.Mui-disabled": { color: `var(--choice-input-disabled-color, ${r.defaults.DISABLED})` }
14
+ }), u = s("p")({
15
+ color: r.text(),
16
+ textAlign: "center",
17
+ cursor: "pointer"
18
+ }), d = s("div")({
19
+ display: "flex",
20
+ alignItems: "center",
21
+ flex: 1,
22
+ padding: "0 5px",
23
+ "& label": {}
24
+ }), f = s(o)({ margin: 0 }), p = class extends t.Component {
25
+ static propTypes = {
26
+ checked: n.bool.isRequired,
27
+ disabled: n.bool.isRequired,
28
+ label: n.string.isRequired,
29
+ likertOrientation: n.string.isRequired,
30
+ onChange: n.func.isRequired,
31
+ value: n.number.isRequired
32
+ };
33
+ static defaultProps = { checked: !1 };
34
+ onToggleChoice = () => {
35
+ this.props.onChange({
36
+ value: this.props.value,
37
+ selected: !this.props.checked
38
+ });
39
+ };
40
+ render() {
41
+ let { disabled: t, label: n, checked: r, likertOrientation: o } = this.props;
42
+ return /* @__PURE__ */ a(d, {
43
+ style: { flexDirection: o === e.vertical ? "row" : "column" },
44
+ children: [/* @__PURE__ */ i(f, {
45
+ disabled: t,
46
+ control: /* @__PURE__ */ i(l, {
47
+ checked: r,
48
+ onChange: this.onToggleChoice,
49
+ disabled: t
50
+ })
51
+ }), /* @__PURE__ */ i(u, {
52
+ onClick: this.onToggleChoice,
53
+ dangerouslySetInnerHTML: { __html: n }
54
+ })]
55
+ });
56
+ }
57
+ };
58
+ //#endregion
59
+ export { p as default };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare const isComplete: (session: any) => boolean;
10
+ export default class Likert extends HTMLElement {
11
+ constructor();
12
+ set model(m: any);
13
+ set session(s: any);
14
+ get session(): any;
15
+ sessionChanged(s: any): void;
16
+ connectedCallback(): void;
17
+ _render(): void;
18
+ disconnectedCallback(): void;
19
+ }
@@ -0,0 +1,44 @@
1
+ import e from "./main.js";
2
+ import t from "react";
3
+ import { createRoot as n } from "react-dom/client";
4
+ import { SessionChangedEvent as r } from "@pie-element/shared-player-events";
5
+ import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
6
+ //#region src/delivery/index.ts
7
+ var a = (e) => !!(e && e.value && e.value.length), o = class extends HTMLElement {
8
+ constructor() {
9
+ super(), this._root = null;
10
+ }
11
+ set model(e) {
12
+ this._model = e, this._render();
13
+ }
14
+ set session(e) {
15
+ this._session = e, this._render();
16
+ }
17
+ get session() {
18
+ return this._session;
19
+ }
20
+ sessionChanged(e) {
21
+ this._session.value = e.value;
22
+ let t = a(this._session, this._model);
23
+ this.dispatchEvent(new r(this.tagName.toLowerCase(), t)), this._render();
24
+ }
25
+ connectedCallback() {
26
+ this._render();
27
+ }
28
+ _render() {
29
+ if (!this._model || !this._session) return;
30
+ let r = t.createElement(e, {
31
+ model: this._model,
32
+ session: this._session,
33
+ onSessionChange: this.sessionChanged.bind(this)
34
+ });
35
+ this._root ||= n(this), this._root.render(r), queueMicrotask(() => {
36
+ i(this);
37
+ });
38
+ }
39
+ disconnectedCallback() {
40
+ this._root && this._root.unmount();
41
+ }
42
+ };
43
+ //#endregion
44
+ export { o as default, a as isComplete };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/src/likert.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Likert extends React.Component {
12
+ static propTypes: {
13
+ className: PropTypes.Requireable<string>;
14
+ choices: PropTypes.Requireable<any[]>;
15
+ prompt: PropTypes.Requireable<string>;
16
+ teacherInstructions: PropTypes.Requireable<string>;
17
+ session: PropTypes.Requireable<object>;
18
+ disabled: PropTypes.Validator<boolean>;
19
+ onSessionChange: PropTypes.Validator<(...args: any[]) => any>;
20
+ likertOrientation: PropTypes.Validator<string>;
21
+ };
22
+ UNSAFE_componentWillReceiveProps(): void;
23
+ isSelected(value: any): any;
24
+ render(): React.JSX.Element;
25
+ }
26
+ export default Likert;
@@ -0,0 +1,70 @@
1
+ import { LIKERT_ORIENTATION as e } from "./likertEntities.js";
2
+ import t from "./choice-input.js";
3
+ import n from "react";
4
+ import r from "prop-types";
5
+ import * as i from "@pie-lib/render-ui";
6
+ import { Collapsible as a, PreviewPrompt as o, color as s } from "@pie-lib/render-ui";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { styled as u } from "@mui/material/styles";
9
+ //#region src/delivery/likert.tsx
10
+ function d(e) {
11
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
12
+ }
13
+ function f(e, t) {
14
+ return !e || d(e) ? e : d(e.default) ? e.default : t && d(e[t]) ? e[t] : t && d(e[t]?.default) ? e[t].default : e;
15
+ }
16
+ var p = f(o, "PreviewPrompt") || f(_.PreviewPrompt, "PreviewPrompt"), m = f(a, "Collapsible") || f(_.Collapsible, "Collapsible"), h = i, g = h.default, _ = g && typeof g == "object" ? g : h, v = u("div")({
17
+ color: s.text(),
18
+ backgroundColor: s.background(),
19
+ "& *": { "-webkit-font-smoothing": "antialiased" }
20
+ }), y = u(m)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), b = u("div")(({ theme: e }) => ({
21
+ verticalAlign: "middle",
22
+ color: "var(--pie-primary-text, var(--pie-text, #000000))",
23
+ paddingBottom: e.spacing(2)
24
+ })), x = u("div")({ display: "flex" }), S = class extends n.Component {
25
+ static propTypes = {
26
+ className: r.string,
27
+ choices: r.array,
28
+ prompt: r.string,
29
+ teacherInstructions: r.string,
30
+ session: r.object,
31
+ disabled: r.bool.isRequired,
32
+ onSessionChange: r.func.isRequired,
33
+ likertOrientation: r.string.isRequired
34
+ };
35
+ UNSAFE_componentWillReceiveProps() {}
36
+ isSelected(e) {
37
+ return this.props.session && this.props.session.value === e;
38
+ }
39
+ render() {
40
+ let { disabled: n, choices: r = [], prompt: i, onSessionChange: a, teacherInstructions: o, className: s, likertOrientation: u } = this.props, d = u === e.vertical ? "column" : "row";
41
+ return /* @__PURE__ */ l(v, {
42
+ className: s,
43
+ children: [
44
+ o && /* @__PURE__ */ c(y, {
45
+ labels: {
46
+ hidden: "Show Teacher Instructions",
47
+ visible: "Hide Teacher Instructions"
48
+ },
49
+ children: /* @__PURE__ */ c(p, { prompt: o })
50
+ }),
51
+ i && /* @__PURE__ */ c(b, { children: /* @__PURE__ */ c(p, { prompt: i }) }),
52
+ /* @__PURE__ */ c(x, {
53
+ style: { flexDirection: d },
54
+ children: r.map((e, r) => /* @__PURE__ */ c(t, {
55
+ label: e.label,
56
+ value: e.value,
57
+ index: r,
58
+ disabled: n,
59
+ onChange: a,
60
+ likertOrientation: u,
61
+ checked: this.isSelected(e.value)
62
+ }, `choice-${r}`))
63
+ })
64
+ ]
65
+ });
66
+ }
67
+ };
68
+ S.defaultProps = { session: { value: [] } };
69
+ //#endregion
70
+ export { S as default };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/src/likertEntities.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare const LIKERT_ORIENTATION: {
10
+ horizontal: string;
11
+ vertical: string;
12
+ };
@@ -0,0 +1,7 @@
1
+ //#region src/delivery/likertEntities.ts
2
+ var e = {
3
+ horizontal: "horizontal",
4
+ vertical: "vertical"
5
+ };
6
+ //#endregion
7
+ export { e as LIKERT_ORIENTATION };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/likert/src/main.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ declare class Main extends React.Component {
12
+ static propTypes: {
13
+ model: PropTypes.Requireable<object>;
14
+ session: PropTypes.Requireable<object>;
15
+ onSessionChange: PropTypes.Requireable<(...args: any[]) => any>;
16
+ };
17
+ static defaultProps: {
18
+ model: {};
19
+ session: {};
20
+ };
21
+ render(): React.JSX.Element;
22
+ }
23
+ export default Main;