@pie-element/math-templated 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 (214) hide show
  1. package/dist/author/defaults.d.ts +174 -0
  2. package/dist/author/defaults.d.ts.map +1 -0
  3. package/dist/author/defaults.js +123 -0
  4. package/dist/author/design.d.ts +36 -0
  5. package/dist/author/design.d.ts.map +1 -0
  6. package/dist/author/design.js +494 -0
  7. package/dist/author/index.d.ts +43 -0
  8. package/dist/author/index.d.ts.map +1 -0
  9. package/dist/author/index.js +98 -0
  10. package/dist/author/markupUtils.d.ts +12 -0
  11. package/dist/author/markupUtils.d.ts.map +1 -0
  12. package/dist/author/markupUtils.js +10 -0
  13. package/dist/author/response.d.ts +42 -0
  14. package/dist/author/response.d.ts.map +1 -0
  15. package/dist/author/response.js +342 -0
  16. package/dist/author/utils.d.ts +10 -0
  17. package/dist/author/utils.d.ts.map +1 -0
  18. package/dist/author/utils.js +7 -0
  19. package/dist/controller/defaults.d.ts +30 -0
  20. package/dist/controller/defaults.d.ts.map +1 -0
  21. package/dist/controller/defaults.js +23 -0
  22. package/dist/controller/index.d.ts +38 -0
  23. package/dist/controller/index.d.ts.map +1 -0
  24. package/dist/controller/index.js +125 -0
  25. package/dist/delivery/index.d.ts +21 -0
  26. package/dist/delivery/index.d.ts.map +1 -0
  27. package/dist/delivery/index.js +51 -0
  28. package/dist/delivery/main.d.ts +40 -0
  29. package/dist/delivery/main.d.ts.map +1 -0
  30. package/dist/delivery/main.js +538 -0
  31. package/dist/index.d.ts +2 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.iife.d.ts +9 -0
  34. package/dist/index.iife.d.ts.map +1 -0
  35. package/dist/index.iife.js +224 -0
  36. package/dist/index.js +2 -0
  37. package/dist/math-templated.css +2 -0
  38. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  39. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  40. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  41. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  42. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  43. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  44. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  45. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
  46. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  47. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  48. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  49. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  50. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  51. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  52. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  53. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  54. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
  55. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  56. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
  57. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  58. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  59. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  60. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  61. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  62. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  63. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  64. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFlatten.js +13 -0
  65. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
  66. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  67. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  68. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js +6 -0
  69. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  70. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
  71. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  72. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  73. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  74. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  75. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  76. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  77. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  78. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePick.js +10 -0
  79. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePickBy.js +13 -0
  80. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  81. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js +22 -0
  82. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  83. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  84. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
  85. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js +8 -0
  86. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  87. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
  88. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
  89. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  90. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  91. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  92. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  93. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  94. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  95. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  96. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  97. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  98. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  99. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  100. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  101. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
  102. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
  103. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
  104. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_flatRest.js +9 -0
  105. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  106. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  107. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  108. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js +18 -0
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isFlattenable.js +10 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/debounce.js +50 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/flatten.js +7 -0
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js +8 -0
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/now.js +7 -0
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/pick.js +8 -0
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/throttle.js +15 -0
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js +19 -0
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
  198. package/dist/print/index.d.ts +16 -0
  199. package/dist/print/index.d.ts.map +1 -0
  200. package/dist/print/index.js +47 -0
  201. package/package.json +80 -0
  202. package/src/author/defaults.ts +133 -0
  203. package/src/author/design.tsx +526 -0
  204. package/src/author/index.ts +195 -0
  205. package/src/author/markupUtils.tsx +55 -0
  206. package/src/author/response.tsx +397 -0
  207. package/src/author/utils.ts +24 -0
  208. package/src/controller/defaults.ts +31 -0
  209. package/src/controller/index.ts +294 -0
  210. package/src/delivery/index.ts +94 -0
  211. package/src/delivery/main.tsx +800 -0
  212. package/src/index.iife.ts +16 -0
  213. package/src/index.ts +1 -0
  214. package/src/print/index.tsx +99 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/math-templated/configure/src/response.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 * as React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Response extends React.Component {
12
+ static propTypes: {
13
+ defaultResponse: PropTypes.Requireable<boolean>;
14
+ error: PropTypes.Requireable<object>;
15
+ mode: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
16
+ onResponseChange: PropTypes.Validator<(...args: any[]) => any>;
17
+ onResponseDone: PropTypes.Validator<(...args: any[]) => any>;
18
+ response: PropTypes.Validator<object>;
19
+ cIgnoreOrder: PropTypes.Validator<object>;
20
+ cAllowTrailingZeros: PropTypes.Validator<object>;
21
+ responseKey: PropTypes.Validator<number>;
22
+ };
23
+ static defaultProps: {
24
+ defaultResponse: boolean;
25
+ mode: string;
26
+ };
27
+ constructor(props: any);
28
+ onChange: (name: any) => (evt: any) => void;
29
+ onConfigChanged: (name: any) => (evt: any) => void;
30
+ onLiteralOptionsChange: (name: any) => () => void;
31
+ onAnswerChange: any;
32
+ onAlternateAnswerChange: (alternateId: any) => (answer: any) => void;
33
+ onAddAlternate: any;
34
+ onRemoveAlternate: (alternateId: any) => () => void;
35
+ onDone: any;
36
+ onFocus: any;
37
+ onAlternateFocus: (alternateId: any) => () => void;
38
+ onAlternateDone: (alternateId: any) => () => void;
39
+ render(): React.JSX.Element;
40
+ }
41
+ export default Response;
42
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/author/response.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,MAAM,YAAY,CAAC;AAqHnC,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS;IAC3C,MAAM,CAAC,SAAS;;;;;;;;;;MAUd;IAEF,MAAM,CAAC,YAAY;;;MAGjB;gBAEU,KAAK,KAAA;IAejB,QAAQ,GAAI,SAAI,MAAM,QAAG,UAOvB;IAEF,eAAe,GAAI,SAAI,MAAM,QAAG,UAO9B;IAEF,sBAAsB,GAAI,SAAI,gBAO5B;IAEF,cAAc,EAAE,GAAG,CAOjB;IAEF,uBAAuB,GAAI,gBAAW,MAAM,WAAM,UAOhD;IAEF,cAAc,EAAE,GAAG,CAgBjB;IAEF,iBAAiB,GAAI,gBAAW,gBAc9B;IAEF,MAAM,EAAE,GAAG,CAWT;IAEF,OAAO,EAAE,GAAG,CAQV;IAEF,gBAAgB,GAAI,gBAAW,gBAQ7B;IAEF,eAAe,GAAI,gBAAW,gBAQ5B;IAEF,MAAM;CA+GP;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,342 @@
1
+ import * as e from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import { color as r } from "@pie-lib/render-ui";
5
+ import { jsxDEV as i } from "react/jsx-dev-runtime";
6
+ import a from "@mui/material/Typography";
7
+ import o from "@mui/material/Select";
8
+ import s from "@mui/material/MenuItem";
9
+ import { InputContainer as c } from "@pie-lib/config-ui";
10
+ import { MathToolbar as l } from "@pie-lib/math-toolbar";
11
+ import u from "@mui/material/Card";
12
+ import d from "@mui/material/CardContent";
13
+ import f from "@mui/material/Button";
14
+ import p from "@mui/material/FormControlLabel";
15
+ import m from "@mui/material/InputLabel";
16
+ import h from "@mui/material/Checkbox";
17
+ import g from "@mui/material/IconButton";
18
+ import _ from "@mui/icons-material/Delete";
19
+ //#region src/author/response.tsx
20
+ var v = "/Users/eelco.hillenius/dev/prj/pie/pie-elements-ng/packages/elements-react/math-templated/src/author/response.tsx", y = n(u)(({ theme: e }) => ({
21
+ marginBottom: e.spacing(2.5),
22
+ width: "100%",
23
+ minWidth: "548px",
24
+ border: `1px solid ${e.palette.grey[700]}`,
25
+ display: "flex",
26
+ flexDirection: "column",
27
+ justifyContent: "space-between"
28
+ })), b = n(d)(({ theme: e }) => ({ paddingBottom: `${e.spacing(2)}px !important` })), x = n(a)({
29
+ fontWeight: 700,
30
+ fontSize: "1.2rem",
31
+ flex: 3
32
+ }), S = n(c)(({ theme: e }) => ({
33
+ flex: 2,
34
+ "& > *:not(label)": { marginTop: e.spacing(1) }
35
+ })), C = n("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), w = n("div")({
36
+ display: "flex",
37
+ alignItems: "center",
38
+ justifyContent: "space-between"
39
+ }), T = n("div")({ display: "flex" }), E = n(f)(({ theme: e }) => ({
40
+ border: `1px solid ${e.palette.grey.A400}`,
41
+ color: r.text()
42
+ })), D = n(g)(({ theme: e }) => ({ marginLeft: e.spacing(1) })), O = n("div")(({ theme: e }) => ({
43
+ fontSize: e.typography.fontSize - 2,
44
+ color: e.palette.error.main,
45
+ paddingTop: e.spacing(1)
46
+ })), k = n("div")(({ theme: e }) => ({
47
+ background: e.palette.grey.A100,
48
+ color: e.palette.grey.A700,
49
+ display: "inline",
50
+ minWidth: "50px",
51
+ padding: "8px",
52
+ border: "1px solid #C0C3CF"
53
+ })), A = n("div")({
54
+ display: "flex",
55
+ justifyContent: "space-between",
56
+ alignItems: "center"
57
+ }), j = n(h)({ color: `${r.tertiary()} !important` });
58
+ if (typeof document < "u") {
59
+ let e = "math-templated-response-styles";
60
+ if (!document.getElementById(e)) {
61
+ let t = document.createElement("style");
62
+ t.id = e, t.textContent = "\n .response-editor {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-width: 500px;\n max-width: 900px;\n height: auto;\n min-height: 40px;\n }\n .math-toolbar {\n width: 100%;\n }\n ", document.head.appendChild(t);
63
+ }
64
+ }
65
+ var M = class extends e.Component {
66
+ static propTypes = {
67
+ defaultResponse: t.bool,
68
+ error: t.object,
69
+ mode: t.oneOfType([t.string, t.number]),
70
+ onResponseChange: t.func.isRequired,
71
+ onResponseDone: t.func.isRequired,
72
+ response: t.object.isRequired,
73
+ cIgnoreOrder: t.object.isRequired,
74
+ cAllowTrailingZeros: t.object.isRequired,
75
+ responseKey: t.number.isRequired
76
+ };
77
+ static defaultProps = {
78
+ defaultResponse: !1,
79
+ mode: "8"
80
+ };
81
+ constructor(e) {
82
+ super(e);
83
+ let { response: { alternates: t } = {} } = e || {};
84
+ this.state = {
85
+ alternateIdCounter: Object.keys(t || {}).length + 1,
86
+ showKeypad: {
87
+ openCount: 0,
88
+ main: !1
89
+ }
90
+ };
91
+ }
92
+ onChange = (e) => (t) => {
93
+ let { response: n, onResponseChange: r, responseKey: i } = this.props, a = { ...n };
94
+ a[e] = t.target.value, r(a, i);
95
+ };
96
+ onConfigChanged = (e) => (t) => {
97
+ let { response: n, onResponseChange: r, responseKey: i } = this.props, a = { ...n };
98
+ a[e] = t.target.checked, r(a, i);
99
+ };
100
+ onLiteralOptionsChange = (e) => () => {
101
+ let { response: t, onResponseChange: n, responseKey: r } = this.props, i = { ...t };
102
+ i[e] = !t[e], n(i, r);
103
+ };
104
+ onAnswerChange = (e) => {
105
+ let { response: t, onResponseChange: n, responseKey: r } = this.props, i = { ...t };
106
+ i.answer = e, n(i, r);
107
+ };
108
+ onAlternateAnswerChange = (e) => (t) => {
109
+ let { response: n, onResponseChange: r, responseKey: i } = this.props, a = { ...n };
110
+ a.alternates[e] = t, r(a, i);
111
+ };
112
+ onAddAlternate = () => {
113
+ let { response: e, onResponseChange: t, responseKey: n } = this.props, { alternateIdCounter: r } = this.state, i = { ...e };
114
+ i.alternates ||= {}, i.alternates[r] = "", t(i, n), this.setState({ alternateIdCounter: r + 1 });
115
+ };
116
+ onRemoveAlternate = (e) => () => {
117
+ let { response: t, onResponseChange: n, responseKey: r } = this.props, i = { ...t };
118
+ delete i.alternates[e], n(i, r), this.setState((t) => ({ showKeypad: {
119
+ ...t.showKeypad,
120
+ openCount: t.showKeypad[e] ? t.showKeypad.openCount - 1 : t.showKeypad.openCount
121
+ } }));
122
+ };
123
+ onDone = () => {
124
+ let { onResponseDone: e } = this.props;
125
+ this.setState((e) => ({ showKeypad: {
126
+ ...e.showKeypad,
127
+ openCount: e.showKeypad.openCount - 1,
128
+ main: !1
129
+ } })), e();
130
+ };
131
+ onFocus = () => {
132
+ this.setState((e) => ({ showKeypad: {
133
+ ...e.showKeypad,
134
+ openCount: e.showKeypad.main ? e.showKeypad.openCount : e.showKeypad.openCount + 1,
135
+ main: !0
136
+ } }));
137
+ };
138
+ onAlternateFocus = (e) => () => {
139
+ this.setState((t) => ({ showKeypad: {
140
+ ...t.showKeypad,
141
+ openCount: t.showKeypad[e] ? t.showKeypad.openCount : t.showKeypad.openCount + 1,
142
+ [e]: !0
143
+ } }));
144
+ };
145
+ onAlternateDone = (e) => () => {
146
+ this.setState((t) => ({ showKeypad: {
147
+ ...t.showKeypad,
148
+ openCount: t.showKeypad.openCount - 1,
149
+ [e]: !1
150
+ } }));
151
+ };
152
+ render() {
153
+ let { mode: e, responseKey: t, response: n, cAllowTrailingZeros: r, cIgnoreOrder: a, error: c } = this.props, { showKeypad: u } = this.state, { validation: d, answer: f, alternates: h, ignoreOrder: g, allowTrailingZeros: M } = n, N = Object.keys(h || {}).length > 0, P = {
154
+ editor: "response-editor",
155
+ mathToolbar: "math-toolbar"
156
+ };
157
+ return /* @__PURE__ */ i(y, {
158
+ style: { minHeight: `${u.openCount > 0 ? 430 : 230}px` },
159
+ children: /* @__PURE__ */ i(b, { children: [
160
+ /* @__PURE__ */ i(w, { children: [/* @__PURE__ */ i(x, {
161
+ component: "div",
162
+ children: ["Response for ", /* @__PURE__ */ i(k, { children: `R ${parseInt(t) + 1}` }, void 0, !1, {
163
+ fileName: v,
164
+ lineNumber: 304,
165
+ columnNumber: 28
166
+ }, this)]
167
+ }, void 0, !0, {
168
+ fileName: v,
169
+ lineNumber: 303,
170
+ columnNumber: 13
171
+ }, this), /* @__PURE__ */ i(S, {
172
+ label: "Validation",
173
+ children: /* @__PURE__ */ i(o, {
174
+ onChange: this.onChange("validation"),
175
+ value: d || "literal",
176
+ MenuProps: { transitionDuration: {
177
+ enter: 225,
178
+ exit: 195
179
+ } },
180
+ children: [/* @__PURE__ */ i(s, {
181
+ value: "literal",
182
+ children: "Literal Validation"
183
+ }, void 0, !1, {
184
+ fileName: v,
185
+ lineNumber: 309,
186
+ columnNumber: 17
187
+ }, this), /* @__PURE__ */ i(s, {
188
+ value: "symbolic",
189
+ children: "Symbolic Validation"
190
+ }, void 0, !1, {
191
+ fileName: v,
192
+ lineNumber: 310,
193
+ columnNumber: 17
194
+ }, this)]
195
+ }, void 0, !0, {
196
+ fileName: v,
197
+ lineNumber: 308,
198
+ columnNumber: 15
199
+ }, this)
200
+ }, void 0, !1, {
201
+ fileName: v,
202
+ lineNumber: 307,
203
+ columnNumber: 13
204
+ }, this)] }, void 0, !0, {
205
+ fileName: v,
206
+ lineNumber: 302,
207
+ columnNumber: 11
208
+ }, this),
209
+ d === "literal" && /* @__PURE__ */ i(T, { children: [r.enabled && /* @__PURE__ */ i(p, {
210
+ label: r.label,
211
+ control: /* @__PURE__ */ i(j, {
212
+ checked: M,
213
+ onChange: this.onLiteralOptionsChange("allowTrailingZeros")
214
+ }, void 0, !1, {
215
+ fileName: v,
216
+ lineNumber: 321,
217
+ columnNumber: 21
218
+ }, this)
219
+ }, void 0, !1, {
220
+ fileName: v,
221
+ lineNumber: 318,
222
+ columnNumber: 17
223
+ }, this), a.enabled && /* @__PURE__ */ i(p, {
224
+ label: a.label,
225
+ control: /* @__PURE__ */ i(j, {
226
+ checked: g,
227
+ onChange: this.onLiteralOptionsChange("ignoreOrder")
228
+ }, void 0, !1, {
229
+ fileName: v,
230
+ lineNumber: 333,
231
+ columnNumber: 21
232
+ }, this)
233
+ }, void 0, !1, {
234
+ fileName: v,
235
+ lineNumber: 330,
236
+ columnNumber: 17
237
+ }, this)] }, void 0, !0, {
238
+ fileName: v,
239
+ lineNumber: 316,
240
+ columnNumber: 13
241
+ }, this),
242
+ /* @__PURE__ */ i(C, { children: [
243
+ /* @__PURE__ */ i(m, { children: "Correct Answer" }, void 0, !1, {
244
+ fileName: v,
245
+ lineNumber: 344,
246
+ columnNumber: 13
247
+ }, this),
248
+ /* @__PURE__ */ i(l, {
249
+ keypadMode: e,
250
+ classNames: P,
251
+ controlledKeypad: !0,
252
+ showKeypad: u.main,
253
+ latex: f || "",
254
+ onChange: this.onAnswerChange,
255
+ onFocus: this.onFocus,
256
+ onDone: this.onDone,
257
+ error: c && c.answer
258
+ }, void 0, !1, {
259
+ fileName: v,
260
+ lineNumber: 345,
261
+ columnNumber: 13
262
+ }, this),
263
+ c && c.answer ? /* @__PURE__ */ i(O, { children: c.answer }, void 0, !1, {
264
+ fileName: v,
265
+ lineNumber: 356,
266
+ columnNumber: 38
267
+ }, this) : null
268
+ ] }, void 0, !0, {
269
+ fileName: v,
270
+ lineNumber: 343,
271
+ columnNumber: 11
272
+ }, this),
273
+ N && Object.keys(h).map((t, n) => /* @__PURE__ */ i(C, { children: [
274
+ /* @__PURE__ */ i(m, { children: ["Alternate", Object.keys(h).length > 1 ? ` ${n + 1}` : ""] }, void 0, !0, {
275
+ fileName: v,
276
+ lineNumber: 362,
277
+ columnNumber: 17
278
+ }, this),
279
+ /* @__PURE__ */ i(A, { children: [/* @__PURE__ */ i(l, {
280
+ classNames: P,
281
+ controlledKeypad: !0,
282
+ keypadMode: e,
283
+ showKeypad: u[t] || !1,
284
+ latex: h[t] || "",
285
+ onChange: this.onAlternateAnswerChange(t),
286
+ onFocus: this.onAlternateFocus(t),
287
+ onDone: this.onAlternateDone(t),
288
+ error: c && c[t]
289
+ }, void 0, !1, {
290
+ fileName: v,
291
+ lineNumber: 367,
292
+ columnNumber: 19
293
+ }, this), /* @__PURE__ */ i(D, {
294
+ onClick: this.onRemoveAlternate(t),
295
+ size: "large",
296
+ children: /* @__PURE__ */ i(_, {}, void 0, !1, {
297
+ fileName: v,
298
+ lineNumber: 381,
299
+ columnNumber: 21
300
+ }, this)
301
+ }, void 0, !1, {
302
+ fileName: v,
303
+ lineNumber: 378,
304
+ columnNumber: 19
305
+ }, this)] }, void 0, !0, {
306
+ fileName: v,
307
+ lineNumber: 366,
308
+ columnNumber: 17
309
+ }, this),
310
+ c && c[t] ? /* @__PURE__ */ i(O, { children: c[t] }, void 0, !1, {
311
+ fileName: v,
312
+ lineNumber: 384,
313
+ columnNumber: 48
314
+ }, this) : null
315
+ ] }, t, !0, {
316
+ fileName: v,
317
+ lineNumber: 361,
318
+ columnNumber: 15
319
+ }, this)),
320
+ /* @__PURE__ */ i(E, {
321
+ type: "primary",
322
+ onClick: this.onAddAlternate,
323
+ children: "ADD ALTERNATE"
324
+ }, void 0, !1, {
325
+ fileName: v,
326
+ lineNumber: 388,
327
+ columnNumber: 11
328
+ }, this)
329
+ ] }, void 0, !0, {
330
+ fileName: v,
331
+ lineNumber: 301,
332
+ columnNumber: 9
333
+ }, this)
334
+ }, void 0, !1, {
335
+ fileName: v,
336
+ lineNumber: 300,
337
+ columnNumber: 7
338
+ }, this);
339
+ }
340
+ };
341
+ //#endregion
342
+ export { M as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/math-templated/configure/src/utils.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 generateValidationMessage: (config: any) => string;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/author/utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,eAAO,MAAM,yBAAyB,GAAI,WAAM,WAa/C,CAAC"}
@@ -0,0 +1,7 @@
1
+ //#region src/author/utils.ts
2
+ var e = (e) => {
3
+ let { maxResponseAreas: t } = e;
4
+ return "Validation requirements:" + ("\nCorrect answers should not be blank.\nEach answer defined for a response area should be unique.\nThere should be at least 1 " + (t ? `and at most ${t} ` : "") + "response area" + (t ? "s" : "") + " defined.");
5
+ };
6
+ //#endregion
7
+ export { e as generateValidationMessage };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/math-templated/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
+ model: {
11
+ allowTrailingZerosDefault: boolean;
12
+ equationEditor: string;
13
+ ignoreOrderDefault: boolean;
14
+ markup: string;
15
+ playerSpellCheckEnabled: boolean;
16
+ prompt: string;
17
+ promptEnabled: boolean;
18
+ rationale: string;
19
+ rationaleEnabled: boolean;
20
+ responses: {};
21
+ spellCheckEnabled: boolean;
22
+ teacherInstructions: string;
23
+ teacherInstructionsEnabled: boolean;
24
+ toolbarEditorPosition: string;
25
+ validationDefault: string;
26
+ };
27
+ configuration: {};
28
+ };
29
+ export default _default;
30
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/controller/defaults.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;AAGH,wBAmBE"}
@@ -0,0 +1,23 @@
1
+ //#region src/controller/defaults.ts
2
+ var e = {
3
+ model: {
4
+ allowTrailingZerosDefault: !1,
5
+ equationEditor: "8",
6
+ ignoreOrderDefault: !1,
7
+ markup: "",
8
+ playerSpellCheckEnabled: !0,
9
+ prompt: "",
10
+ promptEnabled: !0,
11
+ rationale: "",
12
+ rationaleEnabled: !0,
13
+ responses: {},
14
+ spellCheckEnabled: !0,
15
+ teacherInstructions: "",
16
+ teacherInstructionsEnabled: !0,
17
+ toolbarEditorPosition: "bottom",
18
+ validationDefault: "literal"
19
+ },
20
+ configuration: {}
21
+ };
22
+ //#endregion
23
+ export { e as default };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/math-templated/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 const getCorrectness: (question: any, env: any, session: any) => {
10
+ correctness: string;
11
+ score: number;
12
+ correct: boolean;
13
+ } | undefined;
14
+ export declare const getPartialScore: (question: any, session: any) => 0 | 1;
15
+ export declare const outcome: (question: any, session: any, env: any) => Promise<unknown>;
16
+ export declare const createDefaultModel: (model?: {}) => {
17
+ responses: {};
18
+ allowTrailingZerosDefault: boolean;
19
+ equationEditor: string;
20
+ ignoreOrderDefault: boolean;
21
+ markup: string;
22
+ playerSpellCheckEnabled: boolean;
23
+ prompt: string;
24
+ promptEnabled: boolean;
25
+ rationale: string;
26
+ rationaleEnabled: boolean;
27
+ spellCheckEnabled: boolean;
28
+ teacherInstructions: string;
29
+ teacherInstructionsEnabled: boolean;
30
+ toolbarEditorPosition: string;
31
+ validationDefault: string;
32
+ };
33
+ export declare const normalizeSession: (s: any) => any;
34
+ export declare const prepareVal: (html: any) => any;
35
+ export declare const model: (question: any, session: any, env: any) => Promise<unknown>;
36
+ export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
37
+ export declare const validate: (model?: {}, config?: {}) => {};
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controller/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAoFH,eAAO,MAAM,cAAc,GAAI,aAAQ,EAAE,QAAG,EAAE,YAAO;;;;aAIpD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAQ,EAAE,YAAO,UAMhD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,aAAQ,EAAE,YAAO,EAAE,QAAG,qBAgB1C,CAAC;AAEL,eAAO,MAAM,kBAAkB,GAAI,UAAU;;;;;;;;;;;;;;;;CAqB5C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAC,QAAe,CAAC;AAIlD,eAAO,MAAM,UAAU,GAAI,SAAI,QAAiC,CAAC;AAEjE,eAAO,MAAM,KAAK,GAAI,aAAQ,EAAE,YAAO,EAAE,QAAG,qBAuE3C,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,aAAQ,EAAE,QAAG,qBAYtD,CAAC;AAEL,eAAO,MAAM,QAAQ,GAAI,UAAU,EAAE,WAAW,OAqD/C,CAAC"}
@@ -0,0 +1,125 @@
1
+ import e from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js";
2
+ import t from "./defaults.js";
3
+ import n from "debug";
4
+ import r from "@pie-lib/translator";
5
+ import * as i from "@pie-framework/math-validation";
6
+ import { partialScoring as a } from "@pie-element/shared-controller-utils";
7
+ //#region src/controller/index.ts
8
+ var { translator: o } = r, s = n("@pie-element:math-templated:controller"), c = (e) => e ? "correct" : "incorrect", l = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), u = (e, n) => {
9
+ let r = !1, a = {
10
+ mode: e.validation || t.validationDefault,
11
+ ...e.validation === "literal" && { literal: {
12
+ allowTrailingZeros: e.allowTrailingZeros || !1,
13
+ ignoreOrder: e.ignoreOrder || !1
14
+ } }
15
+ };
16
+ if (!r) {
17
+ let t = [e.answer, ...Object.values(e.alternates || {})];
18
+ try {
19
+ for (let e of t) if (r = i.latexEqual(n.value, e, a), r) break;
20
+ } catch (t) {
21
+ s("Parse failure when evaluating math", t, e, n), r = !1;
22
+ }
23
+ }
24
+ return r;
25
+ }, d = (e, t) => {
26
+ let n = e.responses;
27
+ if (t) {
28
+ let e = 0, r = 0, i = Object.keys(n || {}).length;
29
+ Object.keys(n).forEach((r) => {
30
+ let i = t["r" + r];
31
+ u(n[r] || {}, i) && e++;
32
+ });
33
+ let a = e === i;
34
+ return r = Number((e / Object.keys(n).length).toFixed(2)), {
35
+ correctness: c(a),
36
+ score: e > 0 ? r : 0,
37
+ correct: a
38
+ };
39
+ } else return {
40
+ correctness: "unanswered",
41
+ score: 0,
42
+ correct: !1
43
+ };
44
+ }, f = (e, t, n) => {
45
+ if (t.mode === "evaluate") return d(e, n && n.answers);
46
+ }, p = (t, n) => !n || e(n) ? 0 : 1, m = (t, n, r) => new Promise((i) => {
47
+ (!n || e(n)) && i({
48
+ score: 0,
49
+ empty: !0
50
+ });
51
+ let o = a.enabled(t, r);
52
+ if (n = g(n), r.mode !== "evaluate") i({
53
+ score: void 0,
54
+ completed: void 0
55
+ });
56
+ else {
57
+ let e = f(t, r, n, !0).score;
58
+ i({ score: o ? e : e === 1 ? 1 : 0 });
59
+ }
60
+ }), h = (e = {}) => {
61
+ let { validationDefault: n, allowTrailingZerosDefault: r, ignoreOrderDefault: i, responses: a = {} } = e, o = Object.keys(a).reduce((e, t) => {
62
+ let o = a[t];
63
+ return e[t] = {
64
+ ...o,
65
+ validation: o.validation || n,
66
+ allowTrailingZeros: o.allowTrailingZeros || r,
67
+ ignoreOrder: o.ignoreOrder || i
68
+ }, e;
69
+ }, {});
70
+ return {
71
+ ...t.model,
72
+ ...e,
73
+ responses: o
74
+ };
75
+ }, g = (e) => ({ ...e }), _ = (e) => (e || "").replace(/<\/?[^>]+(>|$)/g, ""), v = (e) => _(e).trim(), y = (e, t, n) => new Promise((r) => {
76
+ t ||= {};
77
+ let i = h(e), a = f(i, n, t), { responses: c, language: l } = i, { note: d } = i, p = !1;
78
+ Object.keys(c).forEach((e) => {
79
+ let t = c[e] || {};
80
+ (t.alternates && Object.keys(t.alternates).length > 0 || t.validation !== "literal") && (p = !0);
81
+ }), d ||= o.t("mathInline.primaryCorrectWithAlternates", { lng: l });
82
+ let m = {
83
+ prompt: i.promptEnabled ? i.prompt : null,
84
+ markup: i.markup,
85
+ responses: n.mode === "gather" ? null : i.responses,
86
+ language: i.language,
87
+ equationEditor: i.equationEditor,
88
+ customKeys: i.customKeys,
89
+ disabled: n.mode !== "gather",
90
+ view: n.mode === "view",
91
+ correctness: a,
92
+ env: n,
93
+ extraCSSRules: i.extraCSSRules
94
+ }, { answers: g = {} } = t || {}, _ = {};
95
+ n.mode === "evaluate" && Object.keys(c).forEach((e) => {
96
+ let t = g["r" + e], n = c[e];
97
+ _[e] = u(n, t);
98
+ }), n.mode === "evaluate" ? (m.correctResponse = {}, m.showNote = p, m.note = d, m.feedback = _) : (m.responses = {}, m.showNote = !1), n.role === "instructor" && (n.mode === "view" || n.mode === "evaluate") ? (m.rationale = i.rationaleEnabled ? i.rationale : null, m.teacherInstructions = i.teacherInstructionsEnabled ? i.teacherInstructions : null) : (m.rationale = null, m.teacherInstructions = null), s("out: ", m), r(m);
99
+ }), b = (e, t) => new Promise((n) => {
100
+ t.mode !== "evaluate" && t.role === "instructor" ? n({
101
+ id: "1",
102
+ answers: Object.keys(e.responses).reduce((t, n) => (t["r" + n] = { value: e.responses[n].answer }, t), {})
103
+ }) : n(null);
104
+ }), x = (t = {}, n = {}) => {
105
+ let { responses: r, markup: i } = t, { maxResponseAreas: a } = n, o = {}, s = {};
106
+ [
107
+ "teacherInstructions",
108
+ "prompt",
109
+ "rationale"
110
+ ].forEach((e) => {
111
+ n[e]?.required && !l(t[e]) && (s[e] = "This field is required.");
112
+ }), Object.entries(r || {}).forEach(([t, n], r) => {
113
+ let { answer: i } = n, a = [...Object.entries(n.alternates || {})].reverse(), s = {}, c = {};
114
+ i === "" && (c.answer = "Content should not be empty."), a.forEach(([e, t], n) => {
115
+ t === "" ? s[e] = "Content should not be empty." : (i === t || a.slice(n + 1).some(([, e]) => e === t)) && (s[e] = "Content should be unique.");
116
+ }), (!e(c) || !e(s)) && (o[r] = {
117
+ ...c,
118
+ ...s
119
+ });
120
+ });
121
+ let c = (i.match(/\{\{(\d+)\}\}/g) || []).length;
122
+ return c > a ? s.responseAreas = `No more than ${a} response areas should be defined.` : c < 1 && (s.responseAreas = "There should be at least 1 response area defined."), e(o) || (s.responses = o), s;
123
+ };
124
+ //#endregion
125
+ export { b as createCorrectResponseSession, h as createDefaultModel, f as getCorrectness, p as getPartialScore, y as model, g as normalizeSession, m as outcome, v as prepareVal, x as validate };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/math-templated/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 default class MathTemplated extends HTMLElement {
10
+ constructor();
11
+ set model(m: any);
12
+ get model(): any;
13
+ set session(s: any);
14
+ get session(): any;
15
+ isSessionComplete(): boolean;
16
+ onSessionChange(session: any): void;
17
+ connectedCallback(): void;
18
+ render(): void;
19
+ disconnectedCallback(): void;
20
+ }
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delivery/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAQH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;;IASpD,IAAI,KAAK,CAAC,CAAC,KAAA,EAOV;IAED,IAAI,KAAK,QAER;IAED,IAAI,OAAO,CAAC,CAAC,KAAA,EAIZ;IAED,IAAI,OAAO,QAEV;IAED,iBAAiB;IAKjB,eAAe,CAAC,OAAO,KAAA;IAUvB,iBAAiB;IAMjB,MAAM;IAmBN,oBAAoB;CAKrB"}