@pie-element/number-line 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist/author/arrows.d.ts +29 -0
  3. package/dist/author/arrows.d.ts.map +1 -0
  4. package/dist/author/arrows.js +69 -0
  5. package/dist/author/card-bar.d.ts +21 -0
  6. package/dist/author/card-bar.d.ts.map +1 -0
  7. package/dist/author/card-bar.js +41 -0
  8. package/dist/author/defaults.d.ts +179 -0
  9. package/dist/author/defaults.d.ts.map +1 -0
  10. package/dist/author/defaults.js +144 -0
  11. package/dist/author/domain.d.ts +16 -0
  12. package/dist/author/domain.d.ts.map +1 -0
  13. package/dist/author/domain.js +53 -0
  14. package/dist/author/index.d.ts +24 -0
  15. package/dist/author/index.d.ts.map +1 -0
  16. package/dist/author/index.js +89 -0
  17. package/dist/author/main.d.ts +45 -0
  18. package/dist/author/main.d.ts.map +1 -0
  19. package/dist/author/main.js +482 -0
  20. package/dist/author/number-text-field.d.ts +14 -0
  21. package/dist/author/number-text-field.d.ts.map +1 -0
  22. package/dist/author/number-text-field.js +11 -0
  23. package/dist/author/point-config.d.ts +26 -0
  24. package/dist/author/point-config.d.ts.map +1 -0
  25. package/dist/author/point-config.js +69 -0
  26. package/dist/author/size.d.ts +25 -0
  27. package/dist/author/size.d.ts.map +1 -0
  28. package/dist/author/size.js +48 -0
  29. package/dist/author/ticks.d.ts +23 -0
  30. package/dist/author/ticks.d.ts.map +1 -0
  31. package/dist/author/ticks.js +115 -0
  32. package/dist/author/utils.d.ts +10 -0
  33. package/dist/author/utils.d.ts.map +1 -0
  34. package/dist/author/utils.js +4 -0
  35. package/dist/controller/defaults.d.ts +59 -0
  36. package/dist/controller/defaults.d.ts.map +1 -0
  37. package/dist/controller/defaults.js +50 -0
  38. package/dist/controller/index.d.ts +34 -0
  39. package/dist/controller/index.d.ts.map +1 -0
  40. package/dist/controller/index.js +170 -0
  41. package/dist/controller/tickUtils.d.ts +21 -0
  42. package/dist/controller/tickUtils.d.ts.map +1 -0
  43. package/dist/controller/tickUtils.js +254 -0
  44. package/dist/controller/utils.d.ts +10 -0
  45. package/dist/controller/utils.d.ts.map +1 -0
  46. package/dist/controller/utils.js +68 -0
  47. package/dist/delivery/data-converter.d.ts +65 -0
  48. package/dist/delivery/data-converter.d.ts.map +1 -0
  49. package/dist/delivery/data-converter.js +70 -0
  50. package/dist/delivery/draggable/index.d.ts +34 -0
  51. package/dist/delivery/draggable/index.d.ts.map +1 -0
  52. package/dist/delivery/draggable/index.js +39 -0
  53. package/dist/delivery/index.d.ts +36 -0
  54. package/dist/delivery/index.d.ts.map +1 -0
  55. package/dist/delivery/index.js +109 -0
  56. package/dist/delivery/number-line/colors.d.ts +12 -0
  57. package/dist/delivery/number-line/colors.d.ts.map +1 -0
  58. package/dist/delivery/number-line/colors.js +5 -0
  59. package/dist/delivery/number-line/feedback.d.ts +20 -0
  60. package/dist/delivery/number-line/feedback.d.ts.map +1 -0
  61. package/dist/delivery/number-line/feedback.js +57 -0
  62. package/dist/delivery/number-line/graph/arrow.d.ts +31 -0
  63. package/dist/delivery/number-line/graph/arrow.d.ts.map +1 -0
  64. package/dist/delivery/number-line/graph/arrow.js +27 -0
  65. package/dist/delivery/number-line/graph/elements/base.d.ts +17 -0
  66. package/dist/delivery/number-line/graph/elements/base.d.ts.map +1 -0
  67. package/dist/delivery/number-line/graph/elements/base.js +11 -0
  68. package/dist/delivery/number-line/graph/elements/builder.d.ts +34 -0
  69. package/dist/delivery/number-line/graph/elements/builder.d.ts.map +1 -0
  70. package/dist/delivery/number-line/graph/elements/builder.js +30 -0
  71. package/dist/delivery/number-line/graph/elements/line.d.ts +52 -0
  72. package/dist/delivery/number-line/graph/elements/line.d.ts.map +1 -0
  73. package/dist/delivery/number-line/graph/elements/line.js +189 -0
  74. package/dist/delivery/number-line/graph/elements/point.d.ts +44 -0
  75. package/dist/delivery/number-line/graph/elements/point.d.ts.map +1 -0
  76. package/dist/delivery/number-line/graph/elements/point.js +127 -0
  77. package/dist/delivery/number-line/graph/elements/ray.d.ts +44 -0
  78. package/dist/delivery/number-line/graph/elements/ray.d.ts.map +1 -0
  79. package/dist/delivery/number-line/graph/elements/ray.js +130 -0
  80. package/dist/delivery/number-line/graph/index.d.ts +60 -0
  81. package/dist/delivery/number-line/graph/index.d.ts.map +1 -0
  82. package/dist/delivery/number-line/graph/index.js +196 -0
  83. package/dist/delivery/number-line/graph/line.d.ts +47 -0
  84. package/dist/delivery/number-line/graph/line.d.ts.map +1 -0
  85. package/dist/delivery/number-line/graph/line.js +27 -0
  86. package/dist/delivery/number-line/graph/stacks.d.ts +11 -0
  87. package/dist/delivery/number-line/graph/stacks.d.ts.map +1 -0
  88. package/dist/delivery/number-line/graph/stacks.js +40 -0
  89. package/dist/delivery/number-line/graph/tick-utils.d.ts +74 -0
  90. package/dist/delivery/number-line/graph/tick-utils.d.ts.map +1 -0
  91. package/dist/delivery/number-line/graph/tick-utils.js +297 -0
  92. package/dist/delivery/number-line/graph/ticks.d.ts +47 -0
  93. package/dist/delivery/number-line/graph/ticks.d.ts.map +1 -0
  94. package/dist/delivery/number-line/graph/ticks.js +115 -0
  95. package/dist/delivery/number-line/index.d.ts +36 -0
  96. package/dist/delivery/number-line/index.d.ts.map +1 -0
  97. package/dist/delivery/number-line/index.js +218 -0
  98. package/dist/delivery/number-line/point-chooser/button.d.ts +32 -0
  99. package/dist/delivery/number-line/point-chooser/button.d.ts.map +1 -0
  100. package/dist/delivery/number-line/point-chooser/button.js +36 -0
  101. package/dist/delivery/number-line/point-chooser/img.d.ts +11 -0
  102. package/dist/delivery/number-line/point-chooser/img.d.ts.map +1 -0
  103. package/dist/delivery/number-line/point-chooser/img.js +4 -0
  104. package/dist/delivery/number-line/point-chooser/index.d.ts +38 -0
  105. package/dist/delivery/number-line/point-chooser/index.d.ts.map +1 -0
  106. package/dist/delivery/number-line/point-chooser/index.js +154 -0
  107. package/dist/delivery/number-line/point-chooser/styles.d.ts +193 -0
  108. package/dist/delivery/number-line/point-chooser/styles.d.ts.map +1 -0
  109. package/dist/delivery/number-line/transitions/fade.d.ts +35 -0
  110. package/dist/delivery/number-line/transitions/fade.d.ts.map +1 -0
  111. package/dist/delivery/number-line/transitions/fade.js +75 -0
  112. package/dist/delivery/number-line/transitions/index.d.ts +11 -0
  113. package/dist/delivery/number-line/transitions/index.d.ts.map +1 -0
  114. package/dist/index.d.ts +2 -0
  115. package/dist/index.d.ts.map +1 -0
  116. package/dist/index.iife.d.ts +9 -0
  117. package/dist/index.iife.d.ts.map +1 -0
  118. package/dist/index.iife.js +201 -0
  119. package/dist/index.js +2 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludes.js +7 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludesWith.js +7 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignMergeValue.js +8 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFindIndex.js +7 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +5 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js +6 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIndexOf.js +9 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js +26 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNaN.js +6 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js +11 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js +12 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMerge.js +19 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePickBy.js +13 -0
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js +8 -0
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js +22 -0
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js +8 -0
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUniq.js +27 -0
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createAssigner.js +15 -0
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +12 -0
  198. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createFind.js +19 -0
  199. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createSet.js +9 -0
  200. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  201. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
  202. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
  203. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
  204. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  205. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  206. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  207. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  208. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js +16 -0
  209. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  210. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  211. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  212. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  213. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  214. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  215. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  216. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js +18 -0
  217. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  218. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  219. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  220. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  221. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  222. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  223. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  224. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  225. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  226. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
  227. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
  228. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  229. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  230. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  231. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js +7 -0
  232. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  233. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  234. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  235. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  236. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  237. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  238. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  239. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  240. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  241. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  242. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
  243. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  244. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
  245. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  246. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  247. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  248. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  249. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  250. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  251. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  252. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  253. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_safeGet.js +6 -0
  254. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
  255. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
  256. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
  257. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  258. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  259. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  260. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  261. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  262. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  263. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  264. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_strictIndexOf.js +7 -0
  265. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
  266. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
  267. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  268. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  269. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  270. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  271. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  272. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/find.js +6 -0
  273. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/findIndex.js +13 -0
  274. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
  275. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js +8 -0
  276. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  277. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  278. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  279. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  280. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  281. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  282. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  283. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
  284. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqualWith.js +9 -0
  285. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  286. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  287. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  288. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isNumber.js +9 -0
  289. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  290. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  291. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js +14 -0
  292. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  293. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
  294. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  295. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  296. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  297. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
  298. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/merge.js +8 -0
  299. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/negate.js +17 -0
  300. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/noop.js +4 -0
  301. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/omitBy.js +9 -0
  302. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/pickBy.js +16 -0
  303. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/property.js +10 -0
  304. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  305. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  306. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toFinite.js +8 -0
  307. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toInteger.js +8 -0
  308. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js +19 -0
  309. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toPlainObject.js +8 -0
  310. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
  311. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniqWith.js +7 -0
  312. package/package.json +77 -0
  313. package/src/author/arrows.tsx +87 -0
  314. package/src/author/card-bar.tsx +70 -0
  315. package/src/author/defaults.ts +127 -0
  316. package/src/author/domain.tsx +79 -0
  317. package/src/author/index.ts +199 -0
  318. package/src/author/main.tsx +777 -0
  319. package/src/author/number-text-field.tsx +28 -0
  320. package/src/author/point-config.tsx +93 -0
  321. package/src/author/size.tsx +74 -0
  322. package/src/author/ticks.tsx +272 -0
  323. package/src/author/utils.ts +16 -0
  324. package/src/controller/defaults.ts +40 -0
  325. package/src/controller/index.ts +437 -0
  326. package/src/controller/tickUtils.ts +324 -0
  327. package/src/controller/utils.ts +159 -0
  328. package/src/delivery/data-converter.ts +88 -0
  329. package/src/delivery/draggable/index.ts +116 -0
  330. package/src/delivery/index.ts +225 -0
  331. package/src/delivery/number-line/colors.ts +15 -0
  332. package/src/delivery/number-line/feedback.tsx +85 -0
  333. package/src/delivery/number-line/graph/arrow.tsx +43 -0
  334. package/src/delivery/number-line/graph/elements/base.ts +20 -0
  335. package/src/delivery/number-line/graph/elements/builder.ts +37 -0
  336. package/src/delivery/number-line/graph/elements/line.tsx +259 -0
  337. package/src/delivery/number-line/graph/elements/point.tsx +219 -0
  338. package/src/delivery/number-line/graph/elements/ray.tsx +168 -0
  339. package/src/delivery/number-line/graph/index.tsx +258 -0
  340. package/src/delivery/number-line/graph/line.tsx +33 -0
  341. package/src/delivery/number-line/graph/stacks.ts +82 -0
  342. package/src/delivery/number-line/graph/tick-utils.ts +369 -0
  343. package/src/delivery/number-line/graph/ticks.tsx +189 -0
  344. package/src/delivery/number-line/index.tsx +385 -0
  345. package/src/delivery/number-line/point-chooser/button.tsx +54 -0
  346. package/src/delivery/number-line/point-chooser/img.ts +11 -0
  347. package/src/delivery/number-line/point-chooser/index.tsx +200 -0
  348. package/src/delivery/number-line/point-chooser/styles.ts +86 -0
  349. package/src/delivery/number-line/transitions/fade.tsx +100 -0
  350. package/src/delivery/number-line/transitions/index.ts +12 -0
  351. package/src/index.iife.ts +16 -0
  352. package/src/index.ts +1 -0
