@pie-element/placement-ordering 14.1.1-next.1 → 14.1.1-next.29

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 (289) hide show
  1. package/CHANGELOG.json +1312 -0
  2. package/CHANGELOG.md +2428 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +57 -0
  5. package/configure/CHANGELOG.json +952 -0
  6. package/configure/CHANGELOG.md +2123 -0
  7. package/configure/lib/choice-editor.js +252 -0
  8. package/configure/lib/choice-editor.js.map +1 -0
  9. package/configure/lib/choice-tile.js +205 -0
  10. package/configure/lib/choice-tile.js.map +1 -0
  11. package/configure/lib/defaults.js +211 -0
  12. package/configure/lib/defaults.js.map +1 -0
  13. package/configure/lib/design.js +427 -0
  14. package/configure/lib/design.js.map +1 -0
  15. package/configure/lib/help.js +14 -0
  16. package/configure/lib/help.js.map +1 -0
  17. package/configure/lib/index.js +155 -0
  18. package/configure/lib/index.js.map +1 -0
  19. package/configure/lib/utils.js +108 -0
  20. package/configure/lib/utils.js.map +1 -0
  21. package/configure/package.json +26 -0
  22. package/controller/CHANGELOG.json +517 -0
  23. package/controller/CHANGELOG.md +1514 -0
  24. package/controller/lib/defaults.js +29 -0
  25. package/controller/lib/defaults.js.map +1 -0
  26. package/controller/lib/index.js +285 -0
  27. package/controller/lib/index.js.map +1 -0
  28. package/controller/lib/scoring.js +109 -0
  29. package/controller/lib/scoring.js.map +1 -0
  30. package/controller/package.json +15 -0
  31. package/docs/config-schema.json +2964 -0
  32. package/docs/config-schema.json.md +2190 -0
  33. package/docs/demo/config.js +8 -0
  34. package/docs/demo/generate.js +50 -0
  35. package/docs/demo/index.html +1 -0
  36. package/docs/demo/session.js +7 -0
  37. package/docs/pie-schema.json +1613 -0
  38. package/docs/pie-schema.json.md +973 -0
  39. package/icon.png +0 -0
  40. package/lib/index.js +122 -0
  41. package/lib/index.js.map +1 -0
  42. package/lib/main.js +32 -0
  43. package/lib/main.js.map +1 -0
  44. package/lib/ordering.js +165 -0
  45. package/lib/ordering.js.map +1 -0
  46. package/lib/placement-ordering.js +419 -0
  47. package/lib/placement-ordering.js.map +1 -0
  48. package/lib/tile.js +259 -0
  49. package/lib/tile.js.map +1 -0
  50. package/lib/tiler.js +165 -0
  51. package/lib/tiler.js.map +1 -0
  52. package/lib/utils.js +18 -0
  53. package/lib/utils.js.map +1 -0
  54. package/package.json +21 -61
  55. package/dist/author/choice-editor.d.ts +0 -39
  56. package/dist/author/choice-editor.js +0 -157
  57. package/dist/author/choice-tile.d.ts +0 -40
  58. package/dist/author/choice-tile.js +0 -132
  59. package/dist/author/defaults.d.ts +0 -213
  60. package/dist/author/defaults.js +0 -159
  61. package/dist/author/design.d.ts +0 -21
  62. package/dist/author/design.js +0 -274
  63. package/dist/author/help.d.ts +0 -11
  64. package/dist/author/index.d.ts +0 -45
  65. package/dist/author/index.js +0 -85
  66. package/dist/author/utils.d.ts +0 -15
  67. package/dist/author/utils.js +0 -62
  68. package/dist/controller/defaults.d.ts +0 -31
  69. package/dist/controller/defaults.js +0 -25
  70. package/dist/controller/index.d.ts +0 -29
  71. package/dist/controller/index.js +0 -128
  72. package/dist/controller/scoring.d.ts +0 -27
  73. package/dist/controller/scoring.js +0 -32
  74. package/dist/delivery/index.d.ts +0 -26
  75. package/dist/delivery/index.js +0 -70
  76. package/dist/delivery/main.d.ts +0 -19
  77. package/dist/delivery/main.js +0 -22
  78. package/dist/delivery/ordering.d.ts +0 -18
  79. package/dist/delivery/ordering.js +0 -96
  80. package/dist/delivery/placement-ordering.d.ts +0 -28
  81. package/dist/delivery/placement-ordering.js +0 -215
  82. package/dist/delivery/tile.d.ts +0 -28
  83. package/dist/delivery/tile.js +0 -165
  84. package/dist/delivery/tiler.d.ts +0 -42
  85. package/dist/delivery/tiler.js +0 -89
  86. package/dist/delivery/utils.d.ts +0 -9
  87. package/dist/delivery/utils.js +0 -8
  88. package/dist/index.d.ts +0 -1
  89. package/dist/index.iife.d.ts +0 -8
  90. package/dist/index.iife.js +0 -152
  91. package/dist/index.js +0 -2
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js +0 -7
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +0 -8
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +0 -23
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +0 -10
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +0 -11
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +0 -7
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseShuffle.js +0 -8
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +0 -9
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +0 -15
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shuffleSelf.js +0 -12
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  240. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  241. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  242. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  243. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  244. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
  245. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  246. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  247. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  248. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js +0 -16
  249. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  250. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js +0 -10
  251. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  252. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  253. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +0 -10
  254. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
  255. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  256. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js +0 -12
  257. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
  258. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
  259. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  260. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  261. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  262. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  263. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  264. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  265. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  266. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  267. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  268. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  269. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  270. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  271. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  272. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  273. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  274. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  275. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  276. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  277. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
  278. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
  279. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  280. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
  281. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
  282. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
  283. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +0 -9
  284. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  285. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  286. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
  287. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
  288. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
  289. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +0 -8
