@pie-element/drag-in-the-blank 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 (224) hide show
  1. package/dist/author/choice.d.ts +23 -0
  2. package/dist/author/choice.d.ts.map +1 -0
  3. package/dist/author/choice.js +88 -0
  4. package/dist/author/choices.d.ts +41 -0
  5. package/dist/author/choices.d.ts.map +1 -0
  6. package/dist/author/choices.js +159 -0
  7. package/dist/author/defaults.d.ts +172 -0
  8. package/dist/author/defaults.d.ts.map +1 -0
  9. package/dist/author/defaults.js +123 -0
  10. package/dist/author/index.d.ts +43 -0
  11. package/dist/author/index.d.ts.map +1 -0
  12. package/dist/author/index.js +92 -0
  13. package/dist/author/main.d.ts +37 -0
  14. package/dist/author/main.d.ts.map +1 -0
  15. package/dist/author/main.js +301 -0
  16. package/dist/author/markupUtils.d.ts +18 -0
  17. package/dist/author/markupUtils.d.ts.map +1 -0
  18. package/dist/author/markupUtils.js +38 -0
  19. package/dist/author/utils.d.ts +10 -0
  20. package/dist/author/utils.d.ts.map +1 -0
  21. package/dist/author/utils.js +7 -0
  22. package/dist/controller/defaults.d.ts +27 -0
  23. package/dist/controller/defaults.d.ts.map +1 -0
  24. package/dist/controller/defaults.js +20 -0
  25. package/dist/controller/index.d.ts +42 -0
  26. package/dist/controller/index.d.ts.map +1 -0
  27. package/dist/controller/index.js +104 -0
  28. package/dist/controller/utils.d.ts +14 -0
  29. package/dist/controller/utils.d.ts.map +1 -0
  30. package/dist/controller/utils.js +15 -0
  31. package/dist/delivery/index.d.ts +22 -0
  32. package/dist/delivery/index.d.ts.map +1 -0
  33. package/dist/delivery/index.js +105 -0
  34. package/dist/delivery/main.d.ts +29 -0
  35. package/dist/delivery/main.d.ts.map +1 -0
  36. package/dist/delivery/main.js +83 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.iife.d.ts +9 -0
  40. package/dist/index.iife.d.ts.map +1 -0
  41. package/dist/index.iife.js +152 -0
  42. package/dist/index.js +2 -0
  43. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  44. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  45. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  46. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  47. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  48. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  49. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  50. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
  51. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  52. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  53. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  54. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  55. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  56. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  57. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  58. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  59. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
  60. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  61. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayReduce.js +8 -0
  62. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
  63. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  64. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  65. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  66. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  67. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  68. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  69. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  70. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseEach.js +6 -0
  71. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +5 -0
  72. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseForOwn.js +8 -0
  73. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
  74. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  75. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  76. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js +6 -0
  77. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  78. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
  79. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  80. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  81. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js +26 -0
  82. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  83. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  84. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  85. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js +11 -0
  86. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  87. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  88. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js +12 -0
  89. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  90. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js +8 -0
  91. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  92. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyOf.js +8 -0
  93. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseReduce.js +8 -0
  94. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  95. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  96. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  97. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
  98. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  99. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
  100. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
  101. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  102. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  103. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  104. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  105. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  106. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  107. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  108. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseEach.js +12 -0
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +12 -0
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_escapeHtmlChar.js +11 -0
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js +16 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js +18 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js +7 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/escape.js +9 -0
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js +8 -0
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  198. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  199. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  200. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
  201. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  202. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  203. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  204. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
  205. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/property.js +10 -0
  206. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/reduce.js +12 -0
  207. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  208. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  209. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
  210. package/package.json +72 -0
  211. package/src/author/choice.tsx +132 -0
  212. package/src/author/choices.tsx +314 -0
  213. package/src/author/defaults.ts +132 -0
  214. package/src/author/index.tsx +176 -0
  215. package/src/author/main.tsx +498 -0
  216. package/src/author/markupUtils.tsx +106 -0
  217. package/src/author/utils.ts +27 -0
  218. package/src/controller/defaults.ts +27 -0
  219. package/src/controller/index.ts +274 -0
  220. package/src/controller/utils.ts +50 -0
  221. package/src/delivery/index.ts +266 -0
  222. package/src/delivery/main.tsx +146 -0
  223. package/src/index.iife.ts +16 -0
  224. package/src/index.ts +1 -0
