@pie-element/match-list 7.1.2-next.0 → 7.1.2-next.1

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 (152) hide show
  1. package/dist/browser/controller/index.js +16 -16
  2. package/dist/browser/controller/index.js.map +1 -1
  3. package/dist/browser/delivery/index.js +3542 -4575
  4. package/dist/browser/delivery/index.js.map +1 -1
  5. package/dist/browser/{isEmpty-Eo-n7WSl.js → dist-BT3FUErB.js} +55 -168
  6. package/dist/browser/dist-BT3FUErB.js.map +1 -0
  7. package/dist/controller/index.js +24 -24
  8. package/dist/delivery/answer-area.js +35 -37
  9. package/dist/delivery/answer.js +67 -67
  10. package/dist/delivery/choices-list.js +21 -23
  11. package/dist/delivery/main.js +71 -73
  12. package/dist/index.iife.js +27 -27
  13. package/dist/runtime-support.d.ts +12 -0
  14. package/dist/runtime-support.js +12 -0
  15. package/package.json +9 -5
  16. package/dist/browser/isEmpty-Eo-n7WSl.js.map +0 -1
  17. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  18. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  19. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  20. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  21. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  22. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  23. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  24. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  25. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  26. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  27. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  28. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  29. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  30. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  33. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
  34. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  35. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  36. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindKey.js +0 -9
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createFind.js +0 -19
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/find.js +0 -6
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findIndex.js +0 -13
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findKey.js +0 -9
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js +0 -6
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toFinite.js +0 -8
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toInteger.js +0 -8
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
@@ -1,19 +1,19 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
2
- import t from "react";
3
- import n from "debug";
4
- import r from "prop-types";
5
- import { PlaceHolder as i } from "@pie-lib/drag";
6
- import { useDraggable as a, useDroppable as o } from "@dnd-kit/core";
7
- import { color as s } from "@pie-lib/render-ui";
8
- import { jsx as c } from "react/jsx-runtime";
9
- import { styled as l } from "@mui/material/styles";
1
+ import e from "react";
2
+ import t from "debug";
3
+ import n from "prop-types";
4
+ import { PlaceHolder as r } from "@pie-lib/drag";
5
+ import { useDraggable as i, useDroppable as a } from "@dnd-kit/core";
6
+ import { color as o } from "@pie-lib/render-ui";
7
+ import { jsx as s } from "react/jsx-runtime";
8
+ import { styled as c } from "@mui/material/styles";
9
+ import { isEmpty as l } from "@pie-element/shared-lodash";
10
10
  //#region src/delivery/answer.tsx
