@pie-element/placement-ordering 14.1.1 → 14.1.2-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/choice-editor.d.ts +39 -0
  4. package/dist/author/choice-editor.js +157 -0
  5. package/dist/author/choice-tile.d.ts +40 -0
  6. package/dist/author/choice-tile.js +132 -0
  7. package/dist/author/defaults.d.ts +213 -0
  8. package/dist/author/defaults.js +159 -0
  9. package/dist/author/design.d.ts +21 -0
  10. package/dist/author/design.js +274 -0
  11. package/dist/author/help.d.ts +11 -0
  12. package/dist/author/index.d.ts +45 -0
  13. package/dist/author/index.js +85 -0
  14. package/dist/author/utils.d.ts +15 -0
  15. package/dist/author/utils.js +62 -0
  16. package/dist/browser/author/index.js +40986 -0
  17. package/dist/browser/author/index.js.map +1 -0
  18. package/dist/browser/browser-CvJkn_Ec.js +1019 -0
  19. package/dist/browser/browser-CvJkn_Ec.js.map +1 -0
  20. package/dist/browser/controller/index.js +319 -0
  21. package/dist/browser/controller/index.js.map +1 -0
  22. package/dist/browser/delivery/index.js +1032 -0
  23. package/dist/browser/delivery/index.js.map +1 -0
  24. package/dist/browser/dist-BTHiIs74.js +1610 -0
  25. package/dist/browser/dist-BTHiIs74.js.map +1 -0
  26. package/dist/browser/drag-provider-DaPxkh4j.js +10833 -0
  27. package/dist/browser/drag-provider-DaPxkh4j.js.map +1 -0
  28. package/dist/browser/last-D7N4Qfx4.js +9 -0
  29. package/dist/browser/last-D7N4Qfx4.js.map +1 -0
  30. package/dist/browser/placement-ordering.css +2 -0
  31. package/dist/controller/defaults.d.ts +31 -0
  32. package/dist/controller/defaults.js +25 -0
  33. package/dist/controller/index.d.ts +29 -0
  34. package/dist/controller/index.js +128 -0
  35. package/dist/controller/scoring.d.ts +27 -0
  36. package/dist/controller/scoring.js +32 -0
  37. package/dist/delivery/index.d.ts +26 -0
  38. package/dist/delivery/index.js +70 -0
  39. package/dist/delivery/main.d.ts +19 -0
  40. package/dist/delivery/main.js +22 -0
  41. package/dist/delivery/ordering.d.ts +18 -0
  42. package/dist/delivery/ordering.js +96 -0
  43. package/dist/delivery/placement-ordering.d.ts +28 -0
  44. package/dist/delivery/placement-ordering.js +215 -0
  45. package/dist/delivery/tile.d.ts +28 -0
  46. package/dist/delivery/tile.js +165 -0
  47. package/dist/delivery/tiler.d.ts +42 -0
  48. package/dist/delivery/tiler.js +89 -0
  49. package/dist/delivery/utils.d.ts +9 -0
  50. package/dist/delivery/utils.js +8 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.iife.d.ts +8 -0
  53. package/dist/index.iife.js +152 -0
  54. package/dist/index.js +2 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +11 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js +7 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +7 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +7 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +7 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +8 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +7 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +23 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +6 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +10 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +7 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +13 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +5 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +8 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +10 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +6 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +9 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +8 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +26 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +6 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +11 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +11 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +12 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +7 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +8 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseShuffle.js +8 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +15 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +27 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +6 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +10 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +15 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +12 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +12 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +9 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +35 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +35 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +32 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +16 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +18 -0
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +10 -0
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +11 -0
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +7 -0
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +9 -0
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +11 -0
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +7 -0
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +6 -0
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +9 -0
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shuffleSelf.js +12 -0
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +7 -0
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +10 -0
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +10 -0
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js +16 -0
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js +10 -0
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +10 -0
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +12 -0
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js +12 -0
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +8 -0
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +8 -0
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +7 -0
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  240. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +7 -0
  241. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +10 -0
  242. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +16 -0
  243. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +4 -0
  244. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +10 -0
  245. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +12 -0
  246. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +9 -0
  247. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  248. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  249. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +7 -0
  250. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +7 -0
  251. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +9 -0
  252. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +8 -0
  253. package/package.json +81 -17
  254. package/CHANGELOG.json +0 -1312
  255. package/CHANGELOG.md +0 -2432
  256. package/LICENSE.md +0 -5
  257. package/README.md +0 -57
  258. package/configure/CHANGELOG.json +0 -952
  259. package/configure/CHANGELOG.md +0 -2127
  260. package/configure/lib/choice-editor.js +0 -252
  261. package/configure/lib/choice-editor.js.map +0 -1
  262. package/configure/lib/choice-tile.js +0 -205
  263. package/configure/lib/choice-tile.js.map +0 -1
  264. package/configure/lib/defaults.js +0 -211
  265. package/configure/lib/defaults.js.map +0 -1
  266. package/configure/lib/design.js +0 -427
  267. package/configure/lib/design.js.map +0 -1
  268. package/configure/lib/help.js +0 -14
  269. package/configure/lib/help.js.map +0 -1
  270. package/configure/lib/index.js +0 -155
  271. package/configure/lib/index.js.map +0 -1
  272. package/configure/lib/utils.js +0 -108
  273. package/configure/lib/utils.js.map +0 -1
  274. package/configure/package.json +0 -26
  275. package/controller/CHANGELOG.json +0 -517
  276. package/controller/CHANGELOG.md +0 -1518
  277. package/controller/lib/defaults.js +0 -29
  278. package/controller/lib/defaults.js.map +0 -1
  279. package/controller/lib/index.js +0 -285
  280. package/controller/lib/index.js.map +0 -1
  281. package/controller/lib/scoring.js +0 -109
  282. package/controller/lib/scoring.js.map +0 -1
  283. package/controller/package.json +0 -15
  284. package/docs/config-schema.json +0 -2964
  285. package/docs/config-schema.json.md +0 -2190
  286. package/docs/demo/config.js +0 -8
  287. package/docs/demo/generate.js +0 -50
  288. package/docs/demo/index.html +0 -1
  289. package/docs/demo/session.js +0 -7
  290. package/docs/pie-schema.json +0 -1613
  291. package/docs/pie-schema.json.md +0 -973
  292. package/icon.png +0 -0
  293. package/lib/index.js +0 -122
  294. package/lib/index.js.map +0 -1
  295. package/lib/main.js +0 -32
  296. package/lib/main.js.map +0 -1
  297. package/lib/ordering.js +0 -165
  298. package/lib/ordering.js.map +0 -1
  299. package/lib/placement-ordering.js +0 -419
  300. package/lib/placement-ordering.js.map +0 -1
  301. package/lib/tile.js +0 -259
  302. package/lib/tile.js.map +0 -1
  303. package/lib/tiler.js +0 -165
  304. package/lib/tiler.js.map +0 -1
  305. package/lib/utils.js +0 -18
  306. package/lib/utils.js.map +0 -1
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/placement-ordering/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
+ choiceLabel: string;
11
+ choiceLabelEnabled: boolean;
12
+ choices: never[];
13
+ correctResponse: never[];
14
+ feedbackEnabled: boolean;
15
+ numberedGuides: boolean;
16
+ orientation: string;
17
+ partialScoring: boolean;
18
+ placementArea: boolean;
19
+ prompt: string;
20
+ promptEnabled: boolean;
21
+ rationale: string;
22
+ rationaleEnabled: boolean;
23
+ removeTilesAfterPlacing: boolean;
24
+ scoringType: string;
25
+ studentInstructionsEnabled: boolean;
26
+ targetLabel: string;
27
+ teacherInstructions: string;
28
+ teacherInstructionsEnabled: boolean;
29
+ toolbarEditorPosition: string;
30
+ };
31
+ export default _default;
@@ -0,0 +1,25 @@
1
+ //#region src/controller/defaults.ts
2
+ var e = {
3
+ choiceLabel: "",
4
+ choiceLabelEnabled: !0,
5
+ choices: [],
6
+ correctResponse: [],
7
+ feedbackEnabled: !1,
8
+ numberedGuides: !1,
9
+ orientation: "vertical",
10
+ partialScoring: !0,
11
+ placementArea: !1,
12
+ prompt: "",
13
+ promptEnabled: !0,
14
+ rationale: "",
15
+ rationaleEnabled: !0,
16
+ removeTilesAfterPlacing: !0,
17
+ scoringType: "auto",
18
+ studentInstructionsEnabled: !0,
19
+ targetLabel: "",
20
+ teacherInstructions: "",
21
+ teacherInstructionsEnabled: !0,
22
+ toolbarEditorPosition: "bottom"
23
+ };
24
+ //#endregion
25
+ export { e as default };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/placement-ordering/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 questionError: () => Error;
10
+ /**
11
+ * Generates detailed trace log for placement-ordering scoring evaluation
12
+ * @param {Object} question - the question model
13
+ * @param {Object} session - the student session
14
+ * @param {Object} env - the environment
15
+ * @returns {Array<string>} traceLog
16
+ */
17
+ export declare const getLogTrace: (question: any, session: any, env: any) => string[];
18
+ export declare function outcome(question: any, session: any, env: any): Promise<unknown>;
19
+ export declare function createDefaultModel(model?: {}): Promise<unknown>;
20
+ export declare const normalize: (question: any) => any;
21
+ /**
22
+ *
23
+ * @param {*} question
24
+ * @param {*} session
25
+ * @param {*} env
26
+ */
27
+ export declare function model(question: any, session: any, env: any): Promise<{}>;
28
+ export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
29
+ export declare const validate: (model?: {}, config?: {}) => {};
@@ -0,0 +1,128 @@
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 };
@@ -0,0 +1,27 @@
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;
@@ -0,0 +1,32 @@
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 };
@@ -0,0 +1,26 @@
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
+ }
@@ -0,0 +1,70 @@
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 };
@@ -0,0 +1,19 @@
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;
@@ -0,0 +1,22 @@
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 };
@@ -0,0 +1,18 @@
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;
@@ -0,0 +1,96 @@
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 };
@@ -0,0 +1,28 @@
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;