@pie-element/drawing-response 12.1.1-next.0 → 12.1.1-next.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/CHANGELOG.json +547 -0
  2. package/CHANGELOG.md +1956 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +1 -0
  5. package/configure/CHANGELOG.json +367 -0
  6. package/configure/CHANGELOG.md +1756 -0
  7. package/configure/lib/button.js +37 -0
  8. package/configure/lib/button.js.map +1 -0
  9. package/configure/lib/defaults.js +116 -0
  10. package/configure/lib/defaults.js.map +1 -0
  11. package/configure/lib/image-container.js +307 -0
  12. package/configure/lib/image-container.js.map +1 -0
  13. package/configure/lib/index.js +147 -0
  14. package/configure/lib/index.js.map +1 -0
  15. package/configure/lib/root.js +219 -0
  16. package/configure/lib/root.js.map +1 -0
  17. package/configure/package.json +24 -0
  18. package/configure/src/__tests__/image-container.test.jsx +231 -0
  19. package/configure/src/__tests__/index.test.js +72 -0
  20. package/configure/src/__tests__/root.test.jsx +110 -0
  21. package/configure/src/button.jsx +33 -0
  22. package/configure/src/defaults.js +80 -0
  23. package/configure/src/image-container.jsx +316 -0
  24. package/configure/src/index.js +167 -0
  25. package/configure/src/root.jsx +198 -0
  26. package/controller/CHANGELOG.json +52 -0
  27. package/controller/CHANGELOG.md +257 -0
  28. package/controller/lib/defaults.js +22 -0
  29. package/controller/lib/defaults.js.map +1 -0
  30. package/controller/lib/index.js +84 -0
  31. package/controller/lib/index.js.map +1 -0
  32. package/controller/package.json +16 -0
  33. package/controller/src/__tests__/index.test.js +172 -0
  34. package/controller/src/defaults.js +12 -0
  35. package/controller/src/index.js +71 -0
  36. package/docs/config-schema.json +1766 -0
  37. package/docs/config-schema.json.md +1313 -0
  38. package/docs/demo/config.js +8 -0
  39. package/docs/demo/generate.js +14 -0
  40. package/docs/demo/index.html +1 -0
  41. package/docs/demo/session.js +37 -0
  42. package/docs/pie-schema.json +823 -0
  43. package/docs/pie-schema.json.md +606 -0
  44. package/lib/drawing-response/button.js +49 -0
  45. package/lib/drawing-response/button.js.map +1 -0
  46. package/lib/drawing-response/constants.js +43 -0
  47. package/lib/drawing-response/constants.js.map +1 -0
  48. package/lib/drawing-response/container.js +327 -0
  49. package/lib/drawing-response/container.js.map +1 -0
  50. package/lib/drawing-response/drawable-circle.js +80 -0
  51. package/lib/drawing-response/drawable-circle.js.map +1 -0
  52. package/lib/drawing-response/drawable-eraser.js +64 -0
  53. package/lib/drawing-response/drawable-eraser.js.map +1 -0
  54. package/lib/drawing-response/drawable-free-path.js +71 -0
  55. package/lib/drawing-response/drawable-free-path.js.map +1 -0
  56. package/lib/drawing-response/drawable-helper.js +34 -0
  57. package/lib/drawing-response/drawable-helper.js.map +1 -0
  58. package/lib/drawing-response/drawable-image.js +41 -0
  59. package/lib/drawing-response/drawable-image.js.map +1 -0
  60. package/lib/drawing-response/drawable-line.js +75 -0
  61. package/lib/drawing-response/drawable-line.js.map +1 -0
  62. package/lib/drawing-response/drawable-main.js +345 -0
  63. package/lib/drawing-response/drawable-main.js.map +1 -0
  64. package/lib/drawing-response/drawable-palette.js +140 -0
  65. package/lib/drawing-response/drawable-palette.js.map +1 -0
  66. package/lib/drawing-response/drawable-rectangle.js +80 -0
  67. package/lib/drawing-response/drawable-rectangle.js.map +1 -0
  68. package/lib/drawing-response/drawable-text.js +295 -0
  69. package/lib/drawing-response/drawable-text.js.map +1 -0
  70. package/lib/drawing-response/drawable-transformer.js +52 -0
  71. package/lib/drawing-response/drawable-transformer.js.map +1 -0
  72. package/lib/drawing-response/factory.js +22 -0
  73. package/lib/drawing-response/factory.js.map +1 -0
  74. package/lib/drawing-response/icon.js +55 -0
  75. package/lib/drawing-response/icon.js.map +1 -0
  76. package/lib/drawing-response/index.js +91 -0
  77. package/lib/drawing-response/index.js.map +1 -0
  78. package/lib/index.js +68 -0
  79. package/lib/index.js.map +1 -0
  80. package/package.json +19 -55
  81. package/src/__tests__/drawing-index-test.jsx +103 -0
  82. package/src/drawing-response/__tests__/container.test.jsx +82 -0
  83. package/src/drawing-response/__tests__/drawable-helper.test.jsx +24 -0
  84. package/src/drawing-response/__tests__/drawing-main.test.jsx +855 -0
  85. package/src/drawing-response/__tests__/factory.test.js +13 -0
  86. package/src/drawing-response/button.jsx +45 -0
  87. package/src/drawing-response/constants.js +44 -0
  88. package/src/drawing-response/container.jsx +301 -0
  89. package/src/drawing-response/drawable-circle.jsx +74 -0
  90. package/src/drawing-response/drawable-eraser.jsx +53 -0
  91. package/src/drawing-response/drawable-free-path.jsx +59 -0
  92. package/src/drawing-response/drawable-helper.jsx +21 -0
  93. package/src/drawing-response/drawable-image.jsx +36 -0
  94. package/src/drawing-response/drawable-line.jsx +62 -0
  95. package/src/drawing-response/drawable-main.jsx +333 -0
  96. package/src/drawing-response/drawable-palette.jsx +99 -0
  97. package/src/drawing-response/drawable-rectangle.jsx +69 -0
  98. package/src/drawing-response/drawable-text.jsx +318 -0
  99. package/src/drawing-response/drawable-transformer.jsx +52 -0
  100. package/src/drawing-response/factory.js +17 -0
  101. package/src/drawing-response/icon.jsx +52 -0
  102. package/src/drawing-response/index.jsx +92 -0
  103. package/src/index.js +72 -0
  104. package/dist/author/button.d.ts +0 -29
  105. package/dist/author/button.js +0 -25
  106. package/dist/author/defaults.d.ts +0 -118
  107. package/dist/author/defaults.js +0 -86
  108. package/dist/author/image-container.d.ts +0 -42
  109. package/dist/author/image-container.js +0 -183
  110. package/dist/author/index.d.ts +0 -37
  111. package/dist/author/index.js +0 -79
  112. package/dist/author/root.d.ts +0 -17
  113. package/dist/author/root.js +0 -142
  114. package/dist/controller/defaults.d.ts +0 -24
  115. package/dist/controller/defaults.js +0 -18
  116. package/dist/controller/index.d.ts +0 -13
  117. package/dist/controller/index.js +0 -46
  118. package/dist/delivery/drawing-response/button.d.ts +0 -31
  119. package/dist/delivery/drawing-response/button.js +0 -36
  120. package/dist/delivery/drawing-response/constants.d.ts +0 -16
  121. package/dist/delivery/drawing-response/constants.js +0 -40
  122. package/dist/delivery/drawing-response/container.d.ts +0 -32
  123. package/dist/delivery/drawing-response/container.js +0 -212
  124. package/dist/delivery/drawing-response/drawable-circle.d.ts +0 -18
  125. package/dist/delivery/drawing-response/drawable-circle.js +0 -51
  126. package/dist/delivery/drawing-response/drawable-eraser.d.ts +0 -17
  127. package/dist/delivery/drawing-response/drawable-eraser.js +0 -52
  128. package/dist/delivery/drawing-response/drawable-free-path.d.ts +0 -18
  129. package/dist/delivery/drawing-response/drawable-free-path.js +0 -52
  130. package/dist/delivery/drawing-response/drawable-helper.d.ts +0 -17
  131. package/dist/delivery/drawing-response/drawable-helper.js +0 -12
  132. package/dist/delivery/drawing-response/drawable-image.d.ts +0 -24
  133. package/dist/delivery/drawing-response/drawable-image.js +0 -28
  134. package/dist/delivery/drawing-response/drawable-line.d.ts +0 -18
  135. package/dist/delivery/drawing-response/drawable-line.js +0 -53
  136. package/dist/delivery/drawing-response/drawable-main.d.ts +0 -25
  137. package/dist/delivery/drawing-response/drawable-main.js +0 -212
  138. package/dist/delivery/drawing-response/drawable-palette.d.ts +0 -14
  139. package/dist/delivery/drawing-response/drawable-palette.js +0 -89
  140. package/dist/delivery/drawing-response/drawable-rectangle.d.ts +0 -18
  141. package/dist/delivery/drawing-response/drawable-rectangle.js +0 -49
  142. package/dist/delivery/drawing-response/drawable-text.d.ts +0 -30
  143. package/dist/delivery/drawing-response/drawable-text.js +0 -189
  144. package/dist/delivery/drawing-response/drawable-transformer.d.ts +0 -16
  145. package/dist/delivery/drawing-response/drawable-transformer.js +0 -35
  146. package/dist/delivery/drawing-response/factory.d.ts +0 -11
  147. package/dist/delivery/drawing-response/factory.js +0 -19
  148. package/dist/delivery/drawing-response/icon.d.ts +0 -19
  149. package/dist/delivery/drawing-response/icon.js +0 -52
  150. package/dist/delivery/drawing-response/index.d.ts +0 -18
  151. package/dist/delivery/drawing-response/index.js +0 -70
  152. package/dist/delivery/index.d.ts +0 -19
  153. package/dist/delivery/index.js +0 -47
  154. package/dist/index.d.ts +0 -1
  155. package/dist/index.iife.d.ts +0 -8
  156. package/dist/index.iife.js +0 -165
  157. package/dist/index.js +0 -2
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.js +0 -9
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.js +0 -19
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.js +0 -7
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.js +0 -9
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  240. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  241. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
  242. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  243. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  244. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  245. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  246. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  247. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  248. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  249. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  250. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  251. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  252. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  253. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  254. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  255. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  256. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  257. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  258. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  259. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  260. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  261. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  262. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  263. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  264. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  265. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  266. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_parent.js +0 -8
  267. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  268. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  269. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  270. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  271. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  272. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  273. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  274. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  275. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  276. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  277. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  278. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  279. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  280. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  281. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  282. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  283. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  284. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/flatten.js +0 -7
  285. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  286. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  287. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  288. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  289. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  290. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  291. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  292. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  293. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  294. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  295. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  296. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  297. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js +0 -14
  298. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  299. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  300. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  301. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  302. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  303. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
  304. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  305. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/omit.js +0 -21
  306. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  307. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  308. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
