@pie-element/multiple-choice 13.2.2-next.0 → 13.2.2-next.2

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 (185) hide show
  1. package/dist/author/index.js +23 -23
  2. package/dist/author/main.js +67 -67
  3. package/dist/browser/{debounce-PkR6OuzU.js → Radio-DADh6qUM.js} +2549 -2639
  4. package/dist/browser/Radio-DADh6qUM.js.map +1 -0
  5. package/dist/browser/author/index.js +7819 -8261
  6. package/dist/browser/author/index.js.map +1 -1
  7. package/dist/browser/controller/index.js +1 -1
  8. package/dist/browser/controller/index.js.map +1 -1
  9. package/dist/browser/delivery/index.js +9 -8
  10. package/dist/browser/delivery/index.js.map +1 -1
  11. package/dist/browser/dist-nl5urzAW.js +107 -0
  12. package/dist/browser/dist-nl5urzAW.js.map +1 -0
  13. package/dist/browser/{main-CmP4Uwst.js → main-C4I_9OBk.js} +220 -220
  14. package/dist/browser/{main-CmP4Uwst.js.map → main-C4I_9OBk.js.map} +1 -1
  15. package/dist/browser/print/index.js +11 -16
  16. package/dist/browser/print/index.js.map +1 -1
  17. package/dist/controller/index.js +26 -26
  18. package/dist/controller/utils.js +1 -1
  19. package/dist/delivery/choice-input.js +73 -73
  20. package/dist/delivery/index.js +19 -19
  21. package/dist/delivery/multiple-choice.js +72 -72
  22. package/dist/index.iife.js +21 -21
  23. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  24. package/dist/print/index.js +10 -11
  25. package/dist/runtime-support.d.ts +12 -0
  26. package/dist/runtime-support.js +12 -0
  27. package/package.json +13 -10
  28. package/dist/browser/_Uint8Array-CUOjhemR.js +0 -396
  29. package/dist/browser/_Uint8Array-CUOjhemR.js.map +0 -1
  30. package/dist/browser/_baseClone-fFvdZAu5.js +0 -245
  31. package/dist/browser/_baseClone-fFvdZAu5.js.map +0 -1
  32. package/dist/browser/debounce-PkR6OuzU.js.map +0 -1
  33. package/dist/browser/isEqual-CnAlrBXo.js +0 -182
  34. package/dist/browser/isEqual-CnAlrBXo.js.map +0 -1
  35. package/dist/browser/isObject-B-uKF3Sg.js +0 -38
  36. package/dist/browser/isObject-B-uKF3Sg.js.map +0 -1
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js +0 -8
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js +0 -19
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +0 -15
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js +0 -6
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +0 -50
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js +0 -14
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/merge.js +0 -8
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +0 -7
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js +0 -8
@@ -1,8 +1,8 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js";
2
- import t from "./main.js";
3
- import n from "./defaults.js";
4
- import r from "react";
5
- import { createRoot as i } from "react-dom/client";
1
+ import e from "./main.js";
2
+ import t from "./defaults.js";
3
+ import n from "react";
4
+ import { createRoot as r } from "react-dom/client";
5
+ import { defaults as i } from "@pie-element/shared-lodash";
6
6
  import a from "debug";
7
7
  import { DeleteImageEvent as o, DeleteSoundEvent as s, InsertImageEvent as c, InsertSoundEvent as l, ModelUpdatedEvent as u } from "@pie-element/shared-configure-events";
8
8
  import { choiceUtils as d } from "@pie-lib/config-ui";
@@ -21,36 +21,36 @@ var f = a("multiple-choice:configure"), p = (e, t = 0) => {
21
21
  return e;
22
22
  }
23
23
  return e;
