@pie-element/categorize 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 (238) hide show
  1. package/dist/author/defaults.d.ts +224 -0
  2. package/dist/author/defaults.d.ts.map +1 -0
  3. package/dist/author/defaults.js +170 -0
  4. package/dist/author/design/builder.d.ts +11 -0
  5. package/dist/author/design/builder.d.ts.map +1 -0
  6. package/dist/author/design/builder.js +24 -0
  7. package/dist/author/design/buttons.d.ts +29 -0
  8. package/dist/author/design/buttons.d.ts.map +1 -0
  9. package/dist/author/design/buttons.js +36 -0
  10. package/dist/author/design/categories/RowLabel.d.ts +24 -0
  11. package/dist/author/design/categories/RowLabel.d.ts.map +1 -0
  12. package/dist/author/design/categories/RowLabel.js +46 -0
  13. package/dist/author/design/categories/alternateResponses.d.ts +32 -0
  14. package/dist/author/design/categories/alternateResponses.d.ts.map +1 -0
  15. package/dist/author/design/categories/alternateResponses.js +62 -0
  16. package/dist/author/design/categories/category.d.ts +45 -0
  17. package/dist/author/design/categories/category.d.ts.map +1 -0
  18. package/dist/author/design/categories/category.js +102 -0
  19. package/dist/author/design/categories/choice-preview.d.ts +26 -0
  20. package/dist/author/design/categories/choice-preview.d.ts.map +1 -0
  21. package/dist/author/design/categories/choice-preview.js +60 -0
  22. package/dist/author/design/categories/droppable-placeholder.d.ts +11 -0
  23. package/dist/author/design/categories/droppable-placeholder.d.ts.map +1 -0
  24. package/dist/author/design/categories/droppable-placeholder.js +70 -0
  25. package/dist/author/design/categories/index.d.ts +42 -0
  26. package/dist/author/design/categories/index.d.ts.map +1 -0
  27. package/dist/author/design/categories/index.js +146 -0
  28. package/dist/author/design/choices/choice.d.ts +11 -0
  29. package/dist/author/design/choices/choice.d.ts.map +1 -0
  30. package/dist/author/design/choices/choice.js +129 -0
  31. package/dist/author/design/choices/config.d.ts +22 -0
  32. package/dist/author/design/choices/config.d.ts.map +1 -0
  33. package/dist/author/design/choices/config.js +33 -0
  34. package/dist/author/design/choices/index.d.ts +42 -0
  35. package/dist/author/design/choices/index.d.ts.map +1 -0
  36. package/dist/author/design/choices/index.js +110 -0
  37. package/dist/author/design/header.d.ts +25 -0
  38. package/dist/author/design/header.d.ts.map +1 -0
  39. package/dist/author/design/header.js +49 -0
  40. package/dist/author/design/index.d.ts +53 -0
  41. package/dist/author/design/index.d.ts.map +1 -0
  42. package/dist/author/design/index.js +410 -0
  43. package/dist/author/design/input-header.d.ts +40 -0
  44. package/dist/author/design/input-header.d.ts.map +1 -0
  45. package/dist/author/design/input-header.js +69 -0
  46. package/dist/author/design/utils.d.ts +10 -0
  47. package/dist/author/design/utils.d.ts.map +1 -0
  48. package/dist/author/design/utils.js +7 -0
  49. package/dist/author/index.d.ts +52 -0
  50. package/dist/author/index.d.ts.map +1 -0
  51. package/dist/author/index.js +87 -0
  52. package/dist/author/main.d.ts +24 -0
  53. package/dist/author/main.d.ts.map +1 -0
  54. package/dist/author/main.js +30 -0
  55. package/dist/author/utils.d.ts +17 -0
  56. package/dist/author/utils.d.ts.map +1 -0
  57. package/dist/author/utils.js +17 -0
  58. package/dist/controller/defaults.d.ts +35 -0
  59. package/dist/controller/defaults.d.ts.map +1 -0
  60. package/dist/controller/defaults.js +29 -0
  61. package/dist/controller/index.d.ts +62 -0
  62. package/dist/controller/index.d.ts.map +1 -0
  63. package/dist/controller/index.js +155 -0
  64. package/dist/controller/utils.d.ts +21 -0
  65. package/dist/controller/utils.d.ts.map +1 -0
  66. package/dist/controller/utils.js +35 -0
  67. package/dist/delivery/categorize/categories.d.ts +35 -0
  68. package/dist/delivery/categorize/categories.d.ts.map +1 -0
  69. package/dist/delivery/categorize/categories.js +66 -0
  70. package/dist/delivery/categorize/category.d.ts +29 -0
  71. package/dist/delivery/categorize/category.d.ts.map +1 -0
  72. package/dist/delivery/categorize/category.js +48 -0
  73. package/dist/delivery/categorize/choice.d.ts +28 -0
  74. package/dist/delivery/categorize/choice.d.ts.map +1 -0
  75. package/dist/delivery/categorize/choice.js +94 -0
  76. package/dist/delivery/categorize/choices.d.ts +40 -0
  77. package/dist/delivery/categorize/choices.d.ts.map +1 -0
  78. package/dist/delivery/categorize/choices.js +51 -0
  79. package/dist/delivery/categorize/droppable-placeholder.d.ts +33 -0
  80. package/dist/delivery/categorize/droppable-placeholder.d.ts.map +1 -0
  81. package/dist/delivery/categorize/droppable-placeholder.js +64 -0
  82. package/dist/delivery/categorize/grid-content.d.ts +26 -0
  83. package/dist/delivery/categorize/grid-content.d.ts.map +1 -0
  84. package/dist/delivery/categorize/grid-content.js +39 -0
  85. package/dist/delivery/categorize/index.d.ts +58 -0
  86. package/dist/delivery/categorize/index.d.ts.map +1 -0
  87. package/dist/delivery/categorize/index.js +260 -0
  88. package/dist/delivery/index.d.ts +28 -0
  89. package/dist/delivery/index.d.ts.map +1 -0
  90. package/dist/delivery/index.js +152 -0
  91. package/dist/index.d.ts +2 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.iife.d.ts +9 -0
  94. package/dist/index.iife.d.ts.map +1 -0
  95. package/dist/index.iife.js +152 -0
  96. package/dist/index.js +2 -0
  97. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  98. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  99. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  100. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  101. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  102. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  103. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  104. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  105. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  106. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  107. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  108. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  198. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  199. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  200. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  201. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  202. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  203. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  204. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  205. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  206. package/package.json +74 -0
  207. package/src/author/defaults.ts +182 -0
  208. package/src/author/design/builder.ts +63 -0
  209. package/src/author/design/buttons.tsx +60 -0
  210. package/src/author/design/categories/RowLabel.tsx +91 -0
  211. package/src/author/design/categories/alternateResponses.tsx +127 -0
  212. package/src/author/design/categories/category.tsx +161 -0
  213. package/src/author/design/categories/choice-preview.tsx +112 -0
  214. package/src/author/design/categories/droppable-placeholder.tsx +114 -0
  215. package/src/author/design/categories/index.tsx +254 -0
  216. package/src/author/design/choices/choice.tsx +200 -0
  217. package/src/author/design/choices/config.tsx +58 -0
  218. package/src/author/design/choices/index.tsx +185 -0
  219. package/src/author/design/header.tsx +74 -0
  220. package/src/author/design/index.tsx +764 -0
  221. package/src/author/design/input-header.tsx +109 -0
  222. package/src/author/design/utils.ts +14 -0
  223. package/src/author/index.ts +171 -0
  224. package/src/author/main.tsx +45 -0
  225. package/src/author/utils.ts +46 -0
  226. package/src/controller/defaults.ts +37 -0
  227. package/src/controller/index.ts +469 -0
  228. package/src/controller/utils.ts +79 -0
  229. package/src/delivery/categorize/categories.tsx +139 -0
  230. package/src/delivery/categorize/category.tsx +78 -0
  231. package/src/delivery/categorize/choice.tsx +117 -0
  232. package/src/delivery/categorize/choices.tsx +95 -0
  233. package/src/delivery/categorize/droppable-placeholder.tsx +95 -0
  234. package/src/delivery/categorize/grid-content.tsx +53 -0
  235. package/src/delivery/categorize/index.tsx +515 -0
  236. package/src/delivery/index.ts +390 -0
  237. package/src/index.iife.ts +16 -0
  238. package/src/index.ts +1 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/categories/category.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Category extends React.Component {
12
+ static propTypes: {
13
+ alternateResponseIndex: PropTypes.Requireable<number>;
14
+ category: PropTypes.Validator<object>;
15
+ configuration: PropTypes.Validator<object>;
16
+ defaultImageMaxHeight: PropTypes.Requireable<number>;
17
+ defaultImageMaxWidth: PropTypes.Requireable<number>;
18
+ deleteFocusedEl: PropTypes.Requireable<(...args: any[]) => any>;
19
+ focusedEl: PropTypes.Requireable<number>;
20
+ index: PropTypes.Requireable<number>;
21
+ error: PropTypes.Requireable<string>;
22
+ isDuplicated: PropTypes.Requireable<boolean>;
23
+ maxImageWidth: PropTypes.Requireable<object>;
24
+ maxImageHeight: PropTypes.Requireable<object>;
25
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
26
+ onDelete: PropTypes.Requireable<(...args: any[]) => any>;
27
+ onDeleteChoice: PropTypes.Requireable<(...args: any[]) => any>;
28
+ imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
29
+ add: PropTypes.Validator<(...args: any[]) => any>;
30
+ delete: PropTypes.Validator<(...args: any[]) => any>;
31
+ }>>;
32
+ toolbarOpts: PropTypes.Requireable<object>;
33
+ spellCheck: PropTypes.Requireable<boolean>;
34
+ uploadSoundSupport: PropTypes.Requireable<PropTypes.InferProps<{
35
+ add: PropTypes.Validator<(...args: any[]) => any>;
36
+ delete: PropTypes.Validator<(...args: any[]) => any>;
37
+ }>>;
38
+ isAlternate: PropTypes.Requireable<boolean>;
39
+ };
40
+ static defaultProps: {};
41
+ changeLabel: any;
42
+ render(): React.JSX.Element;
43
+ }
44
+ export default Category;
45
+ //# sourceMappingURL=category.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../../src/author/design/categories/category.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAuCnC,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS;IAC3C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2Bd;IAEF,MAAM,CAAC,YAAY,KAAM;IAEzB,WAAW,EAAE,GAAG,CAId;IAEF,MAAM;CAsEP;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,102 @@
1
+ import e from "../input-header.js";
2
+ import { DeleteButton as t } from "../buttons.js";
3
+ import n from "./droppable-placeholder.js";
4
+ import r from "react";
5
+ import i from "prop-types";
6
+ import { styled as a } from "@mui/material/styles";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import c from "@mui/material/Card";
9
+ import l from "@mui/material/CardActions";
10
+ //#region src/author/design/categories/category.tsx
11
+ var u = a(c, { shouldForwardProp: (e) => e !== "isDuplicated" })(({ theme: e, isDuplicated: t }) => ({
12
+ minWidth: "196px",
13
+ padding: e.spacing(1),
14
+ overflow: "visible",
15
+ ...t && { border: "1px solid red" }
16
+ })), d = a(l)(({ theme: e }) => ({
17
+ padding: 0,
18
+ paddingBottom: 0,
19
+ paddingTop: e.spacing(1)
20
+ })), f = a("div")(({ theme: e }) => ({
21
+ padding: e.spacing(2),
22
+ "& p": { margin: 0 }
23
+ })), p = a("div")(({ theme: e }) => ({
24
+ fontSize: e.typography.fontSize - 2,
25
+ color: e.palette.error.main,
26
+ paddingBottom: e.spacing(1)
27
+ })), m = class extends r.Component {
28
+ static propTypes = {
29
+ alternateResponseIndex: i.number,
30
+ category: i.object.isRequired,
31
+ configuration: i.object.isRequired,
32
+ defaultImageMaxHeight: i.number,
33
+ defaultImageMaxWidth: i.number,
34
+ deleteFocusedEl: i.func,
35
+ focusedEl: i.number,
36
+ index: i.number,
37
+ error: i.string,
38
+ isDuplicated: i.bool,
39
+ maxImageWidth: i.object,
40
+ maxImageHeight: i.object,
41
+ onChange: i.func,
42
+ onDelete: i.func,
43
+ onDeleteChoice: i.func,
44
+ imageSupport: i.shape({
45
+ add: i.func.isRequired,
46
+ delete: i.func.isRequired
47
+ }),
48
+ toolbarOpts: i.object,
49
+ spellCheck: i.bool,
50
+ uploadSoundSupport: i.shape({
51
+ add: i.func.isRequired,
52
+ delete: i.func.isRequired
53
+ }),
54
+ isAlternate: i.bool
55
+ };
56
+ static defaultProps = {};
57
+ changeLabel = (e) => {
58
+ let { category: t, onChange: n } = this.props;
59
+ t.label = e, n(t);
60
+ };
61
+ render() {
62
+ let { alternateResponseIndex: r, category: i, configuration: a, deleteFocusedEl: c, focusedEl: l, index: m, error: h, isDuplicated: g, onDelete: _, onDeleteChoice: v, imageSupport: y, spellCheck: b, toolbarOpts: x, maxImageWidth: S, maxImageHeight: C, uploadSoundSupport: w, mathMlOptions: T = {} } = this.props;
63
+ return /* @__PURE__ */ s(u, {
64
+ isDuplicated: g,
65
+ children: [
66
+ /* @__PURE__ */ s("span", { children: [r || r === 0 ? /* @__PURE__ */ o(f, { dangerouslySetInnerHTML: { __html: i.label } }) : /* @__PURE__ */ o(e, {
67
+ label: i.label,
68
+ focusedEl: l,
69
+ deleteFocusedEl: c,
70
+ index: m,
71
+ disabled: !!r || r === 0,
72
+ error: h,
73
+ onChange: this.changeLabel,
74
+ onDelete: _,
75
+ imageSupport: y,
76
+ toolbarOpts: x,
77
+ spellCheck: b,
78
+ maxImageWidth: S,
79
+ maxImageHeight: C,
80
+ uploadSoundSupport: w,
81
+ mathMlOptions: T,
82
+ configuration: a
83
+ }), h && /* @__PURE__ */ o(p, { children: h })] }),
84
+ /* @__PURE__ */ o(n, {
85
+ alternateResponseIndex: r,
86
+ category: i,
87
+ choices: i.choices,
88
+ onDeleteChoice: v,
89
+ categoryId: i.id,
90
+ extraStyles: { minHeight: "100px" },
91
+ isAlternate: this.props.isAlternate
92
+ }),
93
+ _ && /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(t, {
94
+ label: "delete",
95
+ onClick: _
96
+ }) })
97
+ ]
98
+ });
99
+ }
100
+ };
101
+ //#endregion
102
+ export { m as default };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/categories/choice-preview.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class ChoicePreview extends React.Component {
12
+ static propTypes: {
13
+ alternateResponseIndex: PropTypes.Requireable<number>;
14
+ category: PropTypes.Requireable<object>;
15
+ choice: PropTypes.Validator<object>;
16
+ choiceIndex: PropTypes.Requireable<number>;
17
+ onDelete: PropTypes.Requireable<(...args: any[]) => any>;
18
+ };
19
+ static defaultProps: {
20
+ onDelete: () => void;
21
+ };
22
+ delete: any;
23
+ render(): React.JSX.Element;
24
+ }
25
+ export default ChoicePreview;
26
+ //# sourceMappingURL=choice-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice-preview.d.ts","sourceRoot":"","sources":["../../../../src/author/design/categories/choice-preview.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAiDnC,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS;IAChD,MAAM,CAAC,SAAS;;;;;;MAMd;IACF,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM,EAAE,GAAG,CAGT;IAEF,MAAM;CAgCP;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,60 @@
1
+ import e from "react";
2
+ import * as t from "@pie-lib/render-ui";
3
+ import { HtmlAndMath as n, color as r } from "@pie-lib/render-ui";
4
+ import i from "prop-types";
5
+ import { styled as a } from "@mui/material/styles";
6
+ import { DraggableChoice as o } from "@pie-lib/drag";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ import l from "@mui/material/IconButton";
9
+ import u from "@mui/icons-material/RemoveCircleOutline";
10
+ //#region src/author/design/categories/choice-preview.tsx
11
+ function d(e) {
12
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
13
+ }
14
+ function f(e, t) {
15
+ return !e || d(e) ? e : d(e.default) ? e.default : t && d(e[t]) ? e[t] : t && d(e[t]?.default) ? e[t].default : e;
16
+ }
17
+ var p = f(n, "HtmlAndMath") || f(g.HtmlAndMath, "HtmlAndMath"), m = t, h = m.default, g = h && typeof h == "object" ? h : m, _ = a("div")({
18
+ position: "relative",
19
+ overflow: "auto",
20
+ touchAction: "none"
21
+ }), v = a(l)({
22
+ position: "absolute",
23
+ right: 0,
24
+ top: 0,
25
+ color: `${r.tertiary()} !important`
26
+ }), y = class extends e.Component {
27
+ static propTypes = {
28
+ alternateResponseIndex: i.number,
29
+ category: i.object,
30
+ choice: i.object.isRequired,
31
+ choiceIndex: i.number,
32
+ onDelete: i.func
33
+ };
34
+ static defaultProps = { onDelete: () => {} };
35
+ delete = () => {
36
+ let { onDelete: e, choice: t } = this.props;
37
+ e(t);
38
+ };
39
+ render() {
40
+ let { alternateResponseIndex: e, category: t, choice: n, choiceIndex: r } = this.props, i = t && t.id, a = e === void 0 ? `${n.id}-${i}-${r}` : `${n.id}-${i}-${r}-alt-${e}`;
41
+ return /* @__PURE__ */ c(_, { children: [n ? /* @__PURE__ */ s(o, {
42
+ alternateResponseIndex: e,
43
+ category: t,
44
+ choice: n,
45
+ choiceIndex: r,
46
+ onRemoveChoice: this.delete,
47
+ type: "choice-preview",
48
+ id: a,
49
+ categoryId: i,
50
+ children: /* @__PURE__ */ s(p, { html: n?.content })
51
+ }) : null, /* @__PURE__ */ s(v, {
52
+ "aria-label": "delete",
53
+ onClick: this.delete,
54
+ size: "large",
55
+ children: /* @__PURE__ */ s(u, {})
56
+ })] });
57
+ }
58
+ };
59
+ //#endregion
60
+ export { y as default };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/categories/droppable-placeholder.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const _default: (props: any) => JSX.Element;
10
+ export default _default;
11
+ //# sourceMappingURL=droppable-placeholder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"droppable-placeholder.d.ts","sourceRoot":"","sources":["../../../../src/author/design/categories/droppable-placeholder.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;;AAyGH,wBAAiD"}
@@ -0,0 +1,70 @@
1
+ import e from "./choice-preview.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import r from "debug";
5
+ import { styled as i } from "@mui/material/styles";
6
+ import { useDroppable as a } from "@dnd-kit/core";
7
+ import { PlaceHolder as o, uid as s } from "@pie-lib/drag";
8
+ import { jsx as c } from "react/jsx-runtime";
9
+ //#region src/author/design/categories/droppable-placeholder.tsx
10
+ r("@pie-element:categorize:configure");
11
+ var l = i("div")(({ theme: e }) => ({
12
+ display: "flex",
13
+ alignItems: "center",
14
+ fontSize: e.typography.fontSize - 2,
15
+ color: `rgba(${e.palette.common.black}, 0.4)`,
16
+ width: "100%",
17
+ height: "100%"
18
+ })), u = () => /* @__PURE__ */ c(l, { children: "Drag your correct answers here" }), d = i("div")({ minHeight: "100px" }), f = ({ alternateResponseIndex: n, category: r, choices: i, onDeleteChoice: a }) => /* @__PURE__ */ c(t.Fragment, { children: (i || []).map((t, i) => t && /* @__PURE__ */ c(e, {
19
+ alternateResponseIndex: n,
20
+ category: r,
21
+ choice: t,
22
+ choiceIndex: i,
23
+ onDelete: (e) => a(e, i)
24
+ }, i)) });
25
+ f.propTypes = {
26
+ alternateResponseIndex: n.number,
27
+ category: n.object,
28
+ choices: n.array,
29
+ onDeleteChoice: n.func
30
+ };
31
+ var p = ({ alternateResponseIndex: e, category: t, choices: n, onDeleteChoice: r, categoryId: i, isAlternate: s }) => {
32
+ let { setNodeRef: l, isOver: p } = a({
33
+ id: `${i}-${s ? "alternate" : "standard"}`,
34
+ data: {
35
+ accepts: ["choice", "choice-preview"],
36
+ alternateResponseIndex: e,
37
+ categoryId: i,
38
+ type: s ? "category-alternate" : "category",
39
+ id: i
40
+ }
41
+ });
42
+ return /* @__PURE__ */ c("div", {
43
+ ref: l,
44
+ children: /* @__PURE__ */ c(d, { children: /* @__PURE__ */ c(o, {
45
+ isOver: p,
46
+ extraStyles: {
47
+ width: "100%",
48
+ minHeight: "100px",
49
+ height: "auto"
50
+ },
51
+ children: (n || []).length === 0 ? /* @__PURE__ */ c(u, {}) : /* @__PURE__ */ c(f, {
52
+ alternateResponseIndex: e,
53
+ category: t,
54
+ choices: n,
55
+ onDeleteChoice: r
56
+ })
57
+ }) })
58
+ });
59
+ };
60
+ p.propTypes = {
61
+ alternateResponseIndex: n.number,
62
+ category: n.object,
63
+ choices: n.array,
64
+ onDeleteChoice: n.func,
65
+ categoryId: n.string.isRequired,
66
+ isAlternate: n.bool
67
+ };
68
+ var m = s.withUid(p);
69
+ //#endregion
70
+ export { m as default };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/categories/index.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Categories extends React.Component {
12
+ static propTypes: {
13
+ defaultImageMaxHeight: PropTypes.Requireable<number>;
14
+ defaultImageMaxWidth: PropTypes.Requireable<number>;
15
+ imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
16
+ add: PropTypes.Validator<(...args: any[]) => any>;
17
+ delete: PropTypes.Validator<(...args: any[]) => any>;
18
+ }>>;
19
+ uploadSoundSupport: PropTypes.Requireable<PropTypes.InferProps<{
20
+ add: PropTypes.Validator<(...args: any[]) => any>;
21
+ delete: PropTypes.Validator<(...args: any[]) => any>;
22
+ }>>;
23
+ categories: PropTypes.Requireable<any[]>;
24
+ onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
25
+ model: PropTypes.Validator<object>;
26
+ configuration: PropTypes.Validator<object>;
27
+ toolbarOpts: PropTypes.Requireable<object>;
28
+ spellCheck: PropTypes.Requireable<boolean>;
29
+ };
30
+ state: {
31
+ focusedEl: null;
32
+ };
33
+ add: any;
34
+ deleteFocusedEl: any;
35
+ delete: any;
36
+ change: any;
37
+ deleteChoiceFromCategory: any;
38
+ changeRowLabel: any;
39
+ render(): React.JSX.Element;
40
+ }
41
+ export default Categories;
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/author/design/categories/index.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAuCnC,qBAAa,UAAW,SAAQ,KAAK,CAAC,SAAS;IAC7C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;MAiBd;IAEF,KAAK;;MAEH;IAEF,GAAG,EAAE,GAAG,CA8BN;IAEF,eAAe,EAAE,GAAG,CAIlB;IAEF,MAAM,EAAE,GAAG,CAST;IAEF,MAAM,EAAE,GAAG,CAQT;IAEF,wBAAwB,EAAE,GAAG,CAK3B;IAEF,cAAc,EAAE,GAAG,CAcjB;IAEF,MAAM;CA+FP;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,146 @@
1
+ import e from "./category.js";
2
+ import t from "../header.js";
3
+ import { generateValidationMessage as n } from "../../utils.js";
4
+ import { RowLabel as r } from "./RowLabel.js";
5
+ import i from "react";
6
+ import a from "prop-types";
7
+ import { styled as o } from "@mui/material/styles";
8
+ import { removeCategory as s, removeChoiceFromCategory as c } from "@pie-lib/categorize";
9
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
+ import { choiceUtils as d } from "@pie-lib/config-ui";
11
+ import f from "@mui/icons-material/Info";
12
+ import p from "@mui/material/Tooltip";
13
+ //#region src/author/design/categories/index.tsx
14
+ var m = o("div")(({ theme: e }) => ({ marginBottom: e.spacing(3) })), h = o("div")(({ theme: e }) => ({
15
+ display: "grid",
16
+ gridRowGap: `${e.spacing(1)}px`,
17
+ gridColumnGap: `${e.spacing(1)}px`
18
+ })), g = o(p)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
19
+ fontSize: e.typography.fontSize - 2,
20
+ whiteSpace: "pre",
21
+ maxWidth: "500px"
22
+ } })), _ = o("div")(({ theme: e }) => ({
23
+ fontSize: e.typography.fontSize - 2,
24
+ color: e.palette.error.main,
25
+ paddingTop: e.spacing(.5)
26
+ })), v = class extends i.Component {
27
+ static propTypes = {
28
+ defaultImageMaxHeight: a.number,
29
+ defaultImageMaxWidth: a.number,
30
+ imageSupport: a.shape({
31
+ add: a.func.isRequired,
32
+ delete: a.func.isRequired
33
+ }),
34
+ uploadSoundSupport: a.shape({
35
+ add: a.func.isRequired,
36
+ delete: a.func.isRequired
37
+ }),
38
+ categories: a.array,
39
+ onModelChanged: a.func,
40
+ model: a.object.isRequired,
41
+ configuration: a.object.isRequired,
42
+ toolbarOpts: a.object,
43
+ spellCheck: a.bool
44
+ };
45
+ state = { focusedEl: null };
46
+ add = () => {
47
+ let { model: e, categories: t } = this.props, { categoriesPerRow: n, correctResponse: r, allowAlternateEnabled: i } = e, a = d.firstAvailableIndex(e.categories.map((e) => e.id), 1), o = {
48
+ id: a,
49
+ label: "Category " + a
50
+ }, s = e.categories.length % n === 0, c = [...e.rowLabels];
51
+ s && c.push(""), this.setState({ focusedEl: t.length }, () => {
52
+ this.props.onModelChanged({
53
+ rowLabels: c,
54
+ categories: e.categories.concat([o]),
55
+ correctResponse: i ? [...r, {
56
+ category: a,
57
+ choices: [],
58
+ alternateResponses: []
59
+ }] : r
60
+ });
61
+ });
62
+ };
63
+ deleteFocusedEl = () => {
64
+ this.setState({ focusedEl: null });
65
+ };
66
+ delete = (e) => {
67
+ let { model: t, onModelChanged: n } = this.props, r = t.categories.findIndex((t) => t.id === e.id);
68
+ r !== -1 && (t.categories.splice(r, 1), t.correctResponse = s(e.id, t.correctResponse), n(t));
69
+ };
70
+ change = (e) => {
71
+ let { categories: t } = this.props, n = t.findIndex((t) => t.id === e.id);
72
+ n !== -1 && (t.splice(n, 1, e), this.props.onModelChanged({ categories: t }));
73
+ };
74
+ deleteChoiceFromCategory = (e, t, n) => {
75
+ let { model: r, onModelChanged: i } = this.props;
76
+ i({ correctResponse: c(t.id, e.id, n, r.correctResponse) });
77
+ };
78
+ changeRowLabel = (e, t) => {
79
+ let { model: n } = this.props, { rowLabels: r } = n, i = [...r];
80
+ i.length < t ? i.push(e) : i[t] = e, this.props.onModelChanged({ rowLabels: i });
81
+ };
82
+ render() {
83
+ let { model: a, categories: o, imageSupport: s, uploadSoundSupport: c, toolbarOpts: d, spellCheck: p, configuration: v, defaultImageMaxHeight: y, defaultImageMaxWidth: b, mathMlOptions: x = {} } = this.props, { categoriesPerRow: S, rowLabels: C, errors: w } = a, { associationError: T, categoriesError: E, categoriesErrors: D } = w || {}, { maxCategories: O, maxImageWidth: k = {}, maxImageHeight: A = {} } = v || {}, j = { gridTemplateColumns: `repeat(${S}, 1fr)` }, M = n(v);
84
+ return /* @__PURE__ */ u(m, { children: [
85
+ /* @__PURE__ */ l(t, {
86
+ label: "Categories",
87
+ buttonLabel: "ADD A CATEGORY",
88
+ onAdd: this.add,
89
+ info: /* @__PURE__ */ l(g, {
90
+ disableFocusListener: !0,
91
+ disableTouchListener: !0,
92
+ placement: "right",
93
+ title: M,
94
+ children: /* @__PURE__ */ l(f, {
95
+ fontSize: "small",
96
+ color: "primary",
97
+ style: { marginLeft: "5px" }
98
+ })
99
+ }),
100
+ buttonDisabled: O && o && O === o.length
101
+ }),
102
+ /* @__PURE__ */ l(h, {
103
+ style: j,
104
+ children: o.map((t, n) => {
105
+ let a = n % S === 0, o = n / S;
106
+ return /* @__PURE__ */ u(i.Fragment, { children: [a && /* @__PURE__ */ l(r, {
107
+ categoriesPerRow: S,
108
+ disabled: !1,
109
+ rowIndex: o,
110
+ markup: C[o] || "",
111
+ onChange: (e) => this.changeRowLabel(e, o),
112
+ imageSupport: s,
113
+ toolbarOpts: d,
114
+ spellCheck: p,
115
+ maxImageWidth: k && k.rowLabel || b,
116
+ maxImageHeight: A && A.rowLabel || y,
117
+ uploadSoundSupport: c,
118
+ mathMlOptions: x,
119
+ configuration: v
120
+ }), /* @__PURE__ */ l(e, {
121
+ imageSupport: s,
122
+ focusedEl: this.state.focusedEl,
123
+ deleteFocusedEl: this.deleteFocusedEl,
124
+ index: n,
125
+ category: t,
126
+ error: D && D[t.id],
127
+ onChange: this.change,
128
+ onDelete: () => this.delete(t),
129
+ toolbarOpts: d,
130
+ spellCheck: p,
131
+ onDeleteChoice: (e, n) => this.deleteChoiceFromCategory(t, e, n),
132
+ maxImageWidth: k && k.categoryLabel || b,
133
+ maxImageHeight: A && A.categoryLabel || y,
134
+ uploadSoundSupport: c,
135
+ configuration: v,
136
+ alternateResponseIndex: void 0
137
+ })] }, n);
138
+ })
139
+ }),
140
+ T && /* @__PURE__ */ l(_, { children: T }),
141
+ E && /* @__PURE__ */ l(_, { children: E })
142
+ ] });
143
+ }
144
+ };
145
+ //#endregion
146
+ export { v as default };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/choices/choice.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const _default: (props: any) => JSX.Element;
10
+ export default _default;
11
+ //# sourceMappingURL=choice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../../../src/author/design/choices/choice.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;;AA+LH,wBAAmC"}
@@ -0,0 +1,129 @@
1
+ import e from "../input-header.js";
2
+ import { DeleteButton as t } from "../buttons.js";
3
+ import { multiplePlacements as n } from "../../utils.js";
4
+ import "react";
5
+ import r from "prop-types";
6
+ import i from "debug";
7
+ import { styled as a } from "@mui/material/styles";
8
+ import { useDraggable as o, useDroppable as s } from "@dnd-kit/core";
9
+ import { uid as c } from "@pie-lib/drag";
10
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
+ import { Checkbox as d } from "@pie-lib/config-ui";
12
+ import f from "@mui/material/Card";
13
+ import p from "@mui/material/CardActions";
14
+ import m from "@mui/icons-material/DragHandle";
15
+ //#region src/author/design/choices/choice.tsx
16
+ i("@pie-element:categorize:configure:choice");
17
+ var h = (e) => {
18
+ if (e.lockChoiceOrder) return !0;
19
+ let t = e.choice.categoryCount || 0;
20
+ return t === 0 ? !0 : e.correctResponseCount < t;
21
+ }, g = a(f)(({ theme: e }) => ({
22
+ minWidth: "196px",
23
+ padding: e.spacing(1),
24
+ overflow: "visible"
25
+ })), _ = a(p)({
26
+ padding: 0,
27
+ justifyContent: "space-between"
28
+ }), v = a("span", { shouldForwardProp: (e) => e !== "draggable" })(({ draggable: e }) => ({
29
+ cursor: e ? "move" : "inherit",
30
+ touchAction: "none"
31
+ })), y = a("div")(({ theme: e }) => ({
32
+ fontSize: e.typography.fontSize - 2,
33
+ color: e.palette.error.main,
34
+ paddingBottom: e.spacing(1)
35
+ })), b = ({ allowMultiplePlacements: r, configuration: i, choice: a, deleteFocusedEl: c, focusedEl: f, index: p, onDelete: b, onChange: x, correctResponseCount: S, lockChoiceOrder: C, imageSupport: w, spellCheck: T, toolbarOpts: E, error: D, maxImageWidth: O, maxImageHeight: k, uploadSoundSupport: A }) => {
36
+ let j = h({
37
+ choice: a,
38
+ correctResponseCount: S,
39
+ lockChoiceOrder: C
40
+ }), { attributes: M, listeners: N, setNodeRef: P, isDragging: F } = o({
41
+ id: `choice-${a.id}`,
42
+ data: {
43
+ id: a.id,
44
+ index: p,
45
+ type: "choice"
46
+ },
47
+ disabled: !j
48
+ }), { setNodeRef: I } = s({
49
+ id: `choice-drop-${a.id}`,
50
+ data: {
51
+ id: a.id,
52
+ index: p,
53
+ type: "choice"
54
+ }
55
+ }), L = (e) => {
56
+ a.content = e, x(a);
57
+ }, R = () => {
58
+ a.categoryCount === 1 ? a.categoryCount = 0 : a.categoryCount = 1, x(a);
59
+ }, z = ((e) => e === n.perChoice)(r);
60
+ return /* @__PURE__ */ u(g, {
61
+ ref: (e) => {
62
+ P(e), I(e);
63
+ },
64
+ style: { opacity: F ? .5 : 1 },
65
+ children: [
66
+ /* @__PURE__ */ l(_, { children: /* @__PURE__ */ l(v, {
67
+ draggable: j,
68
+ ...M,
69
+ ...N,
70
+ children: /* @__PURE__ */ l(m, { color: j ? "primary" : "disabled" })
71
+ }) }),
72
+ /* @__PURE__ */ l(e, {
73
+ imageSupport: w,
74
+ focusedEl: f,
75
+ deleteFocusedEl: c,
76
+ index: p,
77
+ label: a.content,
78
+ onChange: L,
79
+ onDelete: b,
80
+ toolbarOpts: E,
81
+ spellCheck: T,
82
+ error: D,
83
+ maxImageWidth: O,
84
+ maxImageHeight: k,
85
+ uploadSoundSupport: A,
86
+ configuration: i
87
+ }),
88
+ D && /* @__PURE__ */ l(y, { children: D }),
89
+ /* @__PURE__ */ u(_, { children: [/* @__PURE__ */ l(t, {
90
+ label: "delete",
91
+ onClick: b
92
+ }), z && /* @__PURE__ */ l(d, {
93
+ mini: !0,
94
+ label: "Remove after placing",
95
+ checked: a.categoryCount === 1,
96
+ onChange: R
97
+ })] })
98
+ ]
99
+ });
100
+ };
101
+ b.propTypes = {
102
+ allowMultiplePlacements: r.string,
103
+ configuration: r.object.isRequired,
104
+ choice: r.object.isRequired,
105
+ deleteFocusedEl: r.func,
106
+ focusedEl: r.number,
107
+ index: r.number,
108
+ lockChoiceOrder: r.bool,
109
+ maxImageHeight: r.object,
110
+ maxImageWidth: r.object,
111
+ onChange: r.func.isRequired,
112
+ onDelete: r.func.isRequired,
113
+ correctResponseCount: r.number.isRequired,
114
+ imageSupport: r.shape({
115
+ add: r.func.isRequired,
116
+ delete: r.func.isRequired
117
+ }),
118
+ toolbarOpts: r.object,
119
+ error: r.string,
120
+ uploadSoundSupport: r.shape({
121
+ add: r.func.isRequired,
122
+ delete: r.func.isRequired
123
+ }),
124
+ spellCheck: r.bool,
125
+ rearrangeChoices: r.func
126
+ };
127
+ var x = c.withUid(b);
128
+ //#endregion
129
+ export { x as default };