@@ -0,0 +1,172 @@
1
+ import { model, outcome } from '../index';
2
+
3
+ describe('controller', () => {
4
+ let result, question, session, env;
5
+
6
+ beforeEach(() => {
7
+ question = {
8
+ prompt: 'This is the question prompt',
9
+ promptEnabled: true,
10
+ imageUrl: '',
11
+ imageDimensions: {
12
+ height: 0,
13
+ width: 0,
14
+ },
15
+ teacherInstructions: 'Teacher Instructions',
16
+ backgroundImageEnabled: true,
17
+ };
18
+ });
19
+
20
+ describe('outcome', () => {
21
+ it('returns score of 0', async () => {
22
+ const result = await outcome(question);
23
+ expect(result.score).toEqual(0);
24
+ });
25
+ });
26
+
27
+ describe('model', () => {
28
+ describe('mode: gather', () => {
29
+ beforeEach(async () => {
30
+ session = {};
31
+ env = { mode: 'gather' };
32
+ result = await model(question, session, env);
33
+ });
34
+
35
+ it('returns mode', () => {
36
+ expect(result.mode).toEqual('gather');
37
+ });
38
+
39
+ it('returns prompt', () => {
40
+ expect(result.prompt).toEqual('This is the question prompt');
41
+ });
42
+
43
+ it('returns imageDimensions', () => {
44
+ expect(result.imageDimensions).toEqual({ height: 0, width: 0 });
45
+ });
46
+
47
+ it('does not return responseCorrect', () => {
48
+ expect(result.responseCorrect).toBe(undefined);
49
+ });
50
+
51
+ it('gather mode promptEnabled: true', async () => {
52
+ result = await model(question, {}, { mode: 'gather' });
53
+
54
+ expect(result).toEqual({
55
+ disabled: false,
56
+ mode: 'gather',
57
+ imageUrl: question.imageUrl,
58
+ imageDimensions: question.imageDimensions,
59
+ prompt: question.prompt,
60
+ teacherInstructions: null,
61
+ backgroundImageEnabled: question.backgroundImageEnabled,
62
+ });
63
+ });
64
+
65
+ it('gather mode promptEnabled: false', async () => {
66
+ result = await model({ ...question, promptEnabled: false }, {}, { mode: 'gather' });
67
+
68
+ expect(result).toEqual({
69
+ disabled: false,
70
+ mode: 'gather',
71
+ imageUrl: question.imageUrl,
72
+ imageDimensions: question.imageDimensions,
73
+ prompt: null,
74
+ teacherInstructions: null,
75
+ backgroundImageEnabled: question.backgroundImageEnabled,
76
+ });
77
+ });
78
+
79
+ it('view mode, student role', async () => {
80
+ result = await model(question, {}, { mode: 'view' });
81
+
82
+ expect(result).toEqual({
83
+ disabled: true,
84
+ mode: 'view',
85
+ imageUrl: question.imageUrl,
86
+ imageDimensions: question.imageDimensions,
87
+ prompt: question.prompt,
88
+ teacherInstructions: null,
89
+ backgroundImageEnabled: question.backgroundImageEnabled,
90
+ });
91
+ });
92
+
93
+ it('view mode, instructor role and teacherInstructions enabled', async () => {
94
+ result = await model(question, {}, { mode: 'view', role: 'instructor' });
95
+
96
+ expect(result).toEqual({
97
+ disabled: true,
98
+ mode: 'view',
99
+ imageUrl: question.imageUrl,
100
+ imageDimensions: question.imageDimensions,
101
+ prompt: question.prompt,
102
+ teacherInstructions: question.teacherInstructions,
103
+ backgroundImageEnabled: question.backgroundImageEnabled,
104
+ });
105
+ });
106
+
107
+ it('evaluate mode, instructor role and teacherInstructions disabled', async () => {
108
+ result = await model(
109
+ { ...question, teacherInstructionsEnabled: false },
110
+ {},
111
+ { mode: 'evaluate', role: 'instructor' },
112
+ );
113
+
114
+ expect(result).toEqual({
115
+ disabled: true,
116
+ mode: 'evaluate',
117
+ imageUrl: question.imageUrl,
118
+ imageDimensions: question.imageDimensions,
119
+ prompt: question.prompt,
120
+ teacherInstructions: null,
121
+ backgroundImageEnabled: question.backgroundImageEnabled,
122
+ });
123
+ });
124
+
125
+ it('evaluate mode, student role', async () => {
126
+ result = await model(question, {}, { mode: 'evaluate' });
127
+
128
+ expect(result).toEqual({
129
+ disabled: true,
130
+ mode: 'evaluate',
131
+ imageUrl: question.imageUrl,
132
+ imageDimensions: question.imageDimensions,
133
+ prompt: question.prompt,
134
+ teacherInstructions: null,
135
+ backgroundImageEnabled: question.backgroundImageEnabled,
136
+ });
137
+ });
138
+
139
+ it('evaluate mode, instructor role and teacherInstructions enabled', async () => {
140
+ result = await model(question, {}, { mode: 'evaluate', role: 'instructor' });
141
+
142
+ expect(result).toEqual({
143
+ disabled: true,
144
+ mode: 'evaluate',
145
+ imageUrl: question.imageUrl,
146
+ imageDimensions: question.imageDimensions,
147
+ prompt: question.prompt,
148
+ teacherInstructions: question.teacherInstructions,
149
+ backgroundImageEnabled: question.backgroundImageEnabled,
150
+ });
151
+ });
152
+
153
+ it('view mode, instructor role and teacherInstructions disabled', async () => {
154
+ result = await model(
155
+ { ...question, teacherInstructionsEnabled: false },
156
+ {},
157
+ { mode: 'view', role: 'instructor' },
158
+ );
159
+
160
+ expect(result).toEqual({
161
+ disabled: true,
162
+ mode: 'view',
163
+ imageUrl: question.imageUrl,
164
+ imageDimensions: question.imageDimensions,
165
+ prompt: question.prompt,
166
+ teacherInstructions: null,
167
+ backgroundImageEnabled: question.backgroundImageEnabled,
168
+ });
169
+ });
170
+ });
171
+ });
172
+ });
@@ -0,0 +1,12 @@
1
+ export default {
2
+ backgroundImageEnabled: true,
3
+ imageDimensions: { height: 0, width: 0 },
4
+ imageUrl: '',
5
+ prompt: '',
6
+ promptEnabled: true,
7
+ spellCheckEnabled: true,
8
+ studentInstructionsEnabled: true,
9
+ teacherInstructions: '',
10
+ teacherInstructionsEnabled: true,
11
+ toolbarEditorPosition: 'bottom',
12
+ };
@@ -0,0 +1,71 @@
1
+ import debug from 'debug';
2
+ import defaults from './defaults';
3
+
4
+ const log = debug('pie-elements:drawing-response:controller');
5
+
6
+ export const normalize = (question) => ({ ...defaults, ...question });
7
+
8
+ export function model(question, session, env) {
9
+ const normalizedQuestion = normalize(question);
10
+ const { extraCSSRules, imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled, language } = normalizedQuestion;
11
+
12
+ return new Promise((resolve) => {
13
+ const out = {
14
+ disabled: env.mode !== 'gather',
15
+ mode: env.mode,
16
+ imageDimensions,
17
+ imageUrl,
18
+ prompt: promptEnabled ? prompt : null,
19
+ backgroundImageEnabled,
20
+ language,
21
+ extraCSSRules,
22
+ };
23
+
24
+ if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
25
+ out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled
26
+ ? normalizedQuestion.teacherInstructions
27
+ : null;
28
+ } else {
29
+ out.teacherInstructions = null;
30
+ }
31
+
32
+ resolve(out);
33
+ });
34
+ }
35
+
36
+ export const createDefaultModel = (model = {}) =>
37
+ new Promise((resolve) => {
38
+ resolve({
39
+ ...defaults,
40
+ ...model,
41
+ });
42
+ });
43
+
44
+ export function outcome(/*config, session*/) {
45
+ return new Promise((resolve) => {
46
+ log('outcome...');
47
+ resolve({
48
+ score: 0,
49
+ completed: 'n/a',
50
+ note: 'Requires manual scoring',
51
+ });
52
+ });
53
+ }
54
+
55
+ // remove all html tags
56
+ const getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');
57
+
58
+ // remove all html tags except img, iframe and source tag for audio
59
+ const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
60
+
61
+ export const validate = (model = {}, config = {}) => {
62
+ const errors = {};
63
+
64
+ ['teacherInstructions', 'prompt'].forEach((field) => {
65
+ if (config[field]?.required && !getContent(model[field])) {
66
+ errors[field] = 'This field is required.';
67
+ }
68
+ });
69
+
70
+ return errors;
71
+ };