@pie-element/ebsr 0.1.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 (185) hide show
  1. package/dist/author/defaults.d.ts +67 -0
  2. package/dist/author/defaults.d.ts.map +1 -0
  3. package/dist/author/defaults.js +161 -0
  4. package/dist/author/index.d.ts +35 -0
  5. package/dist/author/index.d.ts.map +1 -0
  6. package/dist/author/index.js +78 -0
  7. package/dist/author/main.d.ts +23 -0
  8. package/dist/author/main.d.ts.map +1 -0
  9. package/dist/author/main.js +121 -0
  10. package/dist/controller/defaults.d.ts +16 -0
  11. package/dist/controller/defaults.d.ts.map +1 -0
  12. package/dist/controller/defaults.js +26 -0
  13. package/dist/controller/index.d.ts +43 -0
  14. package/dist/controller/index.d.ts.map +1 -0
  15. package/dist/controller/index.js +186 -0
  16. package/dist/controller/utils.d.ts +11 -0
  17. package/dist/controller/utils.d.ts.map +1 -0
  18. package/dist/controller/utils.js +8 -0
  19. package/dist/delivery/index.d.ts +25 -0
  20. package/dist/delivery/index.d.ts.map +1 -0
  21. package/dist/delivery/index.js +95 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.iife.d.ts +9 -0
  25. package/dist/index.iife.d.ts.map +1 -0
  26. package/dist/index.iife.js +165 -0
  27. package/dist/index.js +2 -0
  28. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  29. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  30. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  31. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  32. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  33. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  34. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  35. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
  36. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  37. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  38. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  39. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  40. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  41. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  42. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  43. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  44. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
  45. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  46. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
  47. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  48. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  49. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  50. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  51. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  52. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  53. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  54. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
  55. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  56. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  57. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  58. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
  59. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  60. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  61. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  62. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  63. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  64. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  65. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  66. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  67. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  68. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  69. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
  70. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  71. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
  72. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
  73. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  74. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  75. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  76. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  77. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  79. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  80. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  81. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  83. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  84. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  85. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
  86. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
  87. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
  88. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  89. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  90. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  91. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  92. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  93. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  94. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  95. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  96. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  97. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  98. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  99. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  100. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  101. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  102. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  103. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  104. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  105. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  106. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  107. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  108. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
  172. package/dist/print/index.d.ts +25 -0
  173. package/dist/print/index.d.ts.map +1 -0
  174. package/dist/print/index.js +104 -0
  175. package/package.json +70 -0
  176. package/src/author/defaults.ts +183 -0
  177. package/src/author/index.ts +184 -0
  178. package/src/author/main.tsx +245 -0
  179. package/src/controller/defaults.ts +35 -0
  180. package/src/controller/index.ts +452 -0
  181. package/src/controller/utils.ts +28 -0
  182. package/src/delivery/index.tsx +167 -0
  183. package/src/index.iife.ts +16 -0
  184. package/src/index.ts +1 -0
  185. package/src/print/index.tsx +213 -0
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@pie-element/ebsr",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "dependencies": {
6
+ "@pie-element/multiple-choice": "0.1.0",
7
+ "@pie-lib/translator": "0.1.0",
8
+ "classnames": "^2.2.5",
9
+ "debug": "^4.1.1",
10
+ "lodash-es": "^4.17.23",
11
+ "@pie-element/shared-configure-events": "0.1.0",
12
+ "@pie-lib/config-ui": "0.1.0",
13
+ "@pie-element/shared-controller-utils": "0.1.0",
14
+ "@pie-element/shared-player-events": "0.1.0",
15
+ "@mui/material": "^7.3.4",
16
+ "prop-types": "^15.6.1"
17
+ },
18
+ "peerDependencies": {
19
+ "react": "^18.0.0",
20
+ "react-dom": "^18.0.0"
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "development": "./src/index.ts",
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./delivery": {
29
+ "development": "./src/delivery/index.tsx",
30
+ "types": "./dist/delivery/index.d.ts",
31
+ "default": "./dist/delivery/index.js"
32
+ },
33
+ "./author": {
34
+ "development": "./src/author/index.ts",
35
+ "types": "./dist/author/index.d.ts",
36
+ "default": "./dist/author/index.js"
37
+ },
38
+ "./controller": {
39
+ "development": "./src/controller/index.ts",
40
+ "types": "./dist/controller/index.d.ts",
41
+ "default": "./dist/controller/index.js"
42
+ },
43
+ "./print": {
44
+ "development": "./src/print/index.tsx",
45
+ "types": "./dist/print/index.d.ts",
46
+ "default": "./dist/print/index.js"
47
+ }
48
+ },
49
+ "type": "module",
50
+ "main": "./dist/index.js",
51
+ "types": "./dist/index.d.ts",
52
+ "files": [
53
+ "dist",
54
+ "src"
55
+ ],
56
+ "sideEffects": false,
57
+ "devDependencies": {
58
+ "vite": "^8.0.1",
59
+ "typescript": "^5.9.3",
60
+ "@vitejs/plugin-react": "^6.0.1",
61
+ "@types/react": "^18.2.0",
62
+ "@types/react-dom": "^18.2.0"
63
+ },
64
+ "scripts": {
65
+ "build": "bun x vite build && bun x vite build --config vite.config.iife.ts && bun x tsc --emitDeclarationOnly",
66
+ "dev": "bun x vite",
67
+ "demo": "bun x vite --mode demo",
68
+ "test": "bun x vitest run"
69
+ }
70
+ }
@@ -0,0 +1,183 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/ebsr/configure/src/defaults.js
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import { cloneDeep } from 'lodash-es';
12
+
13
+ const defaultConfig = {
14
+ addChoiceButton: {
15
+ settings: true,
16
+ label: 'Add a Choice',
17
+ },
18
+ choiceMode: {
19
+ settings: true,
20
+ label: 'Response Type',
21
+ },
22
+ choicePrefix: {
23
+ settings: true,
24
+ label: 'Choice Labels',
25
+ },
26
+ deleteChoice: {
27
+ settings: true,
28
+ },
29
+ feedback: {
30
+ settings: true,
31
+ label: 'Feedback',
32
+ },
33
+ lockChoiceOrder: {
34
+ settings: true,
35
+ label: 'Lock Choice Order',
36
+ },
37
+ prompt: {
38
+ settings: true,
39
+ label: 'Prompt',
40
+ inputConfiguration: {
41
+ audio: { disabled: false },
42
+ video: { disabled: false },
43
+ image: { disabled: false },
44
+ },
45
+ required: false,
46
+ },
47
+ rationale: {
48
+ settings: true,
49
+ label: 'Rationale',
50
+ inputConfiguration: {
51
+ audio: { disabled: false },
52
+ video: { disabled: false },
53
+ image: { disabled: false },
54
+ },
55
+ required: false,
56
+ },
57
+ settingsPanelDisabled: true,
58
+ studentInstructions: {
59
+ settings: false,
60
+ label: 'Student Instructions',
61
+ },
62
+ teacherInstructions: {
63
+ settings: true,
64
+ label: 'Teacher Instructions',
65
+ inputConfiguration: {
66
+ audio: { disabled: false },
67
+ video: { disabled: false },
68
+ image: { disabled: false },
69
+ },
70
+ required: false,
71
+ },
72
+ choicesLayout: {
73
+ settings: false,
74
+ label: 'Choices Layout',
75
+ },
76
+ gridColumns: {
77
+ label: 'Grid columns',
78
+ },
79
+ spellCheck: {
80
+ label: 'Spellcheck',
81
+ settings: false,
82
+ enabled: true,
83
+ },
84
+ maxImageWidth: {
85
+ teacherInstructions: 300,
86
+ prompt: 300,
87
+ rationale: 636,
88
+ choices: 636,
89
+ },
90
+ maxImageHeight: {
91
+ teacherInstructions: 300,
92
+ prompt: 300,
93
+ rationale: 300,
94
+ choices: 300,
95
+ },
96
+ mathMlOptions: {
97
+ mmlOutput: false,
98
+ mmlEditing: false,
99
+ },
100
+ choices: {
101
+ inputConfiguration: {
102
+ audio: { disabled: false },
103
+ video: { disabled: false },
104
+ image: { disabled: false },
105
+ },
106
+ },
107
+ baseInputConfiguration: {
108
+ h3: { disabled: true },
109
+ audio: { disabled: false },
110
+ video: { disabled: false },
111
+ image: { disabled: false },
112
+ textAlign: { disabled: true },
113
+ showParagraphs: { disabled: false },
114
+ separateParagraphs: { disabled: true },
115
+ },
116
+ };
117
+
118
+ const partModel = (base) => ({
119
+ choiceMode: 'radio',
120
+ choicePrefix: 'letters',
121
+ choices: [],
122
+ choicesLayout: 'vertical',
123
+ feedbackEnabled: false,
124
+ gridColumns: 2,
125
+ prompt: '',
126
+ promptEnabled: true,
127
+ rationale: '',
128
+ rationaleEnabled: true,
129
+ spellCheckEnabled: true,
130
+ studentInstructionsEnabled: true,
131
+ teacherInstructions: '',
132
+ teacherInstructionsEnabled: true,
133
+ toolbarEditorPosition: 'bottom',
134
+ ...base,
135
+ });
136
+
137
+ export default {
138
+ model: {
139
+ partLabels: true,
140
+ partLabelType: 'Letters',
141
+ // partialScoring: false,
142
+ partA: partModel(),
143
+ partB: partModel(),
144
+ },
145
+ configuration: {
146
+ baseInputConfiguration: {
147
+ h3: { disabled: true },
148
+ audio: { disabled: false },
149
+ video: { disabled: false },
150
+ image: { disabled: false },
151
+ textAlign: { disabled: true },
152
+ showParagraphs: { disabled: false },
153
+ separateParagraphs: { disabled: true },
154
+ },
155
+ partialScoring: {
156
+ label: 'Allow Partial Scoring',
157
+ // this will turn off partial scoring toggle in the settings tab by default for the interaction
158
+ // as we'd like partial scoring to be controlled from the environment entirely
159
+ // if any other consumers would like to enable it for themselves, they can do so from their model directly.
160
+ settings: false,
161
+ },
162
+ scoringType: {
163
+ settings: false,
164
+ label: 'Scoring Type',
165
+ },
166
+ partA: cloneDeep(defaultConfig),
167
+ partB: cloneDeep(defaultConfig),
168
+ partLabels: {
169
+ settings: true,
170
+ label: 'Part Labels',
171
+ },
172
+ settingsPanelDisabled: false,
173
+ language: {
174
+ settings: false,
175
+ label: 'Specify Language',
176
+ enabled: false,
177
+ },
178
+ languageChoices: {
179
+ label: 'Language Choices',
180
+ options: [],
181
+ },
182
+ },
183
+ };
@@ -0,0 +1,184 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/ebsr/configure/src/index.js
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import React from 'react';
12
+ import { createRoot } from 'react-dom/client';
13
+ import { ModelUpdatedEvent } from '@pie-element/shared-configure-events';
14
+ import MultipleChoiceConfigure from '@pie-element/multiple-choice/author';
15
+ import { defaults } from 'lodash-es';
16
+ import Main from './main.js';
17
+
18
+ import sensibleDefaults from './defaults.js';
19
+
20
+ const MODEL_UPDATED = ModelUpdatedEvent.TYPE;
21
+ const MC_TAG_NAME = 'ebsr-multiple-choice-configure';
22
+
23
+ class EbsrMCConfigure extends MultipleChoiceConfigure {}
24
+ const defineMultipleChoice = () => {
25
+ if (!customElements.get(MC_TAG_NAME)) {
26
+ customElements.define(MC_TAG_NAME, EbsrMCConfigure);
27
+ }
28
+ };
29
+
30
+ defineMultipleChoice();
31
+
32
+ const prepareCustomizationObject = (config, model) => {
33
+ const configuration = defaults(config, sensibleDefaults.configuration);
34
+
35
+ return {
36
+ configuration,
37
+ model,
38
+ };
39
+ };
40
+
41
+ const { model: modelDefault } = sensibleDefaults || {};
42
+
43
+ export default class EbsrConfigure extends HTMLElement {
44
+ static createDefaultModel = ({ partA = {}, partB = {}, ...model } = {}, defaults = modelDefault) => ({
45
+ ...defaults,
46
+ ...model,
47
+ partA: {
48
+ ...defaults.partA,
49
+ ...partA,
50
+ choicesLayout:
51
+ partA.choicesLayout || (partA.verticalMode === false && 'horizontal') || defaults.partA.choicesLayout,
52
+ },
53
+ partB: {
54
+ ...defaults.partB,
55
+ ...partB,
56
+ choicesLayout:
57
+ partB.choicesLayout || (partB.verticalMode === false && 'horizontal') || defaults.partB.choicesLayout,
58
+ },
59
+ });
60
+
61
+ constructor() {
62
+ super();
63
+ this._root = null;
64
+
65
+ this._model = EbsrConfigure.createDefaultModel();
66
+
67
+ this._configuration = sensibleDefaults.configuration;
68
+ this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
69
+ }
70
+
71
+ set model(m) {
72
+ this._model = EbsrConfigure.createDefaultModel(m, this._model);
73
+
74
+ this._render();
75
+ }
76
+
77
+ dispatchModelUpdated(reset) {
78
+ const resetValue = !!reset;
79
+
80
+ this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));
81
+ }
82
+
83
+ onModelChanged: any = (m, reset) => {
84
+ this._model = EbsrConfigure.createDefaultModel(m, this._model);
85
+
86
+ this.dispatchModelUpdated(reset);
87
+ this._render();
88
+ };
89
+
90
+ set configuration(c) {
91
+ const info = prepareCustomizationObject(c, this._model);
92
+
93
+ const newConfiguration = {
94
+ ...sensibleDefaults.configuration,
95
+ ...info.configuration,
96
+ };
97
+
98
+ this._configuration = newConfiguration;
99
+
100
+ // if language:enabled is true, then the corresponding default item model should include a language value;
101
+ // if it is false, then the language field should be omitted from the item model.
102
+ // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
103
+ // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
104
+ if (newConfiguration?.language?.enabled) {
105
+ if (newConfiguration?.languageChoices?.options?.length) {
106
+ this._model.language = newConfiguration?.languageChoices.options[0].value;
107
+ }
108
+ } else if (newConfiguration.language.settings && this._model.language) {
109
+ this._configuration.language.enabled = true;
110
+
111
+ if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
112
+ this._configuration.languageChoices.options = [];
113
+ }
114
+
115
+ // check if the language is already included in the languageChoices.options array
116
+ // and if not, then add it.
117
+ if (!this._configuration.languageChoices.options.find((option) => option.value === this._model.language)) {
118
+ this._configuration.languageChoices.options.push({
119
+ value: this._model.language,
120
+ label: this._model.language,
121
+ });
122
+ }
123
+ } else {
124
+ delete this._model.language;
125
+ }
126
+
127
+ this._render();
128
+ }
129
+
130
+ onConfigurationChanged(c) {
131
+ this._configuration = prepareCustomizationObject(c, this._model).configuration;
132
+
133
+ if (this._model) {
134
+ this.onModelChanged(this._model);
135
+ }
136
+
137
+ this._render();
138
+ }
139
+
140
+ onModelUpdated: any = (e) => {
141
+ if (e.target === this) {
142
+ return;
143
+ }
144
+
145
+ e.preventDefault();
146
+ e.stopImmediatePropagation();
147
+
148
+ const id = e.target && e.target.getAttribute('id');
149
+
150
+ if (id) {
151
+ if (e.update) {
152
+ this._model[`part${id}`] = e.update;
153
+ }
154
+
155
+ this.dispatchEvent(new ModelUpdatedEvent(this._model));
156
+ }
157
+ };
158
+
159
+ connectedCallback() {
160
+ this.addEventListener(MODEL_UPDATED, this.onModelUpdated);
161
+ this._render();
162
+ }
163
+
164
+ _render() {
165
+ let element = React.createElement(Main, {
166
+ model: this._model,
167
+ configuration: this._configuration,
168
+ onModelChanged: this.onModelChanged,
169
+ onConfigurationChanged: this.onConfigurationChanged,
170
+ });
171
+
172
+ if (!this._root) {
173
+ this._root = createRoot(this);
174
+ }
175
+ this._root.render(element);
176
+ }
177
+
178
+ disconnectedCallback() {
179
+ this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);
180
+ if (this._root) {
181
+ this._root.unmount();
182
+ }
183
+ }
184
+ }
@@ -0,0 +1,245 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/ebsr/configure/src/main.jsx
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import React from 'react';
12
+ import PropTypes from 'prop-types';
13
+ import { settings, layout } from '@pie-lib/config-ui';
14
+ import { styled } from '@mui/material/styles';
15
+
16
+ const { Panel, toggle, radio, dropdown } = settings;
17
+
18
+ const PartLabel: any = styled('div')(({ theme }) => ({
19
+ paddingBottom: theme.spacing(2),
20
+ }));
21
+
22
+ const Divider: any = styled('div')(({ theme }) => ({
23
+ flex: 1,
24
+ height: theme.spacing(2.5),
25
+ }));
26
+
27
+ export class Main extends React.Component {
28
+ static propTypes = {
29
+ configuration: PropTypes.object,
30
+ model: PropTypes.object,
31
+ onModelChanged: PropTypes.func,
32
+ onConfigurationChanged: PropTypes.func,
33
+ };
34
+
35
+ removeExtraChoices: any = (choices) => {
36
+ let correctFound = false;
37
+
38
+ return (choices || []).map((choice) => {
39
+ if (correctFound) {
40
+ choice.correct = false;
41
+
42
+ return choice;
43
+ }
44
+
45
+ if (choice.correct) {
46
+ correctFound = true;
47
+ }
48
+
49
+ return choice;
50
+ });
51
+ };
52
+
53
+ onModelChanged: any = (model, key) => {
54
+ const { onModelChanged } = this.props;
55
+
56
+ if (key === 'partA.choiceMode' && model.partA.choiceMode === 'radio') {
57
+ model.partA.choices = this.removeExtraChoices(model.partA.choices);
58
+
59
+ return onModelChanged(model, true);
60
+ }
61
+
62
+ if (key === 'partB.choiceMode' && model.partB.choiceMode === 'radio') {
63
+ model.partB.choices = this.removeExtraChoices(model.partB.choices);
64
+
65
+ return onModelChanged(model, true);
66
+ }
67
+
68
+ return onModelChanged(model);
69
+ };
70
+
71
+ render() {
72
+ const { model, configuration, onConfigurationChanged } = this.props;
73
+ const { partLabelType, partA: modelPartA, partB: modelPartB, extraCSSRules } = model;
74
+ const {
75
+ contentDimensions = {},
76
+ partA = {},
77
+ partB = {},
78
+ partialScoring = {},
79
+ settingsPanelDisabled,
80
+ scoringType = {},
81
+ language = {},
82
+ languageChoices = {},
83
+ ...generalConfiguration
84
+ } = configuration;
85
+ const {
86
+ feedback: feedbackA = {},
87
+ choiceMode: choiceModeA = {},
88
+ choicePrefix: choicePrefixA = {},
89
+ lockChoiceOrder: lockChoiceOrderA = {},
90
+ prompt: promptA = {},
91
+ teacherInstructions: teacherInstructionsA = {},
92
+ studentInstructions: studentInstructionsA = {},
93
+ choicesLayout: choicesLayoutA = {},
94
+ gridColumns: gridColumnsA = {},
95
+ rationale: rationaleA = {},
96
+ spellCheck: spellCheckA = {},
97
+ } = partA || {};
98
+ const {
99
+ feedback: feedbackB = {},
100
+ choiceMode: choiceModeB = {},
101
+ choicePrefix: choicePrefixB = {},
102
+ lockChoiceOrder: lockChoiceOrderB = {},
103
+ prompt: promptB = {},
104
+ teacherInstructions: teacherInstructionsB = {},
105
+ studentInstructions: studentInstructionsB = {},
106
+ choicesLayout: choicesLayoutB = {},
107
+ gridColumns: gridColumnsB = {},
108
+ rationale: rationaleB = {},
109
+ spellCheck: spellCheckB = {},
110
+ } = partB || {};
111
+
112
+ const type = partLabelType || 'Numbers';
113
+ const typeIsNumber = type === 'Numbers';
114
+ const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;
115
+ const secondPart = `Part ${typeIsNumber ? '2' : 'B'}`;
116
+ const nrOfColumnsAvailable = {
117
+ partA:
118
+ modelPartA.choices && modelPartA.choices.length
119
+ ? Array.from({ length: modelPartA.choices.length }, (_, i) => `${i + 1}`)
120
+ : [],
121
+ partB:
122
+ modelPartB.choices && modelPartB.choices.length
123
+ ? Array.from({ length: modelPartB.choices.length }, (_, i) => `${i + 1}`)
124
+ : [],
125
+ };
126
+
127
+ const panelSettings = {
128
+ partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),
129
+ partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),
130
+ partialScoring: partialScoring.settings && toggle(partialScoring.label),
131
+ scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
132
+ 'language.enabled': language.settings && toggle(language.label, true),
133
+ language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
134
+ };
135
+
136
+ const panelSettingsPartA = {
137
+ 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),
138
+ 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),
139
+ 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),
140
+ 'partA.choicesLayout':
141
+ choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),
142
+ 'partA.gridColumns':
143
+ choicesLayoutA.settings &&
144
+ modelPartA.choicesLayout === 'grid' &&
145
+ nrOfColumnsAvailable.partA.length > 0 &&
146
+ dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),
147
+ };
148
+ const panelPropertiesPartA = {
149
+ 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),
150
+ 'partA.promptEnabled': promptA.settings && toggle(promptA.label),
151
+ 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
152
+ 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
153
+ 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
154
+ 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),
155
+ };
156
+
157
+ const panelSettingsPartB = {
158
+ 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
159
+ 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
160
+ 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
161
+ 'partB.choicesLayout':
162
+ choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
163
+ 'partB.gridColumns':
164
+ choicesLayoutB.settings &&
165
+ modelPartB.choicesLayout === 'grid' &&
166
+ nrOfColumnsAvailable.partB.length > 0 &&
167
+ dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),
168
+ };
169
+ const panelPropertiesPartB = {
170
+ 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
171
+ 'partB.promptEnabled': promptB.settings && toggle(promptB.label),
172
+ 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
173
+ 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
174
+ 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
175
+ 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label),
176
+ };
177
+
178
+ return (
179
+ <layout.ConfigLayout
180
+ extraCSSRules={extraCSSRules}
181
+ dimensions={contentDimensions}
182
+ hideSettings={settingsPanelDisabled}
183
+ settings={
184
+ <Panel
185
+ model={model}
186
+ onChangeModel={this.onModelChanged}
187
+ configuration={configuration}
188
+ onChangeConfiguration={onConfigurationChanged}
189
+ groups={{
190
+ 'Settings for both': panelSettings,
191
+ [`Settings ${firstPart}`]: panelSettingsPartA,
192
+ [`Properties ${firstPart}`]: panelPropertiesPartA,
193
+ [`Settings ${secondPart}`]: panelSettingsPartB,
194
+ [`Properties ${secondPart}`]: panelPropertiesPartB,
195
+ }}
196
+ />
197
+ }
198
+ >
199
+ {model.partLabels && <PartLabel>{firstPart}</PartLabel>}
200
+ <ebsr-multiple-choice-configure
201
+ id="A"
202
+ key="partA"
203
+ ref={(ref) => {
204
+ if (ref) {
205
+ // do not use destructuring to get model from props
206
+ this.partA = ref;
207
+ this.partA._model = {
208
+ ...this.props.model.partA,
209
+ errors: (this.props.model.errors && this.props.model.errors.partA) || {},
210
+ };
211
+ this.partA.configuration = {
212
+ ...partA,
213
+ ...generalConfiguration,
214
+ };
215
+ }
216
+ }}
217
+ />
218
+
219
+ <Divider />
220
+
221
+ {model.partLabels && <PartLabel>{secondPart}</PartLabel>}
222
+ <ebsr-multiple-choice-configure
223
+ id="B"
224
+ key="partB"
225
+ ref={(ref) => {
226
+ if (ref) {
227
+ // do not use destructuring to get model from props
228
+ this.partB = ref;
229
+ this.partB._model = {
230
+ ...this.props.model.partB,
231
+ errors: (this.props.model.errors && this.props.model.errors.partB) || {},
232
+ };
233
+ this.partB.configuration = {
234
+ ...partB,
235
+ ...generalConfiguration,
236
+ };
237
+ }
238
+ }}
239
+ />
240
+ </layout.ConfigLayout>
241
+ );
242
+ }
243
+ }
244
+
245
+ export default Main;