@@ -0,0 +1,104 @@
1
+ import e from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js";
2
+ import { choiceIsEmpty as t, getAllCorrectResponses as n } from "./utils.js";
3
+ import r from "./defaults.js";
4
+ import { getShuffledChoices as i, lockChoices as a, partialScoring as o } from "@pie-element/shared-controller-utils";
5
+ //#region src/controller/index.ts
6
+ var s = (e) => ({
7
+ ...r,
8
+ ...e
9
+ });
10
+ async function c(e, r, o, c) {
11
+ let u = s(e), d = {};
12
+ if (o.mode === "evaluate") {
13
+ let e = n(u) || {}, t = e.possibleResponses, i = e.numberOfPossibleResponses || 0, a, { value: o } = r || {};
14
+ for (let e = 0; e < i; e++) {
15
+ let n = Object.keys(t).reduce((n, r) => {
16
+ let i = t[r], a = o && o[r] || "";
17
+ return n.feedback[r] = i[e] === a, n.feedback[r] && (n.correctResponses += 1), n;
18
+ }, {
19
+ correctResponses: 0,
20
+ feedback: {}
21
+ });
22
+ (a === void 0 || n.correctResponses > a) && (a = n.correctResponses, d = n.feedback);
23
+ }
24
+ }
25
+ let f = u.choices && u.choices.filter((e) => !t(e));
26
+ a(u, r, o) || (f = await i(f, r, c, "id"));
27
+ let p = Object.values(u.correctResponse || {}).filter((e) => !!e).length, m = o.mode === "evaluate", h = {
28
+ ...u,
29
+ prompt: u.promptEnabled ? u.prompt : null,
30
+ choices: f,
31
+ feedback: d,
32
+ mode: o.mode,
33
+ disabled: o.mode !== "gather",
34
+ responseCorrect: m ? l(u, r) === 1 : void 0,
35
+ correctResponse: m ? u.correctResponse : void 0,
36
+ responseAreasToBeFilled: p
37
+ };
38
+ return o.role === "instructor" && (o.mode === "view" || o.mode === "evaluate") ? (h.rationale = u.rationaleEnabled ? u.rationale : null, h.teacherInstructions = u.teacherInstructionsEnabled ? u.teacherInstructions : null) : (h.rationale = null, h.teacherInstructions = null), h;
39
+ }
40
+ var l = (e, t) => {
41
+ let r = n(e), i = r.possibleResponses, a = Object.keys(e.correctResponse).length, o = r.numberOfPossibleResponses || 0, s = 0, { value: c } = t || {};
42
+ for (let e = 0; e < o; e++) {
43
+ let t = Object.keys(i).reduce((t, n) => {
44
+ let r = i[n], a = c && c[n] || "";
45
+ return r[e] === a ? t : t - 1;
46
+ }, a);
47
+ if (t > s && (s = t), t === a) break;
48
+ }
49
+ let l = a ? (s / a).toFixed(2) : 0;
50
+ return parseFloat(l);
51
+ }, u = (e, t, r) => {
52
+ let i = [], { value: a } = t || {}, s = Object.keys(e.correctResponse || {}), c = s.length;
53
+ if (i.push(`${c} response area(s) defined in this question.`), a && Object.keys(a).length > 0) {
54
+ let t = Object.entries(a).filter(([e, t]) => t && t.trim()).length;
55
+ i.push(`Student added choices to ${t} out of ${c} response area(s).`), s.forEach((t) => {
56
+ let n = a && a[t] || "", r = e.correctResponse[t] || "";
57
+ n.trim() ? i.push(`Response area ${t}: student placed '${n}' (correct answer: '${r}').`) : i.push(`Response area ${t}: left empty (correct answer: '${r}').`);
58
+ });
59
+ } else i.push("Student did not add any choices to response areas.");
60
+ let u = n(e);
61
+ u.possibleResponses;
62
+ let d = u.numberOfPossibleResponses || 0;
63
+ d > 1 && i.push(`${d} alternate response combinations are accepted for this question.`);
64
+ let f = o.enabled(e, r) ? "partial scoring" : "all-or-nothing scoring";
65
+ i.push(`Score calculated using ${f}.`);
66
+ let p = l(e, t);
67
+ return i.push(`Final score: ${p}.`), i;
68
+ };
69
+ function d(t, n, r = {}) {
70
+ return new Promise((i) => {
71
+ if (!n || e(n)) i({
72
+ score: 0,
73
+ empty: !0,
74
+ traceLog: ["Student did not add any choices to response areas. Score is 0."]
75
+ });
76
+ else {
77
+ let e = u(t, n, r), a = l(t, n);
78
+ i({
79
+ score: o.enabled(t, r) ? a : a === 1 ? 1 : 0,
80
+ empty: !1,
81
+ traceLog: e
82
+ });
83
+ }
84
+ });
85
+ }
86
+ var f = (e, t) => new Promise((n) => {
87
+ t.mode !== "evaluate" && t.role === "instructor" ? n({
88
+ value: e.correctResponse,
89
+ id: "1"
90
+ }) : n(null);
91
+ }), p = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), m = (e = {}, t = {}) => {
92
+ let { choices: n, correctResponse: r, markup: i } = e, { minChoices: a = 2, maxChoices: o, maxResponseAreas: s } = t, c = {};
93
+ [
94
+ "teacherInstructions",
95
+ "prompt",
96
+ "rationale"
97
+ ].forEach((n) => {
98
+ t[n]?.required && !p(e[n]) && (c[n] = "This field is required.");
99
+ });
100
+ let l = ((i || "").match(/\{\{(\d+)\}\}/g) || []).length, u = (n || []).length;
101
+ return (Object.values(r)?.filter((e) => !e)).length && (c.correctResponseError = "There should be a choice defined for each response area."), l > s ? c.responseAreasError = `No more than ${s} response areas should be defined.` : l < 1 && (c.responseAreasError = "There should be at least 1 response area defined."), u < a ? c.choicesError = `There should be at least ${a} tokens defined.` : u > o && (c.choicesError = `No more than ${o} tokens should be defined.`), c;
102
+ };
103
+ //#endregion
104
+ export { f as createCorrectResponseSession, u as getLogTrace, l as getScore, c as model, s as normalize, d as outcome, m as validate };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/drag-in-the-blank/controller/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 getAllCorrectResponses: ({ correctResponse, alternateResponses }: {
10
+ correctResponse: any;
11
+ alternateResponses: any;
12
+ }) => any;
13
+ export declare const choiceIsEmpty: (choice: any) => boolean;
14
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/controller/utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAMH,eAAO,MAAM,sBAAsB,GAAI;;;CAAuC,QAwB7E,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAM,YASnC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import e from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js";
2
+ import t from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/reduce.js";
3
+ //#region src/controller/utils.ts
4
+ var n = /<(?!img)[^>]*>?/gm, r = ({ correctResponse: n, alternateResponses: r }) => t(n || {}, (t, n, i) => (t.possibleResponses[i] = [n], r && r[i] && (t.possibleResponses[i] = [...t.possibleResponses[i], ...e(r[i])]), (t.numberOfPossibleResponses === void 0 || t.numberOfPossibleResponses > t.possibleResponses[i].length) && (t.numberOfPossibleResponses = t.possibleResponses[i].length), t), {
5
+ possibleResponses: {},
6
+ numberOfPossibleResponses: void 0
7
+ }), i = (e) => {
8
+ if (e) {
9
+ let { value: t = "" } = e;
10
+ return (t.replace(n, "") || "").trim() === "";
11
+ }
12
+ return !1;
13
+ };
14
+ //#endregion
15
+ export { i as choiceIsEmpty, r as getAllCorrectResponses };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/drag-in-the-blank/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, model: any, audioComplete: any, elementContext: any) => boolean;
10
+ export default class DragInTheBlank extends HTMLElement {
11
+ constructor();
12
+ set model(m: any);
13
+ set session(s: any);
14
+ get session(): any;
15
+ _render: any;
16
+ dispatchChangedEvent: any;
17
+ changeSession: any;
18
+ _createAudioInfoToast(): HTMLDivElement;
19
+ connectedCallback(): void;
20
+ disconnectedCallback(): void;
21
+ }
22
+ //# 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;AAqCH,eAAO,MAAM,UAAU,GAAI,YAAO,EAAE,UAAK,EAAE,kBAAa,EAAE,mBAAc,YAsBvE,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;;IAUrD,IAAI,KAAK,CAAC,CAAC,KAAA,EAYV;IAED,IAAI,OAAO,CAAC,CAAC,KAAA,EAGZ;IAED,IAAI,OAAO,QAEV;IAED,OAAO,EAAE,GAAG,CAcV;IAEF,oBAAoB,EAAE,GAAG,CAOvB;IAEF,aAAa,EAAE,GAAG,CAMhB;IAEF,qBAAqB;IA2BrB,iBAAiB;IA0FjB,oBAAoB;CAarB"}
@@ -0,0 +1,105 @@
1
+ import e from "./main.js";
2
+ import t from "react";
3
+ import { createRoot as n } from "react-dom/client";
4
+ import { renderMath as r } from "@pie-element/shared-math-rendering-mathjax";
5
+ import * as i from "@pie-lib/render-ui";
6
+ import { EnableAudioAutoplayImage as a } from "@pie-lib/render-ui";
7
+ import { ModelSetEvent as o, SessionChangedEvent as s } from "@pie-element/shared-player-events";
8
+ //#region src/delivery/index.ts
9
+ function c(e) {
10
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
11
+ }
12
+ function l(e, t) {
13
+ return !e || c(e) ? e : c(e.default) ? e.default : t && c(e[t]) ? e[t] : t && c(e[t]?.default) ? e[t].default : e;
14
+ }
15
+ var u = l(a, "EnableAudioAutoplayImage") || l(p.EnableAudioAutoplayImage, "EnableAudioAutoplayImage"), d = i, f = d.default, p = f && typeof f == "object" ? f : d, m = (e, t, n, r) => {
16
+ let { autoplayAudioEnabled: i, completeAudioEnabled: a, responseAreasToBeFilled: o } = t || {};
17
+ if (i && a && !n && r) {
18
+ let e = r.querySelector("audio"), t = e && e.closest("#preview-prompt");
19
+ if (e && t) return !1;
20
+ }
21
+ return !e || !e.value ? !1 : Object.values(e.value || {}).filter((e) => !!e).length >= o;
22
+ }, h = class extends HTMLElement {
23
+ constructor() {
24
+ super(), this._model = null, this._session = null, this._audioInitialized = !1, this.audioComplete = !1, this._root = null;
25
+ }
26
+ set model(e) {
27
+ this._model = e, this.dispatchEvent(new o(this.tagName.toLowerCase(), m(this._session, this._model, this.audioComplete, this), !!this._model)), this._audioInitialized = !1, this._render();
28
+ }
29
+ set session(e) {
30
+ this._session = e, this._render();
31
+ }
32
+ get session() {
33
+ return this._session;
34
+ }
35
+ _render = () => {
36
+ if (this._model && this._session) {
37
+ let i = t.createElement(e, {
38
+ model: this._model,
39
+ value: this._session.value,
40
+ onChange: this.changeSession
41
+ });
42
+ this._root ||= n(this), this._root.render(i), setTimeout(() => r(this), 0);
43
+ }
44
+ };
45
+ dispatchChangedEvent = () => {
46
+ this.dispatchEvent(new s(this.tagName.toLowerCase(), m(this._session, this._model, this.audioComplete, this)));
47
+ };
48
+ changeSession = (e) => {
49
+ this.session.value = e, this.session.selector = "Mouse", this.dispatchChangedEvent(), this._render();
50
+ };
51
+ _createAudioInfoToast() {
52
+ let e = document.createElement("div");
53
+ e.id = "play-audio-info", Object.assign(e.style, {
54
+ position: "absolute",
55
+ top: 0,
56
+ width: "100%",
57
+ height: "100%",
58
+ display: "flex",
59
+ justifyContent: "center",
60
+ alignItems: "center",
61
+ background: "white",
62
+ zIndex: "1000",
63
+ cursor: "pointer"
64
+ });
65
+ let t = document.createElement("img");
66
+ return t.src = u, t.alt = "Click anywhere to enable audio autoplay", t.width = 500, t.height = 300, e.appendChild(t), e;
67
+ }
68
+ connectedCallback() {
69
+ this._render(), new MutationObserver((e, t) => {
70
+ e.forEach((e) => {
71
+ if (e.type === "childList") {
72
+ if (this._audioInitialized) return;
73
+ let e = this.querySelector("audio"), n = e && e.closest("#preview-prompt");
74
+ if (!this._model || !this._model.autoplayAudioEnabled || e && !n || !e) return;
75
+ let r = this._createAudioInfoToast(), i = this.querySelector("#main-container"), a = () => {
76
+ this.querySelector("#play-audio-info") && (e.play(), i.removeChild(r)), document.removeEventListener("click", a);
77
+ };
78
+ setTimeout(() => {
79
+ e.paused && !this.querySelector("#play-audio-info") ? (i.appendChild(r), document.addEventListener("click", a)) : document.removeEventListener("click", a);
80
+ }, 500);
81
+ let o = () => {
82
+ this._session.audioStartTime = this._session.audioStartTime || (/* @__PURE__ */ new Date()).getTime();
83
+ let t = this.querySelector("#play-audio-info");
84
+ t && i.removeChild(t), e.removeEventListener("playing", o);
85
+ };
86
+ e.addEventListener("playing", o);
87
+ let s = () => {
88
+ this._session.audioEndTime = this._session.audioEndTime || (/* @__PURE__ */ new Date()).getTime();
89
+ let { audioStartTime: t, audioEndTime: n, waitTime: r } = this._session;
90
+ !r && t && n && (this._session.waitTime = n - t), this.audioComplete = !0, this.dispatchChangedEvent(), e.removeEventListener("ended", s);
91
+ };
92
+ e.addEventListener("ended", s), this._audio = e, this._handlePlaying = o, this._handleEnded = s, this._enableAudio = a, this._audioInitialized = !0, t.disconnect();
93
+ }
94
+ });
95
+ }).observe(this, {
96
+ childList: !0,
97
+ subtree: !0
98
+ });
99
+ }
100
+ disconnectedCallback() {
101
+ document.removeEventListener("click", this._enableAudio), this._audio &&= (this._audio.removeEventListener("playing", this._handlePlaying), this._audio.removeEventListener("ended", this._handleEnded), null), this._root && this._root.unmount();
102
+ }
103
+ };
104
+ //#endregion
105
+ export { h as default, m as isComplete };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/drag-in-the-blank/src/main.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
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Main extends React.Component {
12
+ static propTypes: {
13
+ model: PropTypes.Requireable<object>;
14
+ value: PropTypes.Requireable<object>;
15
+ feedback: PropTypes.Requireable<object>;
16
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
17
+ };
18
+ static defaultProps: {
19
+ value: {};
20
+ };
21
+ state: {
22
+ showCorrectAnswer: boolean;
23
+ };
24
+ toggleShowCorrect: any;
25
+ UNSAFE_componentWillReceiveProps(nextProps: any): void;
26
+ render(): React.JSX.Element;
27
+ }
28
+ export default Main;
29
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/delivery/main.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAqDnC,qBAAa,IAAK,SAAQ,KAAK,CAAC,SAAS;IACvC,MAAM,CAAC,SAAS;;;;;MAKd;IAEF,MAAM,CAAC,YAAY;;MAEjB;IAEF,KAAK;;MAEH;IAEF,iBAAiB,EAAE,GAAG,CAEpB;IAEF,gCAAgC,CAAC,SAAS,KAAA;IAQ1C,MAAM;CAmDP;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,83 @@
1
+ import e from "react";
2
+ import * as t from "@pie-lib/render-ui";
3
+ import { Collapsible as n, PreviewPrompt as r, UiLayout as i, color as a, hasMedia as o, hasText as s } from "@pie-lib/render-ui";
4
+ import c from "prop-types";
5
+ import l from "@pie-lib/correct-answer-toggle";
6
+ import { DragInTheBlank as u } from "@pie-lib/mask-markup";
7
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
+ import { styled as p } from "@mui/material/styles";
9
+ //#region src/delivery/main.tsx
10
+ function m(e) {
11
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
12
+ }
13
+ function h(e, t) {
14
+ return !e || m(e) ? e : m(e.default) ? e.default : t && m(e[t]) ? e[t] : t && m(e[t]?.default) ? e[t].default : e;
15
+ }
16
+ var g = h(i, "UiLayout") || h(x.UiLayout, "UiLayout"), _ = h(r, "PreviewPrompt") || h(x.PreviewPrompt, "PreviewPrompt"), v = h(n, "Collapsible") || h(x.Collapsible, "Collapsible"), y = t, b = y.default, x = b && typeof b == "object" ? b : y, S = p(g)({
17
+ color: a.text(),
18
+ backgroundColor: a.background(),
19
+ "& tr > td": { color: a.text() },
20
+ position: "relative"
21
+ }), C = p(v)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), w = p(v)(({ theme: e }) => ({ marginTop: e.spacing(2) })), T = class extends e.Component {
22
+ static propTypes = {
23
+ model: c.object,
24
+ value: c.object,
25
+ feedback: c.object,
26
+ onChange: c.func
27
+ };
28
+ static defaultProps = { value: {} };
29
+ state = { showCorrectAnswer: !1 };
30
+ toggleShowCorrect = () => {
31
+ this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
32
+ };
33
+ UNSAFE_componentWillReceiveProps(e) {
34
+ let { model: t } = e;
35
+ t && !t.correctResponse && this.state.showCorrectAnswer !== !1 && this.setState({ showCorrectAnswer: !1 });
36
+ }
37
+ render() {
38
+ let { showCorrectAnswer: e } = this.state, { model: t, onChange: n, value: r } = this.props, { extraCSSRules: i, prompt: a, mode: c, language: p, fontSizeFactor: m, autoplayAudioEnabled: h, customAudioButton: g } = t, v = {
39
+ ...t,
40
+ value: r
41
+ }, y = c === "evaluate", b = t.rationale && (s(t.rationale) || o(t.rationale));
42
+ return /* @__PURE__ */ f(S, {
43
+ extraCSSRules: i,
44
+ id: "main-container",
45
+ fontSizeFactor: m,
46
+ children: [
47
+ t.teacherInstructions && (s(t.teacherInstructions) || o(t.teacherInstructions)) && /* @__PURE__ */ d(C, {
48
+ labels: {
49
+ hidden: "Show Teacher Instructions",
50
+ visible: "Hide Teacher Instructions"
51
+ },
52
+ children: /* @__PURE__ */ d(_, { prompt: t.teacherInstructions })
53
+ }),
54
+ a && /* @__PURE__ */ d(_, {
55
+ className: "prompt",
56
+ prompt: a,
57
+ autoplayAudioEnabled: h,
58
+ customAudioButton: g
59
+ }),
60
+ /* @__PURE__ */ d(l, {
61
+ show: y,
62
+ toggled: e,
63
+ onToggle: this.toggleShowCorrect,
64
+ language: p
65
+ }),
66
+ /* @__PURE__ */ d(u, {
67
+ ...v,
68
+ onChange: n,
69
+ showCorrectAnswer: e
70
+ }),
71
+ b && /* @__PURE__ */ d(w, {
72
+ labels: {
73
+ hidden: "Show Rationale",
74
+ visible: "Hide Rationale"
75
+ },
76
+ children: /* @__PURE__ */ d(_, { prompt: t.rationale })
77
+ })
78
+ ]
79
+ });
80
+ }
81
+ };
82
+ //#endregion
83
+ export { T as default };
@@ -0,0 +1,2 @@
1
+ export { default } from './delivery/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * IIFE entry point for drag-in-the-blank element
3
+ * This file is only used for IIFE builds and includes auto-registration
4
+ *
5
+ * @sync-generated - Auto-generated during sync from pie-elements
6
+ */
7
+ import Element from './index.js';
8
+ export default Element;
9
+ //# sourceMappingURL=index.iife.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.iife.d.ts","sourceRoot":"","sources":["../src/index.iife.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAO,MAAM,YAAY,CAAC;AAQjC,eAAe,OAAO,CAAC"}