11
- var u = n("pie-elements:match-title:answer"), d = l("div")(({ theme: e }) => ({
11
+ var u = t("pie-elements:match-title:answer"), d = c("div")(({ theme: e }) => ({
12
12
  width: "100%",
13
13
  fontSize: "18px",
14
14
  textAlign: "center",
15
15
  color: `rgba(${e.palette.common.black}, 0.6)`
16
- })), f = ({ index: e, isOver: t, disabled: n, type: r }) => /* @__PURE__ */ c(i, {
16
+ })), f = ({ index: e, isOver: t, disabled: n, type: i }) => /* @__PURE__ */ s(r, {
17
17
  extraStyles: {
18
18
  display: "flex",
19
19
  padding: "0",
@@ -23,19 +23,19 @@ var u = n("pie-elements:match-title:answer"), d = l("div")(({ theme: e }) => ({
23
23
  },
24
24
  disabled: n,
25
25
  isOver: t,
26
- type: r,
27
- children: e !== void 0 && /* @__PURE__ */ c(d, { children: e })
26
+ type: i,
27
+ children: e !== void 0 && /* @__PURE__ */ s(d, { children: e })
28
28
  });
29
29
  f.propTypes = {
30
- index: r.number,
31
- isOver: r.bool,
32
- disabled: r.bool,
33
- type: r.string
30
+ index: n.number,
31
+ isOver: n.bool,
32
+ disabled: n.bool,
33
+ type: n.string
34
34
  };
35
- var p = l("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i }) => ({
36
- color: s.text(),
37
- backgroundColor: s.white(),
38
- border: `1px solid ${i === "correct" ? s.correct() : i === "incorrect" ? s.incorrect() : e.palette.grey[400]}`,
35
+ var p = c("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i }) => ({
36
+ color: o.text(),
37
+ backgroundColor: o.white(),
38
+ border: `1px solid ${i === "correct" ? o.correct() : i === "incorrect" ? o.incorrect() : e.palette.grey[400]}`,
39
39
  cursor: r ? "not-allowed" : "pointer",
40
40
  width: "100%",
41
41
  padding: "10px",
@@ -46,20 +46,20 @@ var p = l("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i
46
46
  opacity: t && !r ? .5 : n && !r ? .2 : 1,
47
47
  touchAction: "none"
48
48
  })), m = (e) => {
49
- let { isDragging: t, isOver: n, title: r, disabled: i, empty: a, outcome: o, guideIndex: s, type: l } = e;
50
- return a ? /* @__PURE__ */ c(f, {
51
- index: s,
49
+ let { isDragging: t, isOver: n, title: r, disabled: i, empty: a, outcome: o, guideIndex: c, type: l } = e;
50
+ return a ? /* @__PURE__ */ s(f, {
51
+ index: c,
52
52
  isOver: n,
53
53
  disabled: i,
54
54
  type: l
55
- }) : /* @__PURE__ */ c(p, {
55
+ }) : /* @__PURE__ */ s(p, {
56
56
  isDragging: t,
57
57
  isOver: n,
58
58
  disabled: i,
59
59
  outcome: o,
60
60
  dangerouslySetInnerHTML: { __html: r }
61
61
  });
62
- }, h = l("div")(({ correct: e, theme: t }) => ({
62
+ }, h = c("div")(({ correct: e, theme: t }) => ({
63
63
  boxSizing: "border-box",
64
64
  minHeight: 40,
65
65
  minWidth: "200px",
@@ -68,18 +68,18 @@ var p = l("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i
68
68
  padding: "0px",
69
69
  textAlign: "center",
70
70
  height: "initial",
71
- border: e === !0 ? `1px solid var(--feedback-correct-bg-color, ${s.correct()})` : e === !1 ? `1px solid var(--feedback-incorrect-bg-color, ${s.incorrect()})` : "none"
72
- })), g = class extends t.Component {
71
+ border: e === !0 ? `1px solid var(--feedback-correct-bg-color, ${o.correct()})` : e === !1 ? `1px solid var(--feedback-incorrect-bg-color, ${o.incorrect()})` : "none"
72
+ })), g = class extends e.Component {
73
73
  static propTypes = {
74
- className: r.string,
75
- isDragging: r.bool,
76
- id: r.any,
77
- title: r.string,
78
- isOver: r.bool,
79
- empty: r.bool,
80
- type: r.string,
81
- disabled: r.bool,
82
- correct: r.bool
74
+ className: n.string,
75
+ isDragging: n.bool,
76
+ id: n.any,
77
+ title: n.string,
78
+ isOver: n.bool,
79
+ empty: n.bool,
80
+ type: n.string,
81
+ disabled: n.bool,
82
+ correct: n.bool
83
83
  };
84
84
  componentDidMount() {
85
85
  this.ref && this.ref.addEventListener("touchstart", this.handleTouchStart, { passive: !0 });
@@ -89,25 +89,25 @@ var p = l("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i
89
89
  }
90
90
  handleTouchStart = (e) => {};
91
91
  render() {
92
- let { id: t, title: n, isDragging: r = !1, className: i, disabled: a, isOver: o = !1, type: s, correct: l } = this.props;
93
- return u("[render], props: ", this.props), /* @__PURE__ */ c(h, {
94
- correct: l,
95
- className: i,
92
+ let { id: e, title: t, isDragging: n = !1, className: r, disabled: i, isOver: a = !1, type: o, correct: c } = this.props;
93
+ return u("[render], props: ", this.props), /* @__PURE__ */ s(h, {
94
+ correct: c,
95
+ className: r,
96
96
  ref: (e) => this.ref = e,
97
- children: /* @__PURE__ */ c(m, {
98
- title: n,
99
- id: t,
100
- isOver: o,
101
- empty: e(n),
102
- isDragging: r,
103
- disabled: a,
104
- type: s
97
+ children: /* @__PURE__ */ s(m, {
98
+ title: t,
99
+ id: e,
100
+ isOver: a,
101
+ empty: l(t),
102
+ isDragging: n,
103
+ disabled: i,
104
+ type: o
105
105
  })
106
106
  });
107
107
  }
108
108
  };
109
109
  function _(e) {
110
- let { id: t, instanceId: n, promptId: r, draggable: i = !0, disabled: s = !1, type: l } = e, u = `${l || "answer"}-${t}`, d = r == null ? void 0 : `drop-${r}`, { attributes: f, listeners: p, setNodeRef: m, transform: h, transition: _, isDragging: v } = a({
110
+ let { id: t, instanceId: n, promptId: r, draggable: o = !0, disabled: c = !1, type: l } = e, u = `${l || "answer"}-${t}`, d = r == null ? void 0 : `drop-${r}`, { attributes: f, listeners: p, setNodeRef: m, transform: h, transition: _, isDragging: v } = i({
111
111
  id: u,
112
112
  data: {
113
113
  type: l || "answer",
@@ -116,17 +116,17 @@ function _(e) {
116
116
  value: e.title,
117
117
  promptId: r
118
118
  },
119
- disabled: !i || s
120
- }), y = o({
119
+ disabled: !o || c
120
+ }), y = a({
121
121
  id: d,
122
122
  data: d ? {
123
123
  type: "drop-zone",
124
124
  promptId: r,
125
125
  instanceId: n
126
126
  } : void 0,
127
- disabled: s || !d
127
+ disabled: c || !d
128
128
  }), b = y.setNodeRef, x = y.isOver, S = h ? `translate3d(${h.x}px, ${h.y}px, 0)` : void 0;
129
- return d ? /* @__PURE__ */ c("div", {
129
+ return d ? /* @__PURE__ */ s("div", {
130
130
  ref: b,
131
131
  style: {
132
132
  flex: 1,
@@ -135,28 +135,28 @@ function _(e) {
135
135
  opacity: v ? .5 : 1,
136
136
  backgroundColor: x ? "rgba(0,0,0,0.05)" : "transparent"
137
137
  },
138
- children: /* @__PURE__ */ c("div", {
138
+ children: /* @__PURE__ */ s("div", {
139
139
  ref: m,
140
140
  ...p,
141
141
  ...f,
142
- children: /* @__PURE__ */ c(g, {
142
+ children: /* @__PURE__ */ s(g, {
143
143
  ...e,
144
144
  isDragging: v,
145
145
  isOver: x
146
146
  })
147
147
  })
148
- }) : /* @__PURE__ */ c("div", {
148
+ }) : /* @__PURE__ */ s("div", {
149
149
  ref: m,
150
150
  ...p,
151
151
  ...f,
152
152
  style: {
153
153
  transform: S,
154
154
  transition: _,
155
- cursor: s ? "not-allowed" : "grab",
155
+ cursor: c ? "not-allowed" : "grab",
156
156
  opacity: v ? .5 : 1,
157
- touchAction: i && !s ? "none" : "auto"
157
+ touchAction: o && !c ? "none" : "auto"
158
158
  },
159
- children: /* @__PURE__ */ c(g, {
159
+ children: /* @__PURE__ */ s(g, {
160
160
  ...e,
161
161
  isDragging: v,
162
162
  isOver: !1
@@ -164,13 +164,13 @@ function _(e) {
164
164
  });
165
165
  }
166
166
  _.propTypes = {
167
- id: r.any,
168
- instanceId: r.string,
169
- promptId: r.any,
170
- title: r.string,
171
- draggable: r.bool,
172
- disabled: r.bool,
173
- type: r.string
167
+ id: n.any,
168
+ instanceId: n.string,
169
+ promptId: n.any,
170
+ title: n.string,
171
+ draggable: n.bool,
172
+ disabled: n.bool,
173
+ type: n.string
174
174
  };
175
175
  //#endregion
176
176
  export { g as Answer, _ as default };
@@ -1,35 +1,33 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/find.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
3
- import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js";
4
- import r from "./answer.js";
5
- import i from "./droppable-placeholder.js";
6
- import a from "react";
7
- import o from "prop-types";
8
- import { jsx as s } from "react/jsx-runtime";
9
- import { styled as c } from "@mui/material/styles";
1
+ import e from "./answer.js";
2
+ import t from "./droppable-placeholder.js";
3
+ import n from "react";
4
+ import r from "prop-types";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ import { styled as a } from "@mui/material/styles";
7
+ import { find as o, isEmpty as s, isUndefined as c } from "@pie-element/shared-lodash";
10
8
  //#region src/delivery/choices-list.tsx
11
- var l = c("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), u = class extends a.Component {
9
+ var l = a("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), u = class extends n.Component {
12
10
  static propTypes = {
13
- session: o.object.isRequired,
14
- instanceId: o.string.isRequired,
15
- model: o.object.isRequired,
16
- disabled: o.bool.isRequired,
17
- onRemoveAnswer: o.func
11
+ session: r.object.isRequired,
12
+ instanceId: r.string.isRequired,
13
+ model: r.object.isRequired,
14
+ disabled: r.bool.isRequired,
15
+ onRemoveAnswer: r.func
18
16
  };
19
17
  render() {
20
- let { model: a, disabled: o, session: c, instanceId: u, onRemoveAnswer: d } = this.props, { config: f } = a, { duplicates: p } = f;
21
- return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(i, {
18
+ let { model: n, disabled: r, session: a, instanceId: u, onRemoveAnswer: d } = this.props, { config: f } = n, { duplicates: p } = f;
19
+ return /* @__PURE__ */ i(l, { children: /* @__PURE__ */ i(t, {
22
20
  id: "choices-pool",
23
- disabled: o,
21
+ disabled: r,
24
22
  onRemoveAnswer: d,
25
- children: f.answers.filter((r) => p || t(c) || !c.value || n(e(c.value, (e) => e === r.id))).map((e) => /* @__PURE__ */ s(r, {
23
+ children: f.answers.filter((e) => p || s(a) || !a.value || c(o(a.value, (t) => t === e.id))).map((t) => /* @__PURE__ */ i(e, {
26
24
  instanceId: u,
27
25
  draggable: !0,
28
- disabled: o,
29
- session: c,
26
+ disabled: r,
27
+ session: a,
30
28
  type: "choice",
31
- ...e
32
- }, e.id))
29
+ ...t
30
+ }, t.id))
33
31
  }) });
34
32
  }
35
33
  };
@@ -1,19 +1,17 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findKey.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js";
3
- import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js";
4
- import { Answer as r } from "./answer.js";
5
- import i from "./answer-area.js";
6
- import a from "./choices-list.js";
7
- import o from "react";
8
- import s from "prop-types";
9
- import { swap as c } from "@pie-lib/drag";
10
- import { DndContext as l, DragOverlay as u } from "@dnd-kit/core";
11
- import { restrictToFirstScrollableAncestor as d } from "@dnd-kit/modifiers";
12
- import f from "@pie-lib/correct-answer-toggle";
13
- import * as p from "@pie-lib/render-ui";
14
- import { Feedback as m, PreviewPrompt as h, color as g } from "@pie-lib/render-ui";
15
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
16
- import { styled as y } from "@mui/material/styles";
1
+ import { Answer as e } from "./answer.js";
2
+ import t from "./answer-area.js";
3
+ import n from "./choices-list.js";
4
+ import r from "react";
5
+ import i from "prop-types";
6
+ import { swap as a } from "@pie-lib/drag";
7
+ import { DndContext as o, DragOverlay as s } from "@dnd-kit/core";
8
+ import { restrictToFirstScrollableAncestor as c } from "@dnd-kit/modifiers";
9
+ import l from "@pie-lib/correct-answer-toggle";
10
+ import * as u from "@pie-lib/render-ui";
11
+ import { Feedback as d, PreviewPrompt as f, color as p } from "@pie-lib/render-ui";
12
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
+ import { styled as g } from "@mui/material/styles";
14
+ import { findKey as _, isUndefined as v, uniqueId as y } from "@pie-element/shared-lodash";
17
15
  //#region src/delivery/main.tsx
18
16
  function b(e) {
19
17
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
@@ -21,21 +19,21 @@ function b(e) {
21
19
  function x(e, t) {
22
20
  return !e || b(e) ? e : b(e.default) ? e.default : t && b(e[t]) ? e[t] : t && b(e[t]?.default) ? e[t].default : e;
23
21
  }
24
- var S = x(h, "PreviewPrompt") || x(E.PreviewPrompt, "PreviewPrompt"), C = x(m, "Feedback") || x(E.Feedback, "Feedback"), w = p, T = w.default, E = T && typeof T == "object" ? T : w, D = y("div")({
22
+ var S = x(f, "PreviewPrompt") || x(E.PreviewPrompt, "PreviewPrompt"), C = x(d, "Feedback") || x(E.Feedback, "Feedback"), w = u, T = w.default, E = T && typeof T == "object" ? T : w, D = g("div")({
25
23
  display: "flex",
26
24
  flexDirection: "column",
27
25
  justifyContent: "center",
28
- color: g.text(),
29
- backgroundColor: g.background()
30
- }), O = class extends o.Component {
26
+ color: p.text(),
27
+ backgroundColor: p.background()
28
+ }), O = class extends r.Component {
31
29
  static propTypes = {
32
- session: s.object.isRequired,
33
- onSessionChange: s.func,
34
- model: s.object.isRequired,
35
- prompt: s.string
30
+ session: i.object.isRequired,
31
+ onSessionChange: i.func,
32
+ model: i.object.isRequired,
33
+ prompt: i.string
36
34
  };
37
35
  constructor(e) {
38
- super(e), this.instanceId = n(), this.state = {
36
+ super(e), this.instanceId = y(), this.state = {
39
37
  showCorrectAnswer: !1,
40
38
  draggingElement: null
41
39
  };
@@ -61,87 +59,87 @@ var S = x(h, "PreviewPrompt") || x(E.PreviewPrompt, "PreviewPrompt"), C = x(m, "
61
59
  } });
62
60
  }
63
61
  };
64
- onPlaceAnswer = (n) => {
62
+ onPlaceAnswer = (e) => {
65
63
  this.setState({ draggingElement: null });
66
- let { active: r, over: i } = n;
64
+ let { active: t, over: n } = e;
65
+ if (!t) return;
66
+ let r = t.data.current, i = n?.data.current;
67
67
  if (!r) return;
68
- let a = r.data.current, o = i?.data.current;
69
- if (!a) return;
70
- let { session: s, onSessionChange: l, model: u } = this.props, { config: { duplicates: d } } = u;
71
- if (t(s.value) && (s.value = {}), o.type === "choices-pool" && a.promptId !== void 0) {
72
- s.value[a.promptId] = void 0, l(s);
68
+ let { session: o, onSessionChange: s, model: c } = this.props, { config: { duplicates: l } } = c;
69
+ if (v(o.value) && (o.value = {}), i.type === "choices-pool" && r.promptId !== void 0) {
70
+ o.value[r.promptId] = void 0, s(o);
73
71
  return;
74
72
  }
75
- let f = a.id, p = a.promptId;
76
- if (o && o.type === "drop-zone" && o.promptId != null) {
77
- let t = o.promptId;
78
- if (a.type === "choice" && o.type === "drop-zone" && t !== void 0) {
79
- let n = e(s.value, (e) => e === f);
80
- n && !d ? s.value = c(s.value, n, t) : s.value[t] = f;
81
- } else if (a.type === "target" && p != null && p !== t) {
82
- let e = s.value[t] != null;
83
- if (e && !d) {
84
- let e = s.value[t];
85
- s.value[t] = f, s.value[p] = e;
86
- } else e || (s.value[t] = f, delete s.value[p]);
73
+ let u = r.id, d = r.promptId;
74
+ if (i && i.type === "drop-zone" && i.promptId != null) {
75
+ let e = i.promptId;
76
+ if (r.type === "choice" && i.type === "drop-zone" && e !== void 0) {
77
+ let t = _(o.value, (e) => e === u);
78
+ t && !l ? o.value = a(o.value, t, e) : o.value[e] = u;
79
+ } else if (r.type === "target" && d != null && d !== e) {
80
+ let t = o.value[e] != null;
81
+ if (t && !l) {
82
+ let t = o.value[e];
83
+ o.value[e] = u, o.value[d] = t;
84
+ } else t || (o.value[e] = u, delete o.value[d]);
87
85
  }
88
- l(s);
86
+ s(o);
89
87
  }
90
88
  };
91
89
  toggleShowCorrect = () => {
92
90
  this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
93
91
  };
94
92
  renderDragOverlay = () => {
95
- let { draggingElement: e } = this.state;
96
- return e ? /* @__PURE__ */ _(r, {
97
- id: e.id,
98
- title: e.value,
93
+ let { draggingElement: t } = this.state;
94
+ return t ? /* @__PURE__ */ m(e, {
95
+ id: t.id,
96
+ title: t.value,
99
97
  disabled: !1,
100
98
  isDragging: !1,
101
- style: e.rect ? {
102
- width: e.rect.width,
103
- height: e.rect.height,
99
+ style: t.rect ? {
100
+ width: t.rect.width,
101
+ height: t.rect.height,
104
102
  boxSizing: "border-box"
105
103
  } : {}
106
104
  }) : null;
107
105
  };
108
106
  render() {
109
- let { showCorrectAnswer: e } = this.state, { model: t, session: n } = this.props, { config: r, mode: o } = t, { prompt: s, language: c } = r;
110
- return /* @__PURE__ */ v(l, {
107
+ let { showCorrectAnswer: e } = this.state, { model: r, session: i } = this.props, { config: a, mode: u } = r, { prompt: d, language: f } = a;
108
+ return /* @__PURE__ */ h(o, {
111
109
  onDragStart: this.onDragStart,
112
110
  onDragEnd: this.onPlaceAnswer,
113
- modifiers: [d],
114
- children: [/* @__PURE__ */ v(D, { children: [
115
- /* @__PURE__ */ _(S, {
111
+ modifiers: [c],
112
+ children: [/* @__PURE__ */ h(D, { children: [
113
+ /* @__PURE__ */ m(S, {
116
114
  className: "prompt",
117
- prompt: s
115
+ prompt: d
118
116
  }),
119
- /* @__PURE__ */ _(f, {
120
- show: o === "evaluate",
117
+ /* @__PURE__ */ m(l, {
118
+ show: u === "evaluate",
121
119
  toggled: e,
122
120
  onToggle: this.toggleShowCorrect,
123
- language: c
121
+ language: f
124
122
  }),
125
- /* @__PURE__ */ _(i, {
123
+ /* @__PURE__ */ m(t, {
126
124
  instanceId: this.instanceId,
127
- model: t,
128
- session: n,
125
+ model: r,
126
+ session: i,
129
127
  onRemoveAnswer: (e) => this.onRemoveAnswer(e),
130
- disabled: o !== "gather",
128
+ disabled: u !== "gather",
131
129
  showCorrect: e
132
130
  }),
133
- /* @__PURE__ */ _(a, {
131
+ /* @__PURE__ */ m(n, {
134
132
  instanceId: this.instanceId,
135
- model: t,
136
- session: n,
137
- disabled: o !== "gather",
133
+ model: r,
134
+ session: i,
135
+ disabled: u !== "gather",
138
136
  onRemoveAnswer: (e) => this.onRemoveAnswer(e)
139
137
  }),
140
- t.correctness && t.feedback && !e && /* @__PURE__ */ _(C, {
141
- correctness: t.correctness.correctness,
142
- feedback: t.feedback
138
+ r.correctness && r.feedback && !e && /* @__PURE__ */ m(C, {
139
+ correctness: r.correctness.correctness,
140
+ feedback: r.feedback
143
141
  })
144
- ] }), /* @__PURE__ */ _(u, { children: this.renderDragOverlay() })]
142
+ ] }), /* @__PURE__ */ m(s, { children: this.renderDragOverlay() })]
145
143
  });
146
144
  }
147
145
  };