@@ -1,128 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js";
3
- import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js";
4
- import r from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
5
- import i from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
6
- import a from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js";
7
- import { flattenCorrect as o, getAllCorrectResponses as s, score as c } from "./scoring.js";
8
- import l from "./defaults.js";
9
- import u from "debug";
10
- import d from "@pie-lib/translator";
11
- import { getFeedbackForCorrectness as f } from "@pie-element/shared-feedback";
12
- import { partialScoring as p } from "@pie-element/shared-controller-utils";
13
- //#region src/controller/index.ts
14
- var m = u("@pie-element:placement-ordering:controller"), { translator: h } = d, g = () => /* @__PURE__ */ Error("Question is missing required array: correctResponse"), _ = (e, t, n) => {
15
- let r = [], a = t?.value || [];
16
- e?.correctResponse;
17
- let o = e?.placementArea === !0;
18
- if (!a.length) return o ? r.push("Student did not place any tiles in the target area.") : r.push("Student did not reorder any tiles."), r.push("Final score: 0."), r;
19
- let l = s(e), u = {
20
- score: 0,
21
- response: []
22
- };
23
- l.forEach((e) => {
24
- let t = 0;
25
- a.forEach((n, r) => {
26
- e[r] === n && t++;
27
- }), t > u.score && (u = {
28
- score: t,
29
- response: e
30
- });
31
- });
32
- let d = u.score, f = a.length - d;
33
- d > 0 && r.push(`${d} tile(s) placed in the correct order.`), f > 0 && r.push(`${f} tile(s) placed in an incorrect order.`), l.some((e) => i(e, a));
34
- let m = p.enabled(e, n || {});
35
- m ? (r.push("Score calculated using partial scoring."), r.push("Each tile placed in the correct position contributes to the score.")) : (r.push("Score calculated using all-or-nothing scoring."), o ? r.push("Student must place all tiles in the correct positions within the target area to receive full credit.") : r.push("Student must arrange all tiles in the correct order to receive full credit."));
36
- let h = c(e, t), g = m ? h : +(h === 1);
37
- return r.push(`Final score: ${g}.`), r;
38
- };
39
- function v(e, t, n) {
40
- return new Promise((i, a) => {
41
- if (!t || r(t)) {
42
- i({
43
- score: 0,
44
- empty: !0,
45
- logTrace: ["Student did not interact with the placement-ordering item."]
46
- });
47
- return;
48
- }
49
- if (!e || !e.correctResponse || r(e.correctResponse)) a(g());
50
- else try {
51
- let r = c(e, t);
52
- i({
53
- score: p.enabled(e, n || {}) ? r : +(r === 1),
54
- logTrace: _(e, t, n)
55
- });
56
- } catch (e) {
57
- a(e);
58
- }
59
- });
60
- }
61
- function y(e = {}) {
62
- return new Promise((t) => {
63
- t({
64
- ...l,
65
- ...e
66
- });
67
- });
68
- }
69
- var b = (e) => ({
70
- ...l,
71
- rationaleEnabled: !0,
72
- feedbackEnabled: !1,
73
- promptEnabled: !0,
74
- teacherInstructionsEnabled: !0,
75
- studentInstructionsEnabled: !0,
76
- ...e
77
- });
78
- async function x(r, l, u) {
79
- let d = b(r), g = {};
80
- if (r.alternateResponses && t(r.alternateResponses, e) && (m("Deprecated structure of alternateResponses is in use"), console.error("Deprecated structure of alternateResponses is in use")), g.env = u, g.extraCSSRules = d.extraCSSRules, g.outcomes = [], g.completeLength = (d.correctResponse || []).length, g.choices = (d.choices || []).filter((e) => e.label), g.note = d.note, g.showNote = d.alternateResponses && d.alternateResponses.length > 0, g.language = d.language, m("[model] removing tileSize for the moment."), g.prompt = d.promptEnabled ? d.prompt : null, g.config = {
81
- orientation: d.orientation || "vertical",
82
- includeTargets: d.placementArea,
83
- choiceLabelEnabled: d.choiceLabelEnabled,
84
- targetLabel: d.targetLabel,
85
- choiceLabel: d.choiceLabel,
86
- showOrdering: d.numberedGuides,
87
- allowSameChoiceInTargets: !d.removeTilesAfterPlacing
88
- }, g.disabled = u.mode !== "gather", g.note ||= h.t("common:commonCorrectAnswerWithAlternates", { lng: d.language }), u.role === "instructor" && (u.mode === "view" || u.mode === "evaluate") ? (g.rationale = d.rationaleEnabled ? d.rationale : null, g.teacherInstructions = d.teacherInstructionsEnabled ? d.teacherInstructions : null) : (g.rationale = null, g.teacherInstructions = null), u.mode === "evaluate") {
89
- let e = l && l.value || [], t = s(d), m = t.reduce((t, n) => {
90
- let r = a(e, (e, t, r) => e + (Array.isArray(n) && n[r] === t ? 1 : 0), 0);
91
- return r > t.score ? {
92
- arr: n,
93
- score: r
94
- } : t;
95
- }, {
96
- arr: [],
97
- score: 0
98
- });
99
- g.outcomes = n(e, (e, t) => ({
100
- id: e,
101
- outcome: m.arr[t] === e ? "correct" : "incorrect"
102
- }));
103
- let h = t.some((t) => i(t, e)), _ = c(r, l), v = _ === 1, y = !v && p.enabled(d, u || {}) && _ !== 0;
104
- return g.correctness = v ? "correct" : y ? "partial" : "incorrect", h || (g.correctResponse = o(d)), d.feedback || (d.feedbackEnabled = !1), g.feedback = d.feedbackEnabled ? await f(g.correctness, d.feedback) : void 0, g;
105
- } else return g;
106
- }
107
- var S = (e, t) => new Promise((n) => {
108
- t.mode !== "evaluate" && t.role === "instructor" ? n({
109
- id: "1",
110
- value: o(e)
111
- }) : n(null);
112
- }), C = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), w = (e = {}, t = {}) => {
113
- let { choices: n, correctResponse: a } = e, o = {};
114
- [
115
- "teacherInstructions",
116
- "prompt",
117
- "rationale"
118
- ].forEach((n) => {
119
- t[n]?.required && !C(e[n]) && (o[n] = "This field is required.");
120
- });
121
- let s = [...n || []].reverse(), c = {};
122
- return s.forEach((e, t) => {
123
- let { id: n, label: r } = e;
124
- C(r) ? s.slice(t + 1).some((e) => e.label === r) && (c[n] = "Content should be unique.") : c[n] = "Content should not be empty.";
125
- }), i((n || []).map((e) => e.id), (a || []).map((e) => e.id || e)) && (o.orderError = "The correct ordering should not be identical to the initial ordering."), r(c) || (o.choicesErrors = c), o;
126
- };
127
- //#endregion
128
- export { S as createCorrectResponseSession, y as createDefaultModel, _ as getLogTrace, x as model, b as normalize, v as outcome, g as questionError, w as validate };
@@ -1,27 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/placement-ordering/controller/src/scoring.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 illegalArgumentError: (answer: any) => Error;
10
- export declare const pairwiseCombinationScore: (correct: any, answer: any, opts: any) => number;
11
- /**
12
- * Flattens the correctResponse into an array of ordered identifiers representing the
13
- * correct response.
14
- */
15
- export declare const flattenCorrect: (question: any) => any;
16
- /**
17
- * Returns all correct responses for this question
18
- * @param question - array
19
- */
20
- export declare const getAllCorrectResponses: (question: any) => any[];
21
- /**
22
- * Returns the score for a session. If weighted scoring is present in the correctResponse
23
- * field for the question, this will be used. If partial scoring is present in the question
24
- * model, this will be used. Otherwise the default scoring mechanism (0 for any incorrect, 1
25
- * for all correct) will be used.
26
- */
27
- export declare const score: (question: any, session: any) => number;
@@ -1,32 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
3
- import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js";
4
- import r from "debug";
5
- import { combination as i } from "js-combinatorics";
6
- //#region src/controller/scoring.ts
7
- var a = r("pie-elements:placement-ordering:controller"), o = (e) => /* @__PURE__ */ Error(`Cant score answer: ${e} it has duplicates and allowDuplicates is false`), s = (r, s, c) => {
8
- if (c = {
9
- allowDuplicates: !1,
10
- orderMustBeComplete: !1,
11
- ...c
12
- }, !c.allowDuplicates && !t(n(r), r)) throw o(s);
13
- if (c.allowDuplicates === !1 && s.length !== n(s).length) return 0;
14
- if (s = c.allowDuplicates === !1 ? n(s) : s, a("answer:", s), !Array.isArray(r) || r.length === 0) throw Error("correct must be non empty an array");
15
- if (r.length === 1) return +!!t(r, s);
16
- if (!Array.isArray(s) || s.length < 2 || s.length > r.length || r.length !== s.length && c.orderMustBeComplete) return 0;
17
- let l = i(r, 2).toArray(), u = i(s, 2).toArray(), d = e(u, l, t), f = l.length - u.length, p = l.length, m = ((p - d.length - f) / p).toFixed(2);
18
- return parseFloat(m);
19
- }, c = (e) => e.correctResponse ? e.correctResponse.map((e) => e && e.id ? e.id : e) : [], l = (e) => {
20
- let t = (e.alternateResponses || []).map((e) => Array.isArray(e) ? e : e.response).filter((e) => e !== void 0);
21
- return [c(e), ...t];
22
- }, u = (e, t) => {
23
- let { value: n } = t || {};
24
- if (!n) return 0;
25
- let r = l(e), i = (e.configure && e.configure.removeTilesAfterPlacing) !== !1, a = 0;
26
- return r.forEach((e) => {
27
- let t = s(e, n, { allowDuplicates: i });
28
- t >= a && (a = t);
29
- }), a;
30
- };
31
- //#endregion
32
- export { c as flattenCorrect, l as getAllCorrectResponses, u as score };
@@ -1,26 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/placement-ordering/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 isValidSession: ({ model, session }: {
10
- model: any;
11
- session: any;
12
- }) => any;
13
- export default class Ordering extends HTMLElement {
14
- constructor();
15
- _scheduleMathRender: any;
16
- _initMathObserver(): void;
17
- _disconnectMathObserver(): void;
18
- isComplete: (value: any) => any;
19
- sessionChange: any;
20
- set model(newModel: any);
21
- set session(newSession: any);
22
- get session(): any;
23
- render(): void;
24
- connectedCallback(): void;
25
- disconnectedCallback(): void;
26
- }
@@ -1,70 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js";
2
- import t from "./main.js";
3
- import n from "react";
4
- import { createRoot as r } from "react-dom/client";
5
- import i from "debug";
6
- import { renderMath as a } from "@pie-element/shared-math-rendering-mathjax";
7
- import { SessionChangedEvent as o } from "@pie-element/shared-player-events";
8
- //#region src/delivery/index.ts
9
- var s = i("pie-elements:placement-ordering"), c = ({ model: t, session: n }) => {
10
- let { config: r } = t, i = (n && e(n.value) || []).length === t.choices.length;
11
- return r.includeTargets || i;
12
- }, l = class extends HTMLElement {
13
- constructor() {
14
- super(), this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
15
- }
16
- _scheduleMathRender = () => {
17
- this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
18
- this._mathObserver && this._mathObserver.disconnect(), a(this), this._mathRenderPending = !1, setTimeout(() => {
19
- this._mathObserver && this._mathObserver.observe(this, {
20
- childList: !0,
21
- subtree: !0
22
- });
23
- }, 50);
24
- }));
25
- };
26
- _initMathObserver() {
27
- this._mathObserver || (this._mathObserver = new MutationObserver(this._scheduleMathRender), this._mathObserver.observe(this, {
28
- childList: !0,
29
- subtree: !0
30
- }));
31
- }
32
- _disconnectMathObserver() {
33
- this._mathObserver &&= (this._mathObserver.disconnect(), null);
34
- }
35
- isComplete = (t) => t && e(t).length === this._model.completeLength;
36
- sessionChange = (e) => {
37
- this._session.value = e.value, this.render(), this.dispatchEvent(new o(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)));
38
- };
39
- set model(e) {
40
- this._model = e, this.render(), this.dispatchEvent(new CustomEvent("model-set", {
41
- bubbles: !0,
42
- detail: { complete: !1 }
43
- }));
44
- }
45
- set session(e) {
46
- this._session = e, this.render();
47
- }
48
- get session() {
49
- return this._session;
50
- }
51
- render() {
52
- if (this._model && this._session) {
53
- s("[render] session: ", this._session.value), s("[render] model: ", this._model), this._initMathObserver();
54
- let e = n.createElement(t, {
55
- model: this._model,
56
- session: this._session,
57
- onSessionChange: this.sessionChange
58
- });
59
- this._root ||= r(this), this._root.render(e);
60
- }
61
- }
62
- connectedCallback() {
63
- this._initMathObserver();
64
- }
65
- disconnectedCallback() {
66
- this._disconnectMathObserver(), this._root && this._root.unmount();
67
- }
68
- };
69
- //#endregion
70
- export { l as default, c as isValidSession };
@@ -1,19 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/placement-ordering/src/main.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- declare class Main extends React.Component {
12
- static propTypes: {
13
- model: PropTypes.Validator<object>;
14
- session: PropTypes.Requireable<object>;
15
- onSessionChange: PropTypes.Validator<(...args: any[]) => any>;
16
- };
17
- render(): React.JSX.Element;
18
- }
19
- export default Main;
@@ -1,22 +0,0 @@
1
- import e from "./placement-ordering.js";
2
- import t from "react";
3
- import n from "prop-types";
4
- import { jsx as r } from "react/jsx-runtime";
5
- //#region src/delivery/main.tsx
6
- var i = class extends t.Component {
7
- static propTypes = {
8
- model: n.object.isRequired,
9
- session: n.oneOfType([n.array.isRequired, n.object.isRequired]),
10
- onSessionChange: n.func.isRequired
11
- };
12
- render() {
13
- let { model: t, session: n, onSessionChange: i } = this.props;
14
- return /* @__PURE__ */ r(e, {
15
- model: t,
16
- session: n,
17
- onSessionChange: i
18
- });
19
- }
20
- };
21
- //#endregion
22
- export { i as default };
@@ -1,18 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/placement-ordering/src/ordering.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 push: (arr: any, fromIndex: any, toIndex: any) => any[];
10
- export declare const swap: (arr: any, fromIndex: any, toIndex: any) => any;
11
- export declare function buildState(choices: any, response: any, outcomes: any, opts: any): {
12
- choices: any;
13
- response: any;
14
- opts: any;
15
- outcomes: any;
16
- tiles: any;
17
- };
18
- export declare function reducer(action: any, state: any): any;
@@ -1,96 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js";
3
- import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js";
4
- import r from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
5
- import i from "debug";
6
- //#region src/delivery/ordering.ts
7
- var a = i("pie-elements:placement-ordering:ordering"), o = (e, t, n) => {
8
- let r = e.find((e, n) => n === t), i = e.filter((e, n) => n !== t);
9
- return [
10
- ...i.slice(0, n),
11
- r,
12
- ...i.slice(n)
13
- ];
14
- }, s = (e, n, r) => {
15
- if (a("[swap]", e, n, r), !e || e.length <= 1 || n === void 0 || r === void 0) throw Error(`swap requires a non-empty array, fromIndex, toIndex: ${e}, ${n} ${r}`);
16
- let i = t(e), o = e[r];
17
- return i[r] = i[n], i[n] = o, i;
18
- };
19
- function c(e, n) {
20
- let r = t(e.response);
21
- if (r[n.index] === n.id) r[n.index] = void 0;
22
- else throw Error(`Tried to remove from index: ${n.index}, but the id doesn't match: array: ${r}, target: ${n.id}`);
23
- return r;
24
- }
25
- function l(e, n, r) {
26
- let { response: i, opts: c } = e, l = t(i);
27
- if (c.includeTargets) return n.type === "choice" && r.type === "target" ? (l[r.index] = n.id, l) : n.type === "target" && r.type === "choice" ? (l[n.index] = void 0, l) : n.type === "target" && r.type === "target" ? s(i, n.index, r.index) : (a("do nothing to the response"), i);
28
- {
29
- let t = e.response.findIndex((e) => e !== void 0 && e === n.id), i = e.response.findIndex((e) => e !== void 0 && e === r.id);
30
- return a("fromIndex: ", t, "toIndex:", i), o(e.response, t, i);
31
- }
32
- }
33
- function u(e, t, n, r) {
34
- if (r.includeTargets) {
35
- let i = [];
36
- for (let r = 0; r < t.length; r++) {
37
- let a = t[r], o = e.find((e) => a != null && e.id === a), s = n[r], c = Object.assign({
38
- type: "target",
39
- index: r,
40
- empty: o === void 0
41
- }, o, s, { draggable: o !== void 0 });
42
- i.push(c);
43
- }
44
- return e.map((e) => t.indexOf(e.id) !== -1 && !r.allowSameChoiceInTargets ? {
45
- type: "choice",
46
- empty: !0,
47
- droppable: !0,
48
- draggable: !1
49
- } : Object.assign({}, e, {
50
- type: "choice",
51
- droppable: !1,
52
- draggable: !0
53
- })).concat(i);
54
- } else return t.reduce((t, r, i) => {
55
- let a = Object.assign({
56
- type: "empty",
57
- draggable: !1,
58
- droppable: !0
59
- }, e.find((e) => e.id === r), n[i]), o = Object.assign({
60
- type: "choice",
61
- draggable: !0,
62
- droppable: !0
63
- }, e.find((e) => e.id === r), n[i]);
64
- return i === 0 && t.push(a), t.push(o, a), t;
65
- }, []);
66
- }
67
- function d(t, i, a, o) {
68
- return o = e({ includeTargets: !0 }, o), a ||= [], i = !i || r(i) ? o.includeTargets ? Array(t.length) : n(t, (e) => e.id) : i, {
69
- choices: t,
70
- response: i,
71
- opts: o,
72
- outcomes: a,
73
- tiles: u(t, i, a, o)
74
- };
75
- }
76
- function f(e, t) {
77
- switch (e.type) {
78
- case "move": {
79
- let { from: n, to: r } = e, i = l(t, n, r), a = u(t.choices, i, t.outcomes, t.opts);
80
- return Object.assign({}, t, {
81
- response: i,
82
- tiles: a
83
- });
84
- }
85
- case "remove": {
86
- let { target: n } = e, r = c(t, n), i = u(t.choices, r, t.outcomes, t.opts);
87
- return Object.assign({}, t, {
88
- response: r,
89
- tiles: i
90
- });
91
- }
92
- }
93
- return t;
94
- }
95
- //#endregion
96
- export { d as buildState, f as reducer };
@@ -1,28 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/placement-ordering/src/placement-ordering.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- export declare class PlacementOrdering extends React.Component {
12
- static propTypes: {
13
- onSessionChange: PropTypes.Validator<(...args: any[]) => any>;
14
- model: PropTypes.Validator<object>;
15
- session: PropTypes.Requireable<object>;
16
- };
17
- constructor(props: any);
18
- toggleCorrect: (showingCorrect: any) => void;
19
- componentDidUpdate(): void;
20
- validateSession: any;
21
- UNSAFE_componentWillReceiveProps(nextProps: any): void;
22
- onDropChoice: any;
23
- onRemoveChoice: any;
24
- createOrdering: any;
25
- onDragEnd: any;
26
- render(): React.JSX.Element;
27
- }
28
- export default PlacementOrdering;