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

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 (239) hide show
  1. package/dist/author/choice-editor.js +16 -17
  2. package/dist/author/choice-tile.js +3 -2
  3. package/dist/author/design.js +50 -51
  4. package/dist/author/index.d.ts +1 -0
  5. package/dist/author/index.js +25 -22
  6. package/dist/author/utils.js +1 -1
  7. package/dist/browser/author/index.js +23612 -21053
  8. package/dist/browser/author/index.js.map +1 -1
  9. package/dist/browser/browser-Bd36Xf5z.js +376 -0
  10. package/dist/browser/browser-Bd36Xf5z.js.map +1 -0
  11. package/dist/browser/controller/index.js +87 -164
  12. package/dist/browser/controller/index.js.map +1 -1
  13. package/dist/browser/delivery/index.js +476 -336
  14. package/dist/browser/delivery/index.js.map +1 -1
  15. package/dist/browser/{dist-BTHiIs74.js → dist-DiGNNRzu.js} +354 -538
  16. package/dist/browser/dist-DiGNNRzu.js.map +1 -0
  17. package/dist/browser/{drag-provider-DaPxkh4j.js → drag-provider-B5wazJHM.js} +3284 -3615
  18. package/dist/browser/drag-provider-B5wazJHM.js.map +1 -0
  19. package/dist/controller/index.js +44 -49
  20. package/dist/controller/scoring.js +2 -4
  21. package/dist/delivery/index.js +12 -12
  22. package/dist/delivery/keyboard-coordinates.d.ts +47 -0
  23. package/dist/delivery/keyboard-coordinates.js +51 -0
  24. package/dist/delivery/main.js +1 -1
  25. package/dist/delivery/ordering.js +4 -6
  26. package/dist/delivery/placement-ordering.d.ts +11 -0
  27. package/dist/delivery/placement-ordering.js +175 -105
  28. package/dist/delivery/tile.d.ts +3 -0
  29. package/dist/delivery/tile.js +66 -57
  30. package/dist/delivery/tiler.d.ts +6 -0
  31. package/dist/delivery/tiler.js +6 -3
  32. package/dist/index.iife.js +35 -35
  33. package/dist/runtime-support.d.ts +12 -0
  34. package/dist/runtime-support.js +12 -0
  35. package/package.json +22 -18
  36. package/dist/browser/browser-CvJkn_Ec.js +0 -1019
  37. package/dist/browser/browser-CvJkn_Ec.js.map +0 -1
  38. package/dist/browser/dist-BTHiIs74.js.map +0 -1
  39. package/dist/browser/drag-provider-DaPxkh4j.js.map +0 -1
  40. package/dist/browser/last-D7N4Qfx4.js +0 -9
  41. package/dist/browser/last-D7N4Qfx4.js.map +0 -1
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js +0 -7
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +0 -8
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +0 -23
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +0 -10
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +0 -11
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +0 -7
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseShuffle.js +0 -8
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +0 -9
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +0 -15
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shuffleSelf.js +0 -12
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js +0 -16
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js +0 -10
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +0 -10
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js +0 -12
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +0 -9
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +0 -8
@@ -1,84 +1,108 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.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/uniqueId.js";
4
- import { HorizontalTiler as r, VerticalTiler as i } from "./tiler.js";
5
- import { buildState as a, reducer as o } from "./ordering.js";
6
- import { haveSameValuesButDifferentOrder as s } from "./utils.js";
7
- import c from "react";
8
- import l from "debug";
9
- import { renderMath as u } from "@pie-element/shared-math-rendering-mathjax";
10
- import d from "prop-types";
11
- import f from "react-dom";
12
- import { styled as p } from "@mui/material/styles";
13
- import { closestCenter as m } from "@dnd-kit/core";
14
- import * as h from "@pie-lib/render-ui";
15
- import { Collapsible as g, Feedback as _, PreviewPrompt as v, UiLayout as y, color as b, hasMedia as x, hasText as S } from "@pie-lib/render-ui";
16
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
17
- import T from "@pie-lib/translator";
18
- import E from "@pie-lib/correct-answer-toggle";
19
- import { DragProvider as D } from "@pie-lib/drag";
1
+ import { HorizontalTiler as e, VerticalTiler as t } from "./tiler.js";
2
+ import { buildState as n, reducer as r } from "./ordering.js";
3
+ import { haveSameValuesButDifferentOrder as i } from "./utils.js";
4
+ import { closestDroppableKeyboardCoordinates as a } from "./keyboard-coordinates.js";
5
+ import o from "react";
6
+ import { difference as s, isEqual as c, uniqueId as l } from "@pie-element/shared-lodash";
7
+ import u from "debug";
8
+ import { renderMath as d } from "@pie-element/shared-math-rendering-mathjax";
9
+ import f from "prop-types";
10
+ import p from "react-dom";
11
+ import { styled as m } from "@mui/material/styles";
12
+ import { rectIntersection as h } from "@dnd-kit/core";
13
+ import { restrictToParentElement as g } from "@dnd-kit/modifiers";
14
+ import * as _ from "@pie-lib/render-ui";
15
+ import { Collapsible as v, Feedback as y, PreviewPrompt as b, UiLayout as x, color as S, hasMedia as C, hasText as w } from "@pie-lib/render-ui";
16
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
17
+ import D from "@pie-lib/translator";
18
+ import O from "@pie-lib/correct-answer-toggle";
19
+ import { DragProvider as k } from "@pie-lib/drag";
20
20
  //#region src/delivery/placement-ordering.tsx