24
- }, m = (t, r) => {
25
- let i = e(t, n.configuration);
24
+ }, m = (e, n) => {
25
+ let r = i(e, t.configuration);
26
26
  return {
27
- configuration: i,
27
+ configuration: r,
28
28
  model: {
29
- ...r,
30
- choices: p(r && r.choices || [], i && i.answerChoiceCount)
29
+ ...n,
30
+ choices: p(n && n.choices || [], r && r.answerChoiceCount)
31
31
  }
32
32
  };
33
- }, h = class e extends HTMLElement {
33
+ }, h = class i extends HTMLElement {
34
34
  static createDefaultModel = (e = {}) => {
35
- let t = d.normalizeChoices({
36
- ...n.model,
35
+ let n = d.normalizeChoices({
36
+ ...t.model,
37
37
  ...e,
38
38
  choices: p(e && e.choices || [])
39
39
  });
40
- return t.choicesLayout = e.choicesLayout || e.verticalMode === !1 && "horizontal" || n.model.choicesLayout, t;
40
+ return n.choicesLayout = e.choicesLayout || e.verticalMode === !1 && "horizontal" || t.model.choicesLayout, n;
41
41
  };
42
42
  constructor() {
43
- super(), this._root = null, this._reactContainer = null, this._model = e.createDefaultModel(), this._configuration = n.configuration, this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
43
+ super(), this._root = null, this._reactContainer = null, this._model = i.createDefaultModel(), this._configuration = t.configuration, this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
44
44
  }
45
- set model(t) {
46
- this._model = e.createDefaultModel(t), this._render();
45
+ set model(e) {
46
+ this._model = i.createDefaultModel(e), this._render();
47
47
  }
48
48
  set configuration(e) {
49
- let t = m(e, this._model);
50
- this.onModelChanged(t.model);
49
+ let n = m(e, this._model);
50
+ this.onModelChanged(n.model);
51
51
  let r = {
52
- ...n.configuration,
53
- ...t.configuration
52
+ ...t.configuration,
53
+ ...n.configuration
54
54
  };
55
55
  this._configuration = r, r?.language?.enabled ? r?.languageChoices?.options?.length && (this._model.language = r?.languageChoices.options[0].value) : r.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
56
56
  value: this._model.language,
@@ -88,7 +88,7 @@ var f = a("multiple-choice:configure"), p = (e, t = 0) => {
88
88
  _render() {
89
89
  f("_render - Starting render"), f("_render - Model:", this._model ? "present" : "missing"), f("_render - Configuration:", this._configuration ? "present" : "missing"), f("_render - Root exists:", !!this._root);
90
90
  try {
91
- let e = r.createElement(t, {
91
+ let t = n.createElement(e, {
92
92
  model: this._model,
93
93
  configuration: this._configuration,
94
94
  onModelChanged: this.onModelChanged,
@@ -103,7 +103,7 @@ var f = a("multiple-choice:configure"), p = (e, t = 0) => {
103
103
  delete: this.onDeleteSound.bind(this)
104
104
  }
105
105
  });
106
- this._root || (f("_render - Creating React container"), this._reactContainer = document.createElement("div"), this._reactContainer.className = "pie-configure-wrapper", this.appendChild(this._reactContainer), f("_render - Creating new React root"), this._root = i(this._reactContainer), f("_render - React root created successfully")), f("_render - Calling root.render()"), this._root.render(e), f("_render - Render completed successfully");
106
+ this._root || (f("_render - Creating React container"), this._reactContainer = document.createElement("div"), this._reactContainer.className = "pie-configure-wrapper", this.appendChild(this._reactContainer), f("_render - Creating new React root"), this._root = r(this._reactContainer), f("_render - React root created successfully")), f("_render - Calling root.render()"), this._root.render(t), f("_render - Render completed successfully");
107
107
  } catch (e) {
108
108
  throw console.error("❌ [multiple-choice-configure] Render error:", e), console.error("Error stack:", e.stack), e;
109
109
  }
@@ -1,11 +1,11 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/merge.js";
2
- import { generateValidationMessage as t } from "./utils.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { color as i } from "@pie-lib/render-ui";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { styled as s } from "@mui/material/styles";
8
- import c from "@mui/material/Box";
1
+ import { generateValidationMessage as e } from "./utils.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { color as r } from "@pie-lib/render-ui";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { styled as o } from "@mui/material/styles";
7
+ import s from "@mui/material/Box";
8
+ import { merge as c } from "@pie-element/shared-lodash";
9
9
  import l from "@pie-lib/editable-html-tip-tap";
10
10
  import { AlertDialog as u, ChoiceConfiguration as ee, InputContainer as d, choiceUtils as f, layout as te, settings as p } from "@pie-lib/config-ui";
11
11
  import m from "@mui/material/Button";
@@ -13,56 +13,56 @@ import h from "@mui/material/Tooltip";
13
13
  import g from "@mui/material/Typography";
14
14
  import ne from "@mui/icons-material/Info";
15
15
  //#region src/author/main.tsx
16
- var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ theme: e }) => ({
16
+ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, ie = 9, b = o(d)(({ theme: e }) => ({
17
17
  width: "100%",
18
18
  paddingTop: e.spacing(2),
19
19
  marginBottom: e.spacing(2)
20
- })), ae = s(d)(({ theme: e }) => ({
20
+ })), ae = o(d)(({ theme: e }) => ({
21
21
  flex: 1,
22
22
  marginTop: e.spacing(1.5),
23
23
  paddingTop: e.spacing(2),
24
24
  marginLeft: e.spacing(3.5)
25
- })), oe = s(d)(({ theme: e }) => ({
25
+ })), oe = o(d)(({ theme: e }) => ({
26
26
  display: "flex",
27
27
  flexDirection: "column",
28
28
  marginBottom: e.spacing(1),
29
29
  width: "100%"
30
- })), x = s(m)(({ theme: e }) => ({
30
+ })), x = o(m)(({ theme: e }) => ({
31
31
  marginTop: e.spacing(1),
32
32
  float: "right"
33
- })), se = s(x)({
33
+ })), se = o(x)({
34
34
  cursor: "not-allowed",
35
35
  pointerEvents: "all",
36
- backgroundColor: i.disabled(),
37
- "&:hover": { backgroundColor: i.disabled() },
38
- "&:focus": { backgroundColor: i.disabled() }
39
- }), ce = s(c)({
36
+ backgroundColor: r.disabled(),
37
+ "&:hover": { backgroundColor: r.disabled() },
38
+ "&:focus": { backgroundColor: r.disabled() }
39
+ }), ce = o(s)({
40
40
  display: "flex",
41
41
  alignItems: "center"
42
- }), le = s(g)(({ theme: e }) => ({
42
+ }), le = o(g)(({ theme: e }) => ({
43
43
  fontSize: e.typography.fontSize + 2,
44
44
  marginRight: e.spacing(1)
45
- })), S = s(h)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
45
+ })), S = o(h)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
46
46
  fontSize: e.typography.fontSize - 2,
47
47
  whiteSpace: "pre",
48
48
  maxWidth: "500px"
49
- } })), C = s("div")(({ theme: e }) => ({
49
+ } })), C = o("div")(({ theme: e }) => ({
50
50
  fontSize: e.typography.fontSize - 2,
51
51
  color: e.palette.error.main,
52
52
  paddingTop: e.spacing(1)
53
- })), w = (e) => {
54
- let { model: n, configuration: r, onPromptChanged: i, onChoiceChanged: s, onRemoveChoice: c, onAddChoice: u, imageSupport: d, uploadSoundSupport: f, onChangeModel: p, onConfigurationChanged: m, onTeacherInstructionsChanged: h } = e, { addChoiceButton: g = {}, contentDimensions: w = {}, feedback: T = {}, deleteChoice: ue = {}, choiceMode: de = {}, choicePrefix: fe = {}, partialScoring: E = {}, lockChoiceOrder: D = {}, teacherInstructions: O = {}, studentInstructions: k = {}, rationale: A = {}, scoringType: j = {}, sequentialChoiceLabels: M = {}, settingsPanelDisabled: pe, choicesLayout: N, spellCheck: P = {}, gridColumns: me, maxImageWidth: F = {}, maxImageHeight: I = {}, prompt: L = {}, withRubric: R = {}, mathMlOptions: z = {}, language: B = {}, languageChoices: V = {} } = r || {}, { maxAnswerChoices: H } = r || {}, { limitChoicesNumber: he, teacherInstructionsEnabled: ge, rationaleEnabled: _e, feedbackEnabled: ve, promptEnabled: ye, spellCheckEnabled: U, choices: W, errors: be, toolbarEditorPosition: xe, extraCSSRules: Se } = n || {}, { answerChoices: G, choices: Ce, correctResponse: K, prompt: q, rationale: J, teacherInstructions: Y } = be || {}, we = W?.length ? Array.from({ length: W.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = r, X = { position: xe === "top" ? "top" : "bottom" };
55
- he && (H = b);
53
+ })), ue = (t) => {
54
+ let { model: n, configuration: r, onPromptChanged: o, onChoiceChanged: s, onRemoveChoice: c, onAddChoice: u, imageSupport: d, uploadSoundSupport: f, onChangeModel: p, onConfigurationChanged: m, onTeacherInstructionsChanged: h } = t, { addChoiceButton: g = {}, contentDimensions: ue = {}, feedback: w = {}, deleteChoice: de = {}, choiceMode: T = {}, choicePrefix: fe = {}, partialScoring: E = {}, lockChoiceOrder: D = {}, teacherInstructions: O = {}, studentInstructions: k = {}, rationale: A = {}, scoringType: j = {}, sequentialChoiceLabels: M = {}, settingsPanelDisabled: pe, choicesLayout: N, spellCheck: P = {}, gridColumns: me, maxImageWidth: F = {}, maxImageHeight: I = {}, prompt: L = {}, withRubric: R = {}, mathMlOptions: z = {}, language: B = {}, languageChoices: V = {} } = r || {}, { maxAnswerChoices: H } = r || {}, { limitChoicesNumber: he, teacherInstructionsEnabled: ge, rationaleEnabled: _e, feedbackEnabled: ve, promptEnabled: ye, spellCheckEnabled: U, choices: W, errors: be, toolbarEditorPosition: xe, extraCSSRules: Se } = n || {}, { answerChoices: G, choices: Ce, correctResponse: K, prompt: q, rationale: J, teacherInstructions: Y } = be || {}, we = W?.length ? Array.from({ length: W.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = r, X = { position: xe === "top" ? "top" : "bottom" };
55
+ he && (H = ie);
56
56
  let Z = (e = {}) => ({
57
57
  ...Te,
58
58
  ...e
59
- }), Ee = t(r), Q = F && F.prompt, $ = I && I.prompt, De = H && W?.length >= H ? `Only ${H} allowed maximum` : "", Oe = {
60
- choiceMode: de.settings && v(de.label, ["checkbox", "radio"]),
59
+ }), Ee = e(r), Q = F && F.prompt, $ = I && I.prompt, De = H && W?.length >= H ? `Only ${H} allowed maximum` : "", Oe = {
60
+ choiceMode: T.settings && v(T.label, ["checkbox", "radio"]),
61
61
  "sequentialChoiceLabels.enabled": M.settings && _(M.label, !0),
62
62
  choicePrefix: fe.settings && v(fe.label, ["numbers", "letters"]),
63
63
  partialScoring: E.settings && _(E.label),
64
64
  lockChoiceOrder: D.settings && _(D.label),
65
- feedbackEnabled: T.settings && _(T.label),
65
+ feedbackEnabled: w.settings && _(w.label),
66
66
  choicesLayout: N.settings && y(N.label, [
67
67
  "vertical",
68
68
  "grid",
@@ -80,12 +80,12 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
80
80
  scoringType: j.settings && v(j.label, ["auto", "rubric"]),
81
81
  rubricEnabled: R?.settings && _(R?.label)
82
82
  };
83
- return /* @__PURE__ */ o(te.ConfigLayout, {
84
- dimensions: w,
83
+ return /* @__PURE__ */ a(te.ConfigLayout, {
84
+ dimensions: ue,
85
85
  hideSettings: pe,
86
86
  extraCSSRules: Se,
87
87
  classes: {},
88
- settings: /* @__PURE__ */ a(re, {
88
+ settings: /* @__PURE__ */ i(re, {
89
89
  model: n,
90
90
  onChangeModel: p,
91
91
  configuration: r,
@@ -96,9 +96,9 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
96
96
  }
97
97
  }),
98
98
  children: [
99
- ge && /* @__PURE__ */ o(ie, {
99
+ ge && /* @__PURE__ */ a(b, {
100
100
  label: O.label,
101
- children: [/* @__PURE__ */ a(l, {
101
+ children: [/* @__PURE__ */ i(l, {
102
102
  markup: n.teacherInstructions || "",
103
103
  onChange: h,
104
104
  imageSupport: d,
@@ -113,13 +113,13 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
113
113
  uploadSoundSupport: f,
114
114
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
115
115
  mathMlOptions: z
116
- }), Y && /* @__PURE__ */ a(C, { children: Y })]
116
+ }), Y && /* @__PURE__ */ i(C, { children: Y })]
117
117
  }),
118
- ye && /* @__PURE__ */ o(ie, {
118
+ ye && /* @__PURE__ */ a(b, {
119
119
  label: L.label,
120
- children: [/* @__PURE__ */ a(l, {
120
+ children: [/* @__PURE__ */ i(l, {
121
121
  markup: n.prompt,
122
- onChange: i,
122
+ onChange: o,
123
123
  imageSupport: d,
124
124
  nonEmpty: !1,
125
125
  disableUnderline: !0,
@@ -132,22 +132,22 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
132
132
  uploadSoundSupport: f,
133
133
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
134
134
  mathMlOptions: z
135
- }), q && /* @__PURE__ */ a(C, { children: q })]
135
+ }), q && /* @__PURE__ */ i(C, { children: q })]
136
136
  }),
137
- /* @__PURE__ */ o(ce, { children: [/* @__PURE__ */ a(le, {
137
+ /* @__PURE__ */ a(ce, { children: [/* @__PURE__ */ i(le, {
138
138
  component: "div",
139
139
  children: "Choices"
140
- }), /* @__PURE__ */ a(S, {
140
+ }), /* @__PURE__ */ i(S, {
141
141
  disableFocusListener: !0,
142
142
  disableTouchListener: !0,
143
143
  placement: "right",
144
144
  title: Ee,
145
- children: /* @__PURE__ */ a(ne, {
145
+ children: /* @__PURE__ */ i(ne, {
146
146
  fontSize: "small",
147
147
  color: "primary"
148
148
  })
149
149
  })] }),
150
- W.map((e, t) => /* @__PURE__ */ o(oe, { children: [/* @__PURE__ */ a(ee, {
150
+ W.map((e, t) => /* @__PURE__ */ a(oe, { children: [/* @__PURE__ */ i(ee, {
151
151
  index: t + 1,
152
152
  useLetterOrdering: n.choicePrefix === "letters",
153
153
  mode: n.choiceMode,
@@ -158,7 +158,7 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
158
158
  onDelete: () => c(t),
159
159
  onChange: (e) => s(t, e),
160
160
  allowFeedBack: ve,
161
- allowDelete: ue.settings,
161
+ allowDelete: de.settings,
162
162
  noLabels: !0,
163
163
  pluginOpts: Z(r?.choices?.inputConfiguration),
164
164
  toolbarOpts: X,
@@ -169,9 +169,9 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
169
169
  maxImageHeight: I && I.choices || $,
170
170
  uploadSoundSupport: f,
171
171
  mathMlOptions: z
172
- }, t), _e && /* @__PURE__ */ o(ae, {
172
+ }, t), _e && /* @__PURE__ */ a(ae, {
173
173
  label: A.label,
174
- children: [/* @__PURE__ */ a(l, {
174
+ children: [/* @__PURE__ */ i(l, {
175
175
  markup: e.rationale || "",
176
176
  onChange: (n) => s(t, {
177
177
  ...e,
@@ -187,19 +187,19 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
187
187
  uploadSoundSupport: f,
188
188
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
189
189
  mathMlOptions: z
190
- }), J?.[e.value] && /* @__PURE__ */ a(C, { children: J?.[e.value] })]
190
+ }), J?.[e.value] && /* @__PURE__ */ i(C, { children: J?.[e.value] })]
191
191
  }, `rationale-${t}`)] }, `choice-${t}`)),
192
- K && /* @__PURE__ */ a(C, { children: K }),
193
- G && /* @__PURE__ */ a(C, { children: G }),
194
- g.settings && /* @__PURE__ */ a(S, {
192
+ K && /* @__PURE__ */ i(C, { children: K }),
193
+ G && /* @__PURE__ */ i(C, { children: G }),
194
+ g.settings && /* @__PURE__ */ i(S, {
195
195
  title: De,
196
- children: H && W?.length >= H ? /* @__PURE__ */ a(se, {
196
+ children: H && W?.length >= H ? /* @__PURE__ */ i(se, {
197
197
  variant: "contained",
198
198
  color: "primary",
199
199
  onClick: u,
200
200
  disabled: !0,
201
201
  children: g.label
202
- }) : /* @__PURE__ */ a(x, {
202
+ }) : /* @__PURE__ */ i(x, {
203
203
  variant: "contained",
204
204
  color: "primary",
205
205
  onClick: u,
@@ -208,16 +208,16 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
208
208
  })
209
209
  ]
210
210
  });
211
- }, T = class extends n.Component {
211
+ }, w = class extends t.Component {
212
212
  static propTypes = {
213
- model: r.object.isRequired,
214
- configuration: r.object.isRequired,
215
- disableSidePanel: r.bool,
216
- onModelChanged: r.func.isRequired,
217
- onConfigurationChanged: r.func.isRequired,
218
- imageSupport: r.shape({
219
- add: r.func.isRequired,
220
- delete: r.func.isRequired
213
+ model: n.object.isRequired,
214
+ configuration: n.object.isRequired,
215
+ disableSidePanel: n.bool,
216
+ onModelChanged: n.func.isRequired,
217
+ onConfigurationChanged: n.func.isRequired,
218
+ imageSupport: n.shape({
219
+ add: n.func.isRequired,
220
+ delete: n.func.isRequired
221
221
  })
222
222
  };
223
223
  state = { showWarning: !1 };
@@ -231,15 +231,15 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
231
231
  };
232
232
  onAddChoice = () => {
233
233
  let { model: e, configuration: t, onModelChanged: n } = this.props, { maxAnswerChoices: r } = t || {}, { limitChoicesNumber: i } = e || {};
234
- i && (r = b), !(r && e.choices.length >= r) && (e.choices.push({
234
+ i && (r = ie), !(r && e.choices.length >= r) && (e.choices.push({
235
235
  label: "",
236
236
  value: f.firstAvailableIndex(e.choices.map((e) => e.value), 0),
237
237
  feedback: { type: "none" }
238
238
  }), n({ choices: e.choices }));
239
239
  };
240
- onChoiceChanged = (t, n) => {
241
- let { model: r, onModelChanged: i } = this.props;
242
- n.correct && r.choiceMode === "radio" && (r.choices = r.choices.map((t) => e({}, t, { correct: !1 }))), r.choices.splice(t, 1, n), i({ choices: r.choices });
240
+ onChoiceChanged = (e, t) => {
241
+ let { model: n, onModelChanged: r } = this.props;
242
+ t.correct && n.choiceMode === "radio" && (n.choices = n.choices.map((e) => c({}, e, { correct: !1 }))), n.choices.splice(e, 1, t), r({ choices: n.choices });
243
243
  };
244
244
  onPromptChanged = (e) => {
245
245
  this.props.onModelChanged({ prompt: e });
@@ -266,13 +266,13 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
266
266
  }
267
267
  };
268
268
  render() {
269
- let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning: t } = this.state;
270
- return /* @__PURE__ */ o(n.Fragment, { children: [/* @__PURE__ */ a(u, {
271
- open: t,
269
+ let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning: n } = this.state;
270
+ return /* @__PURE__ */ a(t.Fragment, { children: [/* @__PURE__ */ i(u, {
271
+ open: n,
272
272
  title: "Warning",
273
273
  text: `There can't be less than ${e || 0} choices.`,
274
274
  onConfirm: () => this.setState({ showWarning: !1 })
275
- }), /* @__PURE__ */ a(w, {
275
+ }), /* @__PURE__ */ i(ue, {
276
276
  ...this.props,
277
277
  onChangeModel: this.onModelChanged,
278
278
  onRemoveChoice: this.onRemoveChoice,
@@ -284,4 +284,4 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
284
284
  }
285
285
  };
286
286
  //#endregion
287
- export { T as default };
287
+ export { w as default };