@@ -0,0 +1,777 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/number-line/configure/src/main.jsx
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import React from 'react';
12
+ import { FormSection, InputContainer, AlertDialog, settings, layout } from '@pie-lib/config-ui';
13
+ import EditableHtml from '@pie-lib/editable-html-tip-tap';
14
+ import { NumberLineComponent, dataConverter, tickUtils } from '../delivery/index.js';
15
+ import NumberTextField from './number-text-field.js';
16
+ import CardBar from './card-bar.js';
17
+ import Size from './size.js';
18
+ import PropTypes from 'prop-types';
19
+ import Domain from './domain.js';
20
+ import Arrows from './arrows.js';
21
+ import PointConfig from './point-config.js';
22
+ import { cloneDeep } from 'lodash-es';
23
+ import { styled } from '@mui/material/styles';
24
+ import Typography from '@mui/material/Typography';
25
+ import Info from '@mui/icons-material/Info';
26
+ import Tooltip from '@mui/material/Tooltip';
27
+ import Ticks from './ticks.js';
28
+ import { model as defaultModel } from './defaults.js';
29
+ import { generateValidationMessage } from './utils.js';
30
+ import * as math from 'mathjs';
31
+
32
+ const trimModel = (model) => ({
33
+ ...model,
34
+ feedback: undefined,
35
+ prompt: undefined,
36
+ teacherInstructions: undefined,
37
+ graph: { ...model.graph, title: undefined, disabled: true },
38
+ correctResponse: undefined,
39
+ });
40
+
41
+ const { lineIsSwitched, switchGraphLine, toGraphFormat, toSessionFormat } = dataConverter;
42
+ const { Panel, toggle } = settings;
43
+
44
+ let minorLimits = {};
45
+ let minorValues = {};
46
+ let majorValues = {};
47
+
48
+ const StyledNumberTextField: any = styled(NumberTextField)({
49
+ width: '150px',
50
+ });
51
+
52
+
53
+
54
+ const Row: any = styled('div')(({ theme }) => ({
55
+ display: 'flex',
56
+ flexWrap: 'wrap',
57
+ '& > *': {
58
+ paddingRight: theme.spacing(2),
59
+ },
60
+ }));
61
+
62
+ const PointTypeChooser: any = styled('div')(({ theme }) => ({
63
+ margin: `${theme.spacing(2.5)}px 0`,
64
+ }));
65
+
66
+ const StyledInputContainer: any = styled(InputContainer)(({ theme }) => ({
67
+ paddingTop: theme.spacing(2),
68
+ marginBottom: theme.spacing(2),
69
+ width: '100%',
70
+ }));
71
+
72
+ const StyledFormSection: any = styled(FormSection)(({ theme }) => ({
73
+ marginBottom: theme.spacing(4),
74
+ }));
75
+
76
+ const ErrorText: any = styled('div')(({ theme }) => ({
77
+ fontSize: theme.typography.fontSize - 2,
78
+ color: theme.palette.error.main,
79
+ paddingTop: theme.spacing(1),
80
+ }));
81
+
82
+ const FlexRow: any = styled('div')({
83
+ display: 'flex',
84
+ alignItems: 'center',
85
+ gap: '10px',
86
+ });
87
+
88
+ const FlexRowFormSection: any = styled(FormSection)({
89
+ display: 'flex',
90
+ alignItems: 'center',
91
+ gap: '10px',
92
+ });
93
+
94
+ const Description: any = styled(Typography)(({ theme }) => ({
95
+ marginBottom: theme.spacing(2.5),
96
+ }));
97
+
98
+ export const toPointType = (response) => {
99
+ function rest(response) {
100
+ if (response.pointType) {
101
+ if (response.direction) {
102
+ return `${response.pointType[0]}${response.direction[0]}`;
103
+ }
104
+
105
+ return response.pointType[0];
106
+ }
107
+
108
+ return `${response.leftPoint[0]}${response.rightPoint[0]}`;
109
+ }
110
+
111
+ return `${response.type[0]}${rest(response)}`.toUpperCase();
112
+ };
113
+
114
+ export class Main extends React.Component {
115
+ static propTypes = {
116
+ model: PropTypes.object.isRequired,
117
+ configuration: PropTypes.object.isRequired,
118
+ onConfigurationChanged: PropTypes.func.isRequired,
119
+ onChange: PropTypes.func.isRequired,
120
+ imageSupport: PropTypes.object.isRequired,
121
+ uploadSoundSupport: PropTypes.object.isRequired,
122
+ };
123
+
124
+ constructor(props) {
125
+ super(props);
126
+ const {
127
+ model: {
128
+ graph: { availableTypes, maxNumberOfPoints },
129
+ },
130
+ } = props;
131
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
132
+ this.state = {
133
+ dialog: {
134
+ open: false,
135
+ text: '',
136
+ },
137
+ correctAnswerDialog: {
138
+ open: false,
139
+ text: '',
140
+ },
141
+ };
142
+ this.graphChange({ height });
143
+ }
144
+
145
+ componentDidMount() {
146
+ const { configuration, model, onChange } = this.props;
147
+ const { title } = configuration || {};
148
+ const { titleEnabled: showTitle } = model || {};
149
+
150
+ const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
151
+
152
+ onChange && onChange({ ...model, titleEnabled });
153
+ }
154
+
155
+ graphChange: any = (obj) => {
156
+ const { model, onChange } = this.props;
157
+ let graph = { ...model.graph, ...obj };
158
+ let respIndex = [];
159
+ model.correctResponse.forEach((correctResp, key) => {
160
+ if (
161
+ correctResp.domainPosition < graph.domain.min ||
162
+ correctResp.domainPosition > graph.domain.max ||
163
+ (correctResp.size &&
164
+ (correctResp.domainPosition + correctResp.size < graph.domain.min ||
165
+ correctResp.domainPosition + correctResp.size > graph.domain.max))
166
+ ) {
167
+ respIndex.push(key);
168
+ }
169
+ });
170
+ if (respIndex.length > 0) {
171
+ this.setState({
172
+ correctAnswerDialog: {
173
+ open: true,
174
+ text:
175
+ 'This\n' +
176
+ 'change would make it impossible for students to plot one or more elements in the current\n' +
177
+ 'correct answer. If you proceed, all such elements will be removed from the correct\n' +
178
+ 'answer.',
179
+ indices: respIndex,
180
+ graph: model.graph,
181
+ },
182
+ });
183
+ }
184
+ //reload ticks value whenever domain and width is changed
185
+ graph = this.reloadTicksData(graph);
186
+ onChange({ graph });
187
+ };
188
+
189
+ changeSize = ({ width, height }) => this.graphChange({ width, height });
190
+
191
+ getAdjustedHeight: any = (availableTypes, maxNumberOfPoints) => {
192
+ let onlyPFAvailable = true;
193
+ Object.entries(availableTypes || {}).forEach(([type, value]) => {
194
+ if (type !== 'PF' && value) {
195
+ onlyPFAvailable = false;
196
+ return;
197
+ }
198
+ });
199
+ return maxNumberOfPoints && (maxNumberOfPoints === 1 || onlyPFAvailable)
200
+ ? 100
201
+ : 50 + (maxNumberOfPoints || 20) * 25;
202
+ };
203
+
204
+ changeMaxNoOfPoints: any = (e, maxNumberOfPoints) => {
205
+ maxNumberOfPoints = Math.floor(maxNumberOfPoints);
206
+ if (this.props.model.correctResponse.length > maxNumberOfPoints) {
207
+ this.setState({
208
+ dialog: {
209
+ open: true,
210
+ text: 'To use this value, you must first remove one or more elements from the correct answers.',
211
+ },
212
+ });
213
+ return;
214
+ }
215
+ const {
216
+ model: {
217
+ graph: { availableTypes },
218
+ },
219
+ } = this.props;
220
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
221
+
222
+ this.graphChange({ maxNumberOfPoints, height });
223
+ };
224
+
225
+ changeGraphTitle = (title) => this.graphChange({ title });
226
+
227
+ /*
228
+ * Gets triggered whenever ticks related data is changed by user.
229
+ * */
230
+ changeTicks: any = (object) => {
231
+ const { model, onChange } = this.props;
232
+ let { ticks } = object;
233
+ const correctResponse = tickUtils.snapElements(model.graph.domain, ticks, model.correctResponse);
234
+ const initialElements = model.graph.initialElements
235
+ ? tickUtils.snapElements(model.graph.domain, ticks, model.graph.initialElements)
236
+ : [];
237
+ let updatedGraph = this.updateMajorValue({ ...model.graph, ticks });
238
+ const graph = { ...updatedGraph, initialElements };
239
+ onChange({ graph, correctResponse });
240
+ };
241
+
242
+ /*
243
+ * This function is duplicated in controller/index.js
244
+ * This function will reload ticks data whenever graph object is changed and also sets required tick object
245
+ * for rendering Ticks Components.
246
+ * @param graph object containing domain, ticks and width value
247
+ * @return graph object with updated ticks values
248
+ * */
249
+ reloadTicksData: any = (graph) => {
250
+ const { domain, ticks, width } = graph;
251
+ //Set tick interval type if not present for legacy number line models depending upon minor value
252
+ if (!ticks.tickIntervalType) {
253
+ if (ticks.minor > 0.5) {
254
+ ticks.tickIntervalType = 'Integer';
255
+ } else {
256
+ ticks.tickIntervalType = 'Decimal';
257
+ }
258
+ }
259
+ // This section will calculate minor and major values array and assign respective value
260
+ // to different tick types object
261
+ minorLimits = tickUtils.getMinorLimits(domain, width);
262
+ if (minorLimits.min >= 1) {
263
+ /*
264
+ * In this scenario only integer tick will be enabled
265
+ * */
266
+ ticks.tickIntervalType = 'Integer';
267
+ ticks.minor =
268
+ ticks.minor < 1
269
+ ? math.number(math.ceil(minorLimits.min))
270
+ : ticks.minor >= math.number(math.ceil(minorLimits.min)) &&
271
+ ticks.minor <= math.number(math.floor(minorLimits.max))
272
+ ? ticks.minor
273
+ : math.number(math.ceil(minorLimits.min));
274
+ ticks.integerTick = ticks.minor;
275
+ minorValues = { decimal: [], fraction: [] };
276
+ ticks.fractionTick = '0';
277
+ ticks.decimalTick = 0;
278
+ } else if (minorLimits.min >= 0 && minorLimits.max < 1) {
279
+ /*
280
+ * In this scenario only decimal or fraction tick will be enabled
281
+ * */
282
+ if (ticks.tickIntervalType === 'Integer') {
283
+ ticks.tickIntervalType = 'Fraction';
284
+ }
285
+ minorValues = tickUtils.generateMinorValues(minorLimits);
286
+ let minValue = math.number(math.fraction(minorValues.fraction[0]));
287
+ let maxValue = math.number(math.fraction(minorValues.fraction[minorValues.fraction.length - 1]));
288
+ if (ticks.minor < minValue || ticks.minor > maxValue) {
289
+ switch (ticks.tickIntervalType) {
290
+ case 'Fraction':
291
+ ticks.minor = math.number(math.fraction(minorValues.fraction[minorValues.fraction.length - 1]));
292
+ ticks.fractionTick = minorValues.fraction[minorValues.fraction.length - 1];
293
+ ticks.decimalTick = minorValues.decimal[0];
294
+ break;
295
+ case 'Decimal':
296
+ case 'Integer':
297
+ ticks.minor = minorValues.decimal[minorValues.decimal.length - 1];
298
+ ticks.decimalTick = minorValues.decimal[minorValues.decimal.length - 1];
299
+ ticks.fractionTick = minorValues.fraction[0];
300
+ }
301
+ } else {
302
+ switch (ticks.tickIntervalType) {
303
+ case 'Fraction':
304
+ let fraction = math.fraction(math.number(ticks.minor));
305
+ ticks.fractionTick = fraction.n + '/' + fraction.d;
306
+ ticks.decimalTick = ticks.decimalTick ? ticks.decimalTick : minorValues.decimal[0];
307
+ break;
308
+ case 'Decimal':
309
+ case 'Integer':
310
+ ticks.decimalTick = ticks.minor;
311
+ ticks.fractionTick = ticks.fractionTick ? ticks.fractionTick : minorValues.fraction[0];
312
+ }
313
+ }
314
+ ticks.integerTick = 1;
315
+ } else if (minorLimits.min < 1 && minorLimits.max >= 1) {
316
+ /*
317
+ * In this scenario all integer, decimal or fraction tick will be enabled
318
+ * */
319
+ minorValues = tickUtils.generateMinorValues(minorLimits);
320
+ if (!(ticks.minor >= minorLimits.min && ticks.minor <= minorLimits.max)) {
321
+ if (minorLimits.min > 0.5) {
322
+ ticks.tickIntervalType = 'Integer';
323
+ }
324
+ switch (ticks.tickIntervalType) {
325
+ case 'Integer':
326
+ ticks.minor = math.number(math.ceil(minorLimits.min));
327
+ ticks.integerTick = ticks.minor;
328
+ ticks.decimalTick = minorLimits.min > 0.5 ? 0 : minorValues.decimal[0];
329
+ ticks.fractionTick = minorLimits.min > 0.5 ? '0' : minorValues.fraction[0];
330
+ break;
331
+ case 'Decimal':
332
+ ticks.minor = minorValues.decimal[0];
333
+ ticks.integerTick = 1;
334
+ ticks.decimalTick = ticks.minor;
335
+ ticks.fractionTick = minorValues.fraction[0];
336
+ break;
337
+ case 'Fraction':
338
+ ticks.minor = math.number(math.fraction(minorValues.fraction[0]));
339
+ ticks.integerTick = 1;
340
+ ticks.decimalTick = minorValues.decimal[0];
341
+ ticks.fractionTick = minorValues.fraction[0];
342
+ }
343
+ } else {
344
+ switch (ticks.tickIntervalType) {
345
+ case 'Integer':
346
+ ticks.integerTick = ticks.minor;
347
+ ticks.decimalTick = minorLimits.min > 0.5 ? 0 : minorValues.decimal[0];
348
+ ticks.fractionTick = minorLimits.min > 0.5 ? '0' : minorValues.fraction[0];
349
+ break;
350
+ case 'Decimal':
351
+ ticks.integerTick = 1;
352
+ ticks.decimalTick = ticks.minor;
353
+ ticks.fractionTick = minorValues.fraction[0];
354
+ break;
355
+ case 'Fraction':
356
+ ticks.integerTick = 1;
357
+ ticks.decimalTick = minorValues.decimal[0];
358
+ let fraction = math.fraction(math.number(ticks.minor));
359
+ ticks.fractionTick = fraction.n + '/' + fraction.d;
360
+ }
361
+ }
362
+ }
363
+ return this.updateMajorValue({ ...graph, ticks });
364
+ };
365
+
366
+ /*
367
+ * This function is duplicated in controller/index.js
368
+ * This function will update major value whenever minor value is changed or tick type is changed
369
+ * @param graph object containing domain, ticks and width value
370
+ * @return graph object with updated ticks values
371
+ * */
372
+ updateMajorValue: any = (graph) => {
373
+ const { domain, ticks, width } = graph;
374
+ majorValues = tickUtils.generateMajorValuesForMinor(ticks.minor, domain, width);
375
+ if (majorValues.decimal.indexOf(ticks.major) === -1) {
376
+ let currIndex = 0;
377
+ if (ticks.tickIntervalType === 'Integer') {
378
+ currIndex = majorValues.decimal.length > 4 ? 4 : majorValues.decimal.length - 1;
379
+ } else {
380
+ currIndex = majorValues.decimal.length - 1;
381
+ }
382
+ ticks.major = majorValues.decimal[currIndex];
383
+ }
384
+ graph.fraction = ticks.tickIntervalType === 'Fraction' && ticks.major < 1;
385
+ return { ...graph, ticks };
386
+ };
387
+
388
+ changeArrows = (arrows) => this.graphChange({ arrows });
389
+
390
+ setDefaults: any = () => {
391
+ const {
392
+ graph: { availableTypes, maxNumberOfPoints },
393
+ } = defaultModel;
394
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
395
+ const graph = { ...cloneDeep(defaultModel.graph), height };
396
+
397
+ this.props.onChange({ graph });
398
+ };
399
+
400
+ moveCorrectResponse: any = (index, el, position) => {
401
+ el.position = position;
402
+
403
+ const { onChange, model } = this.props;
404
+ const update = toSessionFormat(el.type === 'line' && lineIsSwitched(el) ? switchGraphLine(el) : el);
405
+ const correctResponse = [...model.correctResponse];
406
+ correctResponse[index] = update;
407
+
408
+ onChange({ correctResponse });
409
+ };
410
+
411
+ availableTypesChange: any = (availableTypes) => {
412
+ const { model, onChange } = this.props;
413
+ const {
414
+ correctResponse,
415
+ graph: { maxNumberOfPoints },
416
+ } = model;
417
+
418
+ new Set(correctResponse.map(toPointType)).forEach((pointType) => {
419
+ availableTypes[pointType] = true;
420
+ });
421
+
422
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
423
+ const graph = { ...model.graph, availableTypes, height };
424
+
425
+ onChange({ graph });
426
+ };
427
+
428
+ deleteCorrectResponse: any = (indices) => {
429
+ const { model, onChange } = this.props;
430
+ const correctResponse = model.correctResponse.filter((v, index) => !indices.some((d) => d === index));
431
+
432
+ onChange({ correctResponse });
433
+ };
434
+
435
+ addCorrectResponse: any = (data) => {
436
+ const { model, onChange } = this.props;
437
+ const correctResponse = [...model.correctResponse];
438
+ correctResponse.push(toSessionFormat(data));
439
+
440
+ onChange({ correctResponse });
441
+ };
442
+
443
+ clearCorrectResponse: any = () => {
444
+ const { onChange } = this.props;
445
+
446
+ onChange({ correctResponse: [] });
447
+ };
448
+
449
+ undoCorrectResponse: any = () => {
450
+ const { model, onChange } = this.props;
451
+ const correctResponse = [...model.correctResponse];
452
+ correctResponse.pop();
453
+ onChange({ correctResponse });
454
+ };
455
+
456
+ render() {
457
+ const { model, onChange, configuration, onConfigurationChanged, uploadSoundSupport, imageSupport } = this.props;
458
+ const {
459
+ baseInputConfiguration = {},
460
+ contentDimensions = {},
461
+ instruction = {},
462
+ teacherInstructions = {},
463
+ title = {},
464
+ prompt = {},
465
+ rationale = {},
466
+ spellCheck = {},
467
+ mathMlOptions = {},
468
+ numberLineDimensions = {},
469
+ maxMaxElements = 20,
470
+ hidePointConfigButtons = false,
471
+ availableTools = ['PF'],
472
+ settingsPanelDisabled = false,
473
+ } = configuration || {};
474
+ const {
475
+ errors = {},
476
+ extraCSSRules,
477
+ spellCheckEnabled,
478
+ toolbarEditorPosition,
479
+ teacherInstructionsEnabled,
480
+ titleEnabled,
481
+ promptEnabled,
482
+ rationaleEnabled,
483
+ } = model || {};
484
+
485
+ let { graph } = model;
486
+ graph = this.reloadTicksData(graph);
487
+
488
+ const { dialog, correctAnswerDialog } = this.state;
489
+ const {
490
+ correctResponseError,
491
+ domainError,
492
+ maxError,
493
+ pointsError,
494
+ prompt: promptError,
495
+ rationale: rationaleError,
496
+ teacherInstructions: teacherInstructionsError,
497
+ widthError,
498
+ } = errors || {};
499
+ const validationMessage = generateValidationMessage();
500
+ const correctResponse = cloneDeep(model.correctResponse || []).map(toGraphFormat);
501
+ const initialModel = cloneDeep(model);
502
+ initialModel['disabled'] = true;
503
+ const toolbarOpts = {
504
+ position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',
505
+ };
506
+
507
+ const panelProperties = {
508
+ teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
509
+ titleEnabled: title.settings && toggle(title.label),
510
+ promptEnabled: prompt.settings && toggle(prompt.label),
511
+ rationaleEnabled: rationale.settings && toggle(rationale.label),
512
+ spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
513
+ };
514
+
515
+ const getPluginProps = (props = {}) => ({
516
+ ...baseInputConfiguration,
517
+ ...props,
518
+ });
519
+
520
+ return (
521
+ <layout.ConfigLayout
522
+ extraCSSRules={extraCSSRules}
523
+ dimensions={contentDimensions}
524
+ hideSettings={settingsPanelDisabled}
525
+ settings={
526
+ <Panel
527
+ model={model}
528
+ configuration={configuration}
529
+ onChangeModel={onChange}
530
+ onChangeConfiguration={onConfigurationChanged}
531
+ groups={{
532
+ Properties: panelProperties,
533
+ }}
534
+ />
535
+ }
536
+ >
537
+ <Description component="div" type="body1">
538
+ {instruction.label}
539
+ </Description>
540
+
541
+ {teacherInstructionsEnabled && (
542
+ <StyledInputContainer label={teacherInstructions.label}>
543
+ <EditableHtml
544
+ markup={model.teacherInstructions || ''}
545
+ onChange={(teacherInstructions) => onChange({ teacherInstructions })}
546
+ nonEmpty={false}
547
+ disableUnderline
548
+ error={teacherInstructionsError}
549
+ toolbarOpts={toolbarOpts}
550
+ pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}
551
+ spellCheck={spellCheckEnabled}
552
+ imageSupport={imageSupport}
553
+ uploadSoundSupport={uploadSoundSupport}
554
+ languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
555
+ mathMlOptions={mathMlOptions}
556
+ />
557
+ {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}
558
+ </StyledInputContainer>
559
+ )}
560
+
561
+ {promptEnabled && (
562
+ <StyledInputContainer label={prompt.label}>
563
+ <EditableHtml
564
+ markup={model.prompt || ''}
565
+ onChange={(prompt) => onChange({ prompt })}
566
+ nonEmpty={false}
567
+ disableUnderline
568
+ error={promptError}
569
+ toolbarOpts={toolbarOpts}
570
+ pluginProps={getPluginProps(prompt?.inputConfiguration)}
571
+ spellCheck={spellCheckEnabled}
572
+ imageSupport={imageSupport}
573
+ uploadSoundSupport={uploadSoundSupport}
574
+ languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
575
+ mathMlOptions={mathMlOptions}
576
+ />
577
+ {promptError && <ErrorText>{promptError}</ErrorText>}
578
+ </StyledInputContainer>
579
+ )}
580
+
581
+ <CardBar
582
+ header="Set Up Number Line"
583
+ info={
584
+ <Tooltip
585
+ disableFocusListener
586
+ disableTouchListener
587
+ placement={'right'}
588
+ title={validationMessage}
589
+ slotProps={{
590
+ tooltip: {
591
+ sx: (theme) => ({
592
+ fontSize: theme.typography.fontSize - 2,
593
+ whiteSpace: 'pre',
594
+ maxWidth: '500px',
595
+ }),
596
+ },
597
+ }}
598
+ >
599
+ <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '8px' }} />
600
+ </Tooltip>
601
+ }
602
+ >
603
+ Set up the number line by entering the domain and number of tick marks to display. Labels on the number line
604
+ can be edited or removed by clicking on the label.
605
+ </CardBar>
606
+
607
+ <Row>
608
+ <Domain domain={graph.domain} errors={errors} onChange={(domain) => this.graphChange({ domain })} />
609
+ </Row>
610
+
611
+ {maxError && <ErrorText>{maxError}</ErrorText>}
612
+ {domainError && <ErrorText>{domainError}</ErrorText>}
613
+
614
+ <div>
615
+ <FormSection>
616
+ <Ticks
617
+ ticks={graph.ticks}
618
+ minorLimits={minorLimits}
619
+ minorValues={minorValues}
620
+ majorValues={majorValues}
621
+ onChange={this.changeTicks}
622
+ />
623
+ </FormSection>
624
+ </div>
625
+
626
+ <FlexRow>
627
+ {model.widthEnabled && (
628
+ <Size
629
+ size={graph}
630
+ min={numberLineDimensions.min}
631
+ max={numberLineDimensions.max}
632
+ step={numberLineDimensions.step}
633
+ onChange={this.changeSize}
634
+ />
635
+ )}
636
+ <div></div>
637
+ <Arrows arrows={graph.arrows} onChange={this.changeArrows} />
638
+ </FlexRow>
639
+
640
+ {widthError && <ErrorText>{widthError}</ErrorText>}
641
+
642
+ <NumberLineComponent
643
+ onMoveElement={() => {}}
644
+ onDeleteElements={() => {}}
645
+ onAddElement={() => {}}
646
+ onClearElements={() => {}}
647
+ onUndoElement={() => {}}
648
+ minWidth={numberLineDimensions.min}
649
+ maxWidth={numberLineDimensions.max}
650
+ maxHeight={70}
651
+ model={trimModel(initialModel)}
652
+ />
653
+
654
+ {titleEnabled && (
655
+ <StyledFormSection label={title?.label || 'Title'}>
656
+ <EditableHtml
657
+ markup={graph.title || ''}
658
+ onChange={this.changeGraphTitle}
659
+ toolbarOpts={toolbarOpts}
660
+ activePlugins={[
661
+ 'bold',
662
+ 'html',
663
+ 'italic',
664
+ 'underline',
665
+ 'strikethrough',
666
+ 'image',
667
+ 'math',
668
+ 'languageCharacters',
669
+ 'responseArea',
670
+ ]}
671
+ pluginProps={getPluginProps(title?.inputConfiguration)}
672
+ spellCheck={spellCheckEnabled}
673
+ imageSupport={imageSupport}
674
+ uploadSoundSupport={uploadSoundSupport}
675
+ languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
676
+ mathMlOptions={mathMlOptions}
677
+ />
678
+ </StyledFormSection>
679
+ )}
680
+
681
+ {!graph.exhibitOnly && (
682
+ <React.Fragment>
683
+ <CardBar header="Define Tool Set and Correct Response">
684
+ Select answer type and place it on the number line. Intersecting points, line segments and/or rays will
685
+ appear above the number line. <i>Note: A maximum of 20 points, line segments or rays may be plotted.</i>
686
+ </CardBar>
687
+
688
+ <CardBar header="Available Tools" mini>
689
+ Click on the input options to be displayed to the students. All inputs will display by default.
690
+ </CardBar>
691
+
692
+ <PointTypeChooser>
693
+ <PointConfig
694
+ onSelectionChange={this.availableTypesChange}
695
+ selection={graph.availableTypes}
696
+ availableTools={availableTools}
697
+ hideButtons={hidePointConfigButtons}
698
+ />
699
+ </PointTypeChooser>
700
+
701
+ <FlexRowFormSection>
702
+ <label>Max No of Elements</label>
703
+ <StyledNumberTextField
704
+ min={1}
705
+ max={maxMaxElements}
706
+ onlyIntegersAllowed={true}
707
+ value={graph.maxNumberOfPoints}
708
+ onChange={this.changeMaxNoOfPoints}
709
+ />
710
+ {pointsError && <ErrorText>{pointsError}</ErrorText>}
711
+ </FlexRowFormSection>
712
+
713
+ <label>Correct Answer</label>
714
+
715
+ <NumberLineComponent
716
+ onMoveElement={this.moveCorrectResponse}
717
+ onDeleteElements={this.deleteCorrectResponse}
718
+ onAddElement={this.addCorrectResponse}
719
+ onClearElements={this.clearCorrectResponse}
720
+ onUndoElement={this.undoCorrectResponse}
721
+ minWidth={numberLineDimensions.min}
722
+ maxWidth={numberLineDimensions.max}
723
+ answer={correctResponse}
724
+ //strip feedback for this model
725
+ model={trimModel(model)}
726
+ />
727
+ {correctResponseError && <ErrorText>{correctResponseError}</ErrorText>}
728
+ </React.Fragment>
729
+ )}
730
+ <AlertDialog
731
+ open={dialog.open}
732
+ title="Warning"
733
+ text={dialog.text}
734
+ onConfirm={() => this.setState({ dialog: { open: false } })}
735
+ />
736
+ <AlertDialog
737
+ open={correctAnswerDialog.open}
738
+ title="Warning"
739
+ text={correctAnswerDialog.text}
740
+ onConfirm={() => {
741
+ let indices = this.state.correctAnswerDialog.indices;
742
+ if (indices && indices.length > 0) {
743
+ this.deleteCorrectResponse(indices);
744
+ }
745
+ this.setState({ correctAnswerDialog: { open: false } });
746
+ }}
747
+ onClose={() => {
748
+ const graph = this.state.correctAnswerDialog.graph;
749
+ onChange({ graph });
750
+ this.setState({ correctAnswerDialog: { open: false } });
751
+ }}
752
+ onConfirmText={'OK'}
753
+ onCloseText={'Cancel'}
754
+ />
755
+ {rationaleEnabled && (
756
+ <StyledInputContainer label={rationale.label || 'Rationale'}>
757
+ <EditableHtml
758
+ markup={model.rationale || ''}
759
+ onChange={(rationale) => onChange({ rationale })}
760
+ error={rationaleError}
761
+ toolbarOpts={toolbarOpts}
762
+ spellCheck={spellCheckEnabled}
763
+ pluginProps={getPluginProps(rationale?.inputConfiguration)}
764
+ imageSupport={imageSupport}
765
+ uploadSoundSupport={uploadSoundSupport}
766
+ languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
767
+ mathMlOptions={mathMlOptions}
768
+ />
769
+ {rationaleError && <ErrorText>{rationaleError}</ErrorText>}
770
+ </StyledInputContainer>
771
+ )}
772
+ </layout.ConfigLayout>
773
+ );
774
+ }
775
+ }
776
+
777
+ export default Main;