21
- function O(e) {
21
+ function A(e) {
22
22
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
23
23
  }
24
- function k(e, t) {
25
- return !e || O(e) ? e : O(e.default) ? e.default : t && O(e[t]) ? e[t] : t && O(e[t]?.default) ? e[t].default : e;
24
+ function j(e, t) {
25
+ return !e || A(e) ? e : A(e.default) ? e.default : t && A(e[t]) ? e[t] : t && A(e[t]?.default) ? e[t].default : e;
26
26
  }
27
- var A = k(y, "UiLayout") || k(I.UiLayout, "UiLayout"), j = k(v, "PreviewPrompt") || k(I.PreviewPrompt, "PreviewPrompt"), M = k(_, "Feedback") || k(I.Feedback, "Feedback"), N = k(g, "Collapsible") || k(I.Collapsible, "Collapsible"), P = h, F = P.default, I = F && typeof F == "object" ? F : P, { translator: L } = T, R = l("pie-elements:placement-ordering"), z = p("div")({
28
- color: b.text(),
29
- backgroundColor: b.background(),
27
+ var M = j(x, "UiLayout") || j(R.UiLayout, "UiLayout"), N = j(b, "PreviewPrompt") || j(R.PreviewPrompt, "PreviewPrompt"), P = j(y, "Feedback") || j(R.Feedback, "Feedback"), F = j(v, "Collapsible") || j(R.Collapsible, "Collapsible"), I = _, L = I.default, R = L && typeof L == "object" ? L : I, z = 250, B = (e, t) => {
28
+ if (!e || !t) return !1;
29
+ let n = t.left + t.width / 2, r = t.top + t.height / 2;
30
+ return n >= e.left && n <= e.right && r >= e.top && r <= e.bottom;
31
+ }, V = (e) => e ? {
32
+ keyboardCoordinateGetter: a,
33
+ keyboardCodes: {
34
+ start: ["Space", "Enter"],
35
+ cancel: ["Escape"],
36
+ end: ["Space", "Enter"]
37
+ },
38
+ accessibility: { screenReaderInstructions: { draggable: "Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel." } }
39
+ } : {}, { translator: H } = D, U = u("pie-elements:placement-ordering"), W = m("div")({
40
+ color: S.text(),
41
+ backgroundColor: S.background(),
30
42
  display: "flex",
31
43
  flexDirection: "column",
32
44
  alignItems: "center",
33
45
  boxSizing: "border-box"
34
- }), B = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), V = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), H = p(E)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), U = p(N)(({ theme: e }) => ({
46
+ }), G = m("div")({
47
+ alignSelf: "stretch",
48
+ maxWidth: "100%",
49
+ overflowX: "auto",
50
+ overflowY: "hidden"
51
+ }), K = m("div")({
52
+ display: "flex",
53
+ justifyContent: "center",
54
+ minWidth: "min-content"
55
+ }), q = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), J = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), Y = m(O)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), X = m(F)(({ theme: e }) => ({
35
56
  marginBottom: e.spacing(2),
36
57
  alignSelf: "flex-start"
37
- })), W = (e) => {
58
+ })), Z = (e) => {
38
59
  let { tiler: t, ordering: n, onDropChoice: r, onRemoveChoice: i, ...a } = e;
39
- return /* @__PURE__ */ C(t, {
60
+ return /* @__PURE__ */ T(t, {
40
61
  ...a,
41
62
  tiles: n.tiles,
42
63
  onDropChoice: (e, t) => r(e, t, n),
43
64
  onRemoveChoice: (e) => i(e, n)
44
65
  });
45
66
  };
46
- W.propTypes = {
47
- tiler: d.func,
48
- ordering: d.any,
49
- onDropChoice: d.func,
50
- onRemoveChoice: d.func
67
+ Z.propTypes = {
68
+ tiler: f.func,
69
+ ordering: f.any,
70
+ onDropChoice: f.func,
71
+ onRemoveChoice: f.func
51
72
  };
52
- var G = class extends c.Component {
73
+ var Q = class extends o.Component {
53
74
  static propTypes = {
54
- onSessionChange: d.func.isRequired,
55
- model: d.object.isRequired,
56
- session: d.oneOfType([d.array.isRequired, d.object.isRequired])
75
+ onSessionChange: f.func.isRequired,
76
+ model: f.object.isRequired,
77
+ session: f.oneOfType([f.array.isRequired, f.object.isRequired])
57
78
  };
58
79
  constructor(e) {
59
- super(e), this.instanceId = n();
60
- let { value: t, needsReset: r } = this.validateSession(e);
61
- this.state = { showingCorrect: !1 };
62
- let { model: i } = e || {}, { env: a } = i || {}, { mode: o } = a || {};
63
- r && o === "gather" && this.props.onSessionChange({
80
+ super(e), this.instanceId = l();
81
+ let { value: t, needsReset: n } = this.validateSession(e);
82
+ this.state = {
83
+ showingCorrect: !1,
84
+ selectedChoice: null
85
+ }, this.lastDragEndAt = 0;
86
+ let { model: r } = e || {}, { env: i } = r || {}, { mode: a } = i || {};
87
+ n && a === "gather" && this.props.onSessionChange({
64
88
  ...e.session,
65
89
  value: t
66
90
  });
67
91
  }
68
92
  toggleCorrect = (e) => this.setState({ showingCorrect: e });
69
93
  componentDidUpdate() {
70
- u(f.findDOMNode(this));
94
+ d(p.findDOMNode(this));
71
95
  }
72
- validateSession = ({ model: n, session: r }, i = !1) => {
73
- let { config: a, choices: o } = n || {}, { includeTargets: s } = a || {}, c = o.map((e) => e.id), { value: l } = r || {}, u;
74
- if (s) l && l.length !== c.length && (u = !0, l = l.length < c.length ? l.concat(Array(c.length - l.length)) : l.filter((e) => c.includes(e)));
96
+ validateSession = ({ model: e, session: t }, n = !1) => {
97
+ let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, o = i.map((e) => e.id), { value: l } = t || {}, u;
98
+ if (a) l && l.length !== o.length && (u = !0, l = l.length < o.length ? l.concat(Array(o.length - l.length)) : l.filter((e) => o.includes(e)));
75
99
  else {
76
- if (!l || !l.length || i) l = c;
100
+ if (!l || !l.length || n) l = o;
77
101
  else {
78
- let t = e(c, l), n = e(l, c);
79
- (t.length || n.length) && (l = c);
102
+ let e = s(o, l), t = s(l, o);
103
+ (e.length || t.length) && (l = o);
80
104
  }
81
- u = !t(r.value, l);
105
+ u = !c(t.value, l);
82
106
  }
83
107
  return u && console.warn("This session is not valid anymore. It will be reset."), {
84
108
  value: l,
@@ -86,55 +110,55 @@ var G = class extends c.Component {
86
110
  };
87
111
  };
88
112
  UNSAFE_componentWillReceiveProps(e) {
89
- let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: i, choices: a = [], env: o } = t, { includeTargets: c } = i || {}, l = {}, u = n.language && n.language !== t.language, d = n.note && n.note === L.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
90
- u && d && (n.note = L.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (l.showingCorrect = !1);
91
- let f = s(a, n.choices), { value: p, needsReset: m } = this.validateSession(e, f), h = {
113
+ let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: a, choices: o = [], env: s } = t, { includeTargets: c } = a || {}, l = {}, u = n.language && n.language !== t.language, d = n.note && n.note === H.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
114
+ u && d && (n.note = H.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (l.showingCorrect = !1);
115
+ let f = i(o, n.choices), { value: p, needsReset: m } = this.validateSession(e, f), h = {
92
116
  ...e.session,
93
117
  value: p
94
118
  }, g = n.config?.includeTargets !== c;
95
119
  c && g && (m = !0, delete h.value), this.setState(l, () => {
96
- let { mode: e } = o || {};
120
+ let { mode: e } = s || {};
97
121
  m && e === "gather" && this.props.onSessionChange(h);
98
122
  });
99
123
  }
100
124
  onDropChoice = (e, t, n) => {
101
- let { onSessionChange: r, session: i } = this.props, a = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), s = e;
102
- R("[onDropChoice] ", a, s);
103
- let c = o({
125
+ let { onSessionChange: i, session: a } = this.props, o = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), s = e;
126
+ U("[onDropChoice] ", o, s);
127
+ let c = r({
104
128
  type: "move",
105
- from: a,
129
+ from: o,
106
130
  to: s
107
131
  }, n);
108
- r(Object.assign({}, i, { value: c.response }));
132
+ i(Object.assign({}, a, { value: c.response }));
109
133
  };
110
134
  onRemoveChoice = (e, t) => {
111
- let { onSessionChange: n, session: r } = this.props;
112
- R("[onRemoveChoice]", e);
113
- let i = o({
135
+ let { onSessionChange: n, session: i } = this.props;
136
+ U("[onRemoveChoice]", e);
137
+ let a = r({
114
138
  type: "remove",
115
139
  target: e
116
140
  }, t);
117
- n(Object.assign({}, r, { value: i.response }));
141
+ n(Object.assign({}, i, { value: a.response }));
118
142
  };
119
143
  createOrdering = () => {
120
- let { model: e, session: t } = this.props, { showingCorrect: n } = this.state, { includeTargets: r } = e.config || {
144
+ let { model: e, session: t } = this.props, { showingCorrect: r } = this.state, { includeTargets: i } = e.config || {
121
145
  orientation: "vertical",
122
146
  includeTargets: !0
123
147
  };
124
- return n ? a(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
148
+ return r ? n(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
125
149
  id: e,
126
150
  outcome: "correct"
127
151
  })), {
128
- includeTargets: r,
152
+ includeTargets: i,
129
153
  allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
130
- }) : a(e.choices, t.value, e.outcomes, {
131
- includeTargets: r,
154
+ }) : n(e.choices, t.value, e.outcomes, {
155
+ includeTargets: i,
132
156
  allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
133
157
  });
134
158
  };
135
159
  onDragEnd = (e) => {
136
160
  let { over: t, active: n } = e, r = this.createOrdering();
137
- if (t && n) {
161
+ if (this.cancelSelection(), this.lastDragEndAt = Date.now(), t && n) {
138
162
  let e = n.data.current, i = t.data.current;
139
163
  if (e && i && i.type === "target") {
140
164
  this.onDropChoice(i, e, r);
@@ -142,68 +166,114 @@ var G = class extends c.Component {
142
166
  }
143
167
  e && i && this.onDropChoice(i, e, r);
144
168
  } else if (!t && n) {
145
- let e = n.data.current;
146
- e && e.type === "target" && this.onRemoveChoice(e, r);
169
+ let e = n.data.current, t = B(n.rect?.current?.initial, n.rect?.current?.translated);
170
+ e && e.type === "target" && !t && this.onRemoveChoice(e, r);
147
171
  }
148
172
  };
173
+ onDragStart = (e) => {
174
+ let { active: t } = e;
175
+ t?.data?.current && this.selectChoice(t.data.current);
176
+ };
177
+ onDragCancel = () => {
178
+ this.cancelSelection(), this.lastDragEndAt = Date.now();
179
+ };
180
+ isSameChoice = (e, t) => !!e && !!t && e.type === t.type && e.id === t.id && e.index === t.index;
181
+ selectChoice = (e) => {
182
+ this.setState({ selectedChoice: e });
183
+ };
184
+ toggleChoiceSelection = (e) => {
185
+ this.setState((t) => ({ selectedChoice: this.isSameChoice(t.selectedChoice, e) ? null : e }));
186
+ };
187
+ cancelSelection = () => {
188
+ this.setState({ selectedChoice: null });
189
+ };
190
+ endAnyLiveKeyboardDrag = () => {
191
+ document.dispatchEvent(new KeyboardEvent("keydown", {
192
+ code: "Escape",
193
+ bubbles: !0,
194
+ cancelable: !0
195
+ }));
196
+ };
197
+ placeSelectedChoice = (e) => {
198
+ let { selectedChoice: t } = this.state;
199
+ if (!t) return;
200
+ let n = this.createOrdering();
201
+ this.onDropChoice(e, t, n), this.cancelSelection(), this.endAnyLiveKeyboardDrag(), this.lastDragEndAt = Date.now();
202
+ };
203
+ isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < z;
204
+ onChoiceClick = (e) => {
205
+ this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
206
+ };
207
+ onPlacementClick = (e) => {
208
+ this.isClickSoonAfterDragEnd() || this.placeSelectedChoice(e);
209
+ };
149
210
  render() {
150
- let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: a, prompt: o, rationale: s, feedback: c, config: l, note: u, showNote: d, env: f, disabled: p, teacherInstructions: h, language: g } = e, _ = t && t.length > 0, { showingCorrect: v } = this.state, y = l || {
211
+ let { model: n } = this.props, { correctResponse: r, correctness: i, extraCSSRules: a, prompt: o, rationale: s, feedback: c, config: l, note: u, showNote: d, env: f, disabled: p, teacherInstructions: m, language: _ } = n, v = r && r.length > 0, { showingCorrect: y } = this.state, b = l || {
151
212
  orientation: "vertical",
152
213
  includeTargets: !0
153
- }, { orientation: T, includeTargets: E } = y, O = T === "vertical", k = this.createOrdering(), { mode: N, role: P } = f || {}, F = O ? i : r, I = (v || N === "view" && P === "instructor") && d && u, L = s && (S(s) || x(s)), R = h && (S(h) || x(h)), G = {
154
- color: b.text(),
155
- backgroundColor: b.background(),
214
+ }, { orientation: x, includeTargets: D } = b, O = x === "vertical", A = this.createOrdering(), { mode: j, role: F } = f || {}, I = O ? t : e, L = (y || j === "view" && F === "instructor") && d && u, R = s && (w(s) || C(s)), z = m && (w(m) || C(m)), B = {
215
+ color: S.text(),
216
+ backgroundColor: S.background(),
156
217
  display: "flex",
157
218
  flexDirection: "column",
158
219
  alignItems: "center",
159
- boxSizing: "border-box"
160
- };
161
- return /* @__PURE__ */ C(D, {
162
- onDragStart: () => {},
220
+ boxSizing: "border-box",
221
+ width: "100%"
222
+ }, H = D ? {
223
+ selectedChoice: this.state.selectedChoice,
224
+ onChoiceClick: this.onChoiceClick,
225
+ onPlacementClick: this.onPlacementClick
226
+ } : {};
227
+ return /* @__PURE__ */ T(k, {
228
+ onDragStart: this.onDragStart,
163
229
  onDragEnd: this.onDragEnd,
164
- collisionDetection: m,
165
- children: /* @__PURE__ */ C(z, { children: /* @__PURE__ */ w(A, {
230
+ onDragCancel: this.onDragCancel,
231
+ collisionDetection: h,
232
+ modifiers: [g],
233
+ ...V(D),
234
+ children: /* @__PURE__ */ T(W, { children: /* @__PURE__ */ E(M, {
166
235
  extraCSSRules: a,
167
- style: G,
236
+ style: B,
168
237
  children: [
169
- R && /* @__PURE__ */ C(U, {
238
+ z && /* @__PURE__ */ T(X, {
170
239
  labels: {
171
240
  hidden: "Show Teacher Instructions",
172
241
  visible: "Hide Teacher Instructions"
173
242
  },
174
243
  className: "collapsible",
175
- children: /* @__PURE__ */ C(j, { prompt: h })
244
+ children: /* @__PURE__ */ T(N, { prompt: m })
176
245
  }),
177
- /* @__PURE__ */ C(B, { children: /* @__PURE__ */ C(j, { prompt: o }) }),
178
- /* @__PURE__ */ C(H, {
179
- show: _,
180
- toggled: v,
246
+ /* @__PURE__ */ T(q, { children: /* @__PURE__ */ T(N, { prompt: o }) }),
247
+ /* @__PURE__ */ T(Y, {
248
+ show: v,
249
+ toggled: y,
181
250
  onToggle: this.toggleCorrect,
182
- language: g
251
+ language: _
183
252
  }),
184
- /* @__PURE__ */ C(W, {
253
+ /* @__PURE__ */ T(G, { children: /* @__PURE__ */ T(K, { children: /* @__PURE__ */ T(Z, {
185
254
  instanceId: this.instanceId,
186
- choiceLabel: y.choiceLabel,
187
- targetLabel: y.targetLabel,
188
- ordering: k,
189
- tiler: F,
255
+ choiceLabel: b.choiceLabel,
256
+ targetLabel: b.targetLabel,
257
+ ordering: A,
258
+ tiler: I,
190
259
  disabled: p,
191
- addGuide: y.showOrdering,
192
- tileSize: y.tileSize,
193
- includeTargets: E,
194
- choiceLabelEnabled: e.config && e.config.choiceLabelEnabled
195
- }),
196
- I && /* @__PURE__ */ C(V, { dangerouslySetInnerHTML: { __html: u } }),
197
- L && /* @__PURE__ */ C(U, {
260
+ addGuide: b.showOrdering,
261
+ tileSize: b.tileSize,
262
+ includeTargets: D,
263
+ choiceLabelEnabled: n.config && n.config.choiceLabelEnabled,
264
+ ...H
265
+ }) }) }),
266
+ L && /* @__PURE__ */ T(J, { dangerouslySetInnerHTML: { __html: u } }),
267
+ R && /* @__PURE__ */ T(X, {
198
268
  labels: {
199
269
  hidden: "Show Rationale",
200
270
  visible: "Hide Rationale"
201
271
  },
202
272
  className: "collapsible",
203
- children: /* @__PURE__ */ C(j, { prompt: s })
273
+ children: /* @__PURE__ */ T(N, { prompt: s })
204
274
  }),
205
- !v && /* @__PURE__ */ C(M, {
206
- correctness: n,
275
+ !y && /* @__PURE__ */ T(P, {
276
+ correctness: i,
207
277
  feedback: c
208
278
  })
209
279
  ]
@@ -212,4 +282,4 @@ var G = class extends c.Component {
212
282
  }
213
283
  };
214
284
  //#endregion
215
- export { G as default };
285
+ export { Q as PlacementOrdering, Q as default };
@@ -23,6 +23,9 @@ export declare const Tile: {
23
23
  instanceId: PropTypes.Requireable<any>;
24
24
  draggable: PropTypes.Requireable<boolean>;
25
25
  tileIndex: PropTypes.Requireable<number>;
26
+ selectedChoice: PropTypes.Requireable<object>;
27
+ onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
28
+ onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
26
29
  };
27
30
  };
28
31
  export default Tile;
@@ -24,90 +24,89 @@ d.propTypes = {
24
24
  isOver: n.bool,
25
25
  disabled: n.bool
26
26
  };
27
- var f = r("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i, label: a, type: s }) => ({
28
- cursor: r ? "not-allowed" : "grab",
27
+ var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: i, outcome: a, label: s, type: c }) => ({
28
+ cursor: i ? "not-allowed" : "grab",
29
29
  width: "100%",
30
30
  height: "100%",
31
31
  padding: "10px",
32
32
  boxSizing: "border-box",
33
33
  overflow: "hidden",
34
- border: s === "choice" || s === "target" ? `1px solid ${e.palette.grey[400]}` : "1px solid transparent",
35
- backgroundColor: s === "choice" || s === "target" ? o.background() : "transparent",
36
- transition: s === "choice" || s === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
34
+ border: c === "choice" || c === "target" ? `1px solid ${o.border()}` : "1px solid transparent",
35
+ backgroundColor: c === "choice" || c === "target" ? o.background() : "transparent",
36
+ transition: c === "choice" || c === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
37
37
  pointerEvents: "none",
38
38
  userSelect: "none",
39
- ...(s === "choice" || s === "target") && { "&:hover": {
40
- backgroundColor: r ? o.background() : o.secondary(),
41
- borderColor: r ? e.palette.grey[400] : e.palette.primary.main,
42
- transform: r ? "none" : "scale(1.02)"
39
+ ...(c === "choice" || c === "target") && { "&:hover": {
40
+ backgroundColor: i ? o.background() : o.secondary(),
41
+ borderColor: i ? o.disabled() : e.palette.primary.main,
42
+ transform: i ? "none" : "scale(1.02)"
43
43
  } },
44
- ...(s === "choice" || s === "target") && n && !r && {
44
+ ...(c === "choice" || c === "target") && r && !i && {
45
45
  opacity: .4,
46
46
  backgroundColor: o.primaryLight(),
47
47
  borderColor: e.palette.primary.main,
48
48
  borderStyle: "dashed",
49
49
  transform: "scale(1.05)"
50
50
  },
51
- ...(s === "choice" || s === "target") && t && !r && {
51
+ ...(c === "choice" || c === "target") && (t || n) && !i && {
52
52
  opacity: .6,
53
53
  backgroundColor: o.secondaryLight(),
54
54
  transform: "scale(1.05) rotate(2deg)",
55
55
  boxShadow: "0 8px 16px rgba(0,0,0,0.2)",
56
56
  cursor: "grabbing"
57
57
  },
58
- ...(s === "choice" || s === "target") && r && {
58
+ ...(c === "choice" || c === "target") && i && {
59
59
  cursor: "not-allowed",
60
60
  "&:hover": {
61
61
  backgroundColor: o.background(),
62
62
  transform: "none"
63
63
  }
64
64
  },
65
- ...(s === "choice" || s === "target") && i === "incorrect" && { border: `1px solid ${o.incorrect()}` },
66
- ...(s === "choice" || s === "target") && i === "correct" && { border: `1px solid ${o.correct()}` },
67
- ...!a && {
65
+ ...(c === "choice" || c === "target") && a === "incorrect" && { border: `1px solid ${o.incorrect()}` },
66
+ ...(c === "choice" || c === "target") && a === "correct" && { border: `1px solid ${o.correct()}` },
67
+ ...!s && {
68
68
  border: "none",
69
69
  "&:hover": { backgroundColor: "unset" }
70
70
  }
71
71
  })), p = (e) => {
72
- let { type: t, isDragging: n, empty: r, isOver: i, label: a, disabled: o, outcome: c, guideIndex: l } = e;
73
- return r ? /* @__PURE__ */ s(d, {
72
+ let { type: t, isDragging: n, isSelected: r, empty: i, isOver: a, label: o, disabled: c, outcome: l, guideIndex: u } = e;
73
+ return i ? /* @__PURE__ */ s(d, {
74
74
  type: t,
75
- index: l,
76
- isOver: i,
77
- disabled: o
75
+ index: u,
76
+ isOver: a,
77
+ disabled: c
78
78
  }) : /* @__PURE__ */ s(f, {
79
79
  type: t,
80
80
  isDragging: n,
81
- isOver: i,
82
- disabled: o,
83
- outcome: c,
84
- label: a,
85
- dangerouslySetInnerHTML: { __html: a }
81
+ isSelected: r,
82
+ isOver: a,
83
+ disabled: c,
84
+ outcome: l,
85
+ label: o,
86
+ dangerouslySetInnerHTML: { __html: o }
86
87
  });
87
88
  }, m = (t) => {
88
- let { label: n, type: r, id: o, empty: c, disabled: u, outcome: d, index: f, guideIndex: m, instanceId: h, draggable: g, tileIndex: _ } = t, v = `tile-${r}-${o ?? "empty"}-${_}-${h}`, y = `drop-${r}-${o ?? "empty"}-${_}-${h}`, { attributes: b, listeners: x, setNodeRef: S, transform: C, isDragging: w } = i({
89
- id: v,
90
- data: {
91
- id: o,
92
- type: r,
93
- instanceId: h,
94
- value: n,
95
- index: f
96
- },
89
+ let { label: n, type: r, id: o, empty: c, disabled: u, outcome: d, index: f, guideIndex: m, instanceId: h, draggable: g, tileIndex: _, selectedChoice: v, onChoiceClick: y, onPlacementClick: b } = t, x = `tile-${r}-${o ?? "empty"}-${_}-${h}`, S = `drop-${r}-${o ?? "empty"}-${_}-${h}`, C = {
90
+ id: o,
91
+ type: r,
92
+ instanceId: h,
93
+ value: n,
94
+ index: f
95
+ }, { attributes: w, listeners: T, setNodeRef: E, transform: D, isDragging: O } = i({
96
+ id: x,
97
+ data: C,
97
98
  disabled: !g || u
98
- }), { setNodeRef: T, isOver: E } = a({
99
- id: y,
100
- data: {
101
- id: o,
102
- type: r,
103
- instanceId: h,
104
- value: n,
105
- index: f
106
- },
107
- disabled: w
108
- }), D = e.useRef(null);
99
+ }), { setNodeRef: k, isOver: A } = a({
100
+ id: S,
101
+ data: C,
102
+ disabled: O
103
+ }), j = !!v && v.type === C.type && v.id === C.id && v.index === C.index, [M, N] = e.useState(!1), P = !!v && !u, F = A || r === "target" && P && M, I = () => {
104
+ u || (r === "choice" ? v?.type === "target" ? b?.(C) : g && y?.(C) : r === "target" && (j ? y?.(C) : v ? b?.(C) : g && y?.(C)));
105
+ }, L = !(g && !u) && !u, R = (e) => {
106
+ (e.code === "Space" || e.code === "Enter") && (e.preventDefault(), I());
107
+ }, z = e.useRef(null);
109
108
  return e.useEffect(() => {
110
- let e = D.current, t = (e) => {
109
+ let e = z.current, t = (e) => {
111
110
  e.preventDefault();
112
111
  };
113
112
  return e && e.addEventListener("touchstart", t, { passive: !1 }), () => {
@@ -115,23 +114,29 @@ var f = r("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i,
115
114
  };
116
115
  }, []), l("[render], props: ", t), /* @__PURE__ */ s("div", {
117
116
  ref: (e) => {
118
- D.current = e, S(e), T(e);
117
+ z.current = e, E(e), k(e);
119
118
  },
120
119
  style: {
121
- transform: C ? `translate3d(${C.x}px, ${C.y}px, 0)` : void 0,
120
+ transform: D ? `translate3d(${D.x}px, ${D.y}px, 0)` : void 0,
122
121
  boxSizing: "border-box",
123
122
  overflow: "visible",
124
123
  padding: 0,
125
124
  margin: 0,
126
125
  textAlign: "center",
127
126
  pointerEvents: "auto",
128
- cursor: u ? "not-allowed" : w ? "grabbing" : "grab",
129
- zIndex: w ? 1e3 : "auto",
130
- willChange: w ? "transform" : "auto"
127
+ cursor: u ? "not-allowed" : r === "target" && P ? "pointer" : O ? "grabbing" : "grab",
128
+ zIndex: O ? 1e3 : "auto",
129
+ willChange: O ? "transform" : "auto"
131
130
  },
131
+ role: L ? "button" : void 0,
132
+ tabIndex: L ? 0 : void 0,
133
+ onKeyDown: L ? R : void 0,
134
+ onClick: I,
135
+ onMouseEnter: () => N(!0),
136
+ onMouseLeave: () => N(!1),
132
137
  ...g && !u ? {
133
- ...x,
134
- ...b
138
+ ...T,
139
+ ...w
135
140
  } : {},
136
141
  children: /* @__PURE__ */ s(p, {
137
142
  label: n,
@@ -139,8 +144,9 @@ var f = r("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i,
139
144
  empty: c,
140
145
  index: f,
141
146
  guideIndex: m,
142
- isOver: E,
143
- isDragging: w,
147
+ isOver: F,
148
+ isDragging: O,
149
+ isSelected: j,
144
150
  disabled: u,
145
151
  outcome: d,
146
152
  type: r
@@ -159,7 +165,10 @@ m.propTypes = {
159
165
  guideIndex: n.number,
160
166
  instanceId: n.any,
161
167
  draggable: n.bool,
162
- tileIndex: n.number
168
+ tileIndex: n.number,
169
+ selectedChoice: n.object,
170
+ onChoiceClick: n.func,
171
+ onPlacementClick: n.func
163
172
  };
164
173
  //#endregion
165
- export { m as default };
174
+ export { m as Tile, m as default };
@@ -16,6 +16,9 @@ export declare class HorizontalTiler extends React.Component {
16
16
  tiles: PropTypes.Validator<any[]>;
17
17
  tileSize: PropTypes.Requireable<string>;
18
18
  addGuide: PropTypes.Requireable<boolean>;
19
+ selectedChoice: PropTypes.Requireable<object>;
20
+ onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
21
+ onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
19
22
  };
20
23
  static defaultProps: {
21
24
  tileSize: string;
@@ -32,6 +35,9 @@ export declare class VerticalTiler extends React.Component {
32
35
  tiles: PropTypes.Validator<any[]>;
33
36
  tileSize: PropTypes.Requireable<string>;
34
37
  addGuide: PropTypes.Requireable<boolean>;
38
+ selectedChoice: PropTypes.Requireable<object>;
39
+ onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
40
+ onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
35
41
  };
36
42
  static defaultProps: {
37
43
  tileSize: string;
@@ -1,4 +1,4 @@
1
- import e from "./tile.js";
1
+ import { Tile as e } from "./tile.js";
2
2
  import t, { createElement as n } from "react";
3
3
  import r from "prop-types";
4
4
  import { styled as i } from "@mui/material/styles";
@@ -10,13 +10,16 @@ var s = {
10
10
  disabled: r.bool,
11
11
  tiles: r.array.isRequired,
12
12
  tileSize: r.string,
13
- addGuide: r.bool
13
+ addGuide: r.bool,
14
+ selectedChoice: r.object,
15
+ onChoiceClick: r.func,
16
+ onPlacementClick: r.func
14
17
  }, c = {
15
18
  tileSize: "1fr",
16
19
  disabled: !1,
17
20
  addGuide: !1
18
21
  }, l = (t) => {
19
- let r = (r, i) => (r.instanceId = t.instanceId, r.disabled = t.disabled, r.guideIndex = t.addGuide ? r.index + 1 : void 0, r.tileIndex = i, t.includeTargets || r.type === "choice" ? /* @__PURE__ */ n(e, {
22
+ let r = (r, i) => (r.instanceId = t.instanceId, r.disabled = t.disabled, r.guideIndex = t.addGuide ? r.index + 1 : void 0, r.tileIndex = i, r.selectedChoice = t.selectedChoice, r.onChoiceClick = t.onChoiceClick, r.onPlacementClick = t.onPlacementClick, t.includeTargets || r.type === "choice" ? /* @__PURE__ */ n(e, {
20
23
  ...r,
21
24
  key: i
22
25
  }) : /* @__PURE__ */ n(e, {