@pie-element/match 12.1.2-next.0 → 12.1.2-next.10

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 (164) hide show
  1. package/dist/author/add-row.js +1 -1
  2. package/dist/author/answer-config-block.js +61 -60
  3. package/dist/author/index.d.ts +1 -0
  4. package/dist/author/index.js +19 -18
  5. package/dist/author/row.js +27 -23
  6. package/dist/browser/{Typography-CbSskKxx.js → Typography-DS6VD63M.js} +1805 -1787
  7. package/dist/browser/Typography-DS6VD63M.js.map +1 -0
  8. package/dist/browser/author/index.js +24886 -22557
  9. package/dist/browser/author/index.js.map +1 -1
  10. package/dist/browser/browser-kkT1XVKw.js +13 -4
  11. package/dist/browser/browser-kkT1XVKw.js.map +1 -1
  12. package/dist/browser/controller/index.js +3 -3
  13. package/dist/browser/controller/index.js.map +1 -1
  14. package/dist/browser/delivery/index.js +36 -30
  15. package/dist/browser/delivery/index.js.map +1 -1
  16. package/dist/browser/dist-C4gh2n2Z.js +104 -0
  17. package/dist/browser/dist-C4gh2n2Z.js.map +1 -0
  18. package/dist/controller/index.js +26 -28
  19. package/dist/delivery/answer-grid.d.ts +1 -0
  20. package/dist/delivery/answer-grid.js +34 -26
  21. package/dist/delivery/index.js +2 -2
  22. package/dist/delivery/main.js +2 -2
  23. package/dist/index.iife.js +32 -32
  24. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  25. package/dist/runtime-support.d.ts +12 -0
  26. package/dist/runtime-support.js +12 -0
  27. package/package.json +22 -19
  28. package/dist/browser/Typography-CbSskKxx.js.map +0 -1
  29. package/dist/browser/isEqual-xtQxYITi.js +0 -856
  30. package/dist/browser/isEqual-xtQxYITi.js.map +0 -1
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  33. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  34. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  35. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  36. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/set.js +0 -7
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
@@ -21,4 +21,4 @@ var s = i(a)({
21
21
  }
22
22
  };
23
23
  //#endregion
24
- export { l as default };
24
+ export { l as AddRowButton, l as default };
@@ -1,31 +1,32 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/set.js";
2
- import { getPluginProps as t } from "./utils.js";
3
- import n from "./add-row.js";
1
+ import { getPluginProps as e } from "./utils.js";
2
+ import { clsx as t } from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
3
+ import { AddRowButton as n } from "./add-row.js";
4
4
  import r from "./row.js";
5
5
  import * as i from "react";
6
6
  import a from "prop-types";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
- import c from "@mui/material/Typography";
9
- import { styled as l } from "@mui/material/styles";
10
- import u from "debug";
11
- import d, { DEFAULT_PLUGINS as f } from "@pie-lib/editable-html-tip-tap";
12
- import p from "classnames";
13
- import { DragProvider as m } from "@pie-lib/drag";
7
+ import { color as o } from "@pie-lib/render-ui";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import l from "@mui/material/Typography";
10
+ import { styled as u } from "@mui/material/styles";
11
+ import { set as d } from "@pie-element/shared-lodash";
12
+ import f from "debug";
13
+ import p, { DEFAULT_PLUGINS as m } from "@pie-lib/editable-html-tip-tap";
14
+ import { DragProvider as h } from "@pie-lib/drag";
14
15
  //#region src/author/answer-config-block.tsx
15
- var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
16
+ var g = f("pie-elements:match:configure"), _ = u("div")(({ theme: e }) => ({
16
17
  marginBottom: e.spacing(2.5),
17
18
  display: "flex",
18
19
  flexDirection: "column"
19
- })), _ = l("div")(({ theme: e }) => ({
20
+ })), v = u("div")(({ theme: e }) => ({
20
21
  display: "flex",
21
22
  alignItems: "center",
22
23
  flex: 1,
23
24
  width: "100%",
24
- borderBottom: `2px solid ${e.palette.grey.A100}`,
25
+ borderBottom: `2px solid ${o.border()}`,
25
26
  paddingBottom: e.spacing(2),
26
27
  marginTop: e.spacing(2),
27
28
  marginBottom: e.spacing(1)
28
- })), v = l("div")(({ theme: e }) => ({
29
+ })), y = u("div")(({ theme: e }) => ({
29
30
  flex: 1,
30
31
  display: "flex",
31
32
  justifyContent: "center",
@@ -36,26 +37,26 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
36
37
  padding: `0 ${e.spacing(1)}`,
37
38
  textAlign: "center"
38
39
  }
39
- })), y = l("div")(({ theme: e }) => ({
40
+ })), b = u("div")(({ theme: e }) => ({
40
41
  flex: .5,
41
42
  minWidth: "45px",
42
43
  padding: `0 ${e.spacing(1)}`
43
- })), b = l("div")({
44
+ })), x = u("div")({
44
45
  display: "flex",
45
46
  flexDirection: "column"
46
- }), x = l("div")(({ theme: e }) => ({
47
+ }), S = u("div")(({ theme: e }) => ({
47
48
  fontSize: e.typography.fontSize - 2,
48
49
  color: e.palette.error.main,
49
50
  paddingTop: `${e.spacing(1)} !important`,
50
51
  width: "fit-content !important"
51
- })), S = l("div")(({ theme: e }) => ({
52
+ })), C = u("div")(({ theme: e }) => ({
52
53
  fontSize: e.typography.fontSize - 2,
53
54
  color: e.palette.error.main,
54
55
  paddingBottom: e.spacing(1)
55
- })), C = l("div")(({ theme: e }) => ({
56
+ })), w = u("div")(({ theme: e }) => ({
56
57
  "& .marginBottom": { marginBottom: e.typography.fontSize - 2 + e.spacing(1) },
57
58
  "& .headerInput": { "& > div": { fontWeight: "bold" } }
58
- })), w = class extends i.Component {
59
+ })), T = class extends i.Component {
59
60
  static propTypes = {
60
61
  model: a.object.isRequired,
61
62
  configuration: a.object.isRequired,
@@ -79,7 +80,7 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
79
80
  let r = t.data.current, i = n.data.current;
80
81
  if (r?.type === "row" && i?.type === "row") {
81
82
  let e = r.index, t = i.index, { model: n, onChange: a } = this.props, o = { ...n }, s = o.rows || [];
82
- h("[moveRow]: ", e, t);
83
+ g("[moveRow]: ", e, t);
83
84
  let { movedRow: c, remainingRows: l } = s.reduce((t, n, r) => (r === e ? t.movedRow = n : t.remainingRows.push(n), t), {
84
85
  movedRow: null,
85
86
  remainingRows: []
@@ -88,12 +89,12 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
88
89
  c,
89
90
  ...l.slice(t)
90
91
  ];
91
- h("update: ", u), o.rows = u, a(o);
92
+ g("update: ", u), o.rows = u, a(o);
92
93
  }
93
94
  };
94
- onChange = (t, n) => ({ target: r }) => {
95
- let { model: i, onChange: a } = this.props, o;
96
- o = n ? r.checked : r.value, e(i, t, o), a(i, t);
95
+ onChange = (e, t) => ({ target: n }) => {
96
+ let { model: r, onChange: i } = this.props, a;
97
+ a = t ? n.checked : n.value, d(r, e, a), i(r, e);
97
98
  };
98
99
  onHeaderChange = (e) => (t) => {
99
100
  let { model: n, onChange: r } = this.props, i = { ...n };
@@ -104,22 +105,22 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
104
105
  i.headers[e] = t, r(i);
105
106
  };
106
107
  render() {
107
- let { model: e, onAddRow: i, imageSupport: a, configuration: l, toolbarOpts: u, spellCheck: h, uploadSoundSupport: w } = this.props, { baseInputConfiguration: T = {}, headers: E = {}, rows: D = {}, maxImageWidth: O = {}, maxImageHeight: k = {}, mathMlOptions: A = {}, minQuestions: j } = l || {}, { errors: M } = e || {}, { correctResponseError: N, rowsErrors: P, columnsErrors: F, noOfRowsError: I, columnsLengthError: L } = M || {}, R = (f || []).filter((e) => e !== "table" && e !== "bulleted-list" && e !== "numbered-list"), z = O && O.prompt, B = k && k.prompt;
108
- return /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(m, {
108
+ let { model: i, onAddRow: a, imageSupport: o, configuration: u, toolbarOpts: d, spellCheck: f, uploadSoundSupport: g } = this.props, { baseInputConfiguration: T = {}, headers: E = {}, rows: D = {}, maxImageWidth: O = {}, maxImageHeight: k = {}, mathMlOptions: A = {}, minQuestions: j } = u || {}, { errors: M } = i || {}, { correctResponseError: N, rowsErrors: P, columnsErrors: F, noOfRowsError: I, columnsLengthError: L } = M || {}, R = (m || []).filter((e) => e !== "table" && e !== "bulleted-list" && e !== "numbered-list"), z = O && O.prompt, B = k && k.prompt;
109
+ return /* @__PURE__ */ s(w, { children: /* @__PURE__ */ s(h, {
109
110
  onDragEnd: this.moveRow,
110
- children: /* @__PURE__ */ s(g, { children: [/* @__PURE__ */ o(c, {
111
+ children: /* @__PURE__ */ c(_, { children: [/* @__PURE__ */ s(l, {
111
112
  type: "body1",
112
113
  component: "div",
113
114
  children: "Click on the labels to edit or remove. Set the correct answers by clicking each correct answer per row."
114
- }), /* @__PURE__ */ s(b, {
115
- style: l.width ? {
116
- width: l.width,
115
+ }), /* @__PURE__ */ c(x, {
116
+ style: u.width ? {
117
+ width: u.width,
117
118
  overflow: "scroll"
118
119
  } : {},
119
120
  children: [
120
- /* @__PURE__ */ s(_, { children: [E.settings && (e.headers || []).map((e, n) => /* @__PURE__ */ s(v, {
121
- className: p({ questionText: n === 0 }),
122
- sx: n === 0 ? {
121
+ /* @__PURE__ */ c(v, { children: [E.settings && (i.headers || []).map((n, r) => /* @__PURE__ */ c(y, {
122
+ className: t({ questionText: r === 0 }),
123
+ sx: r === 0 ? {
123
124
  flex: 2,
124
125
  display: "flex",
125
126
  justifyContent: "flex-start",
@@ -132,45 +133,45 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
132
133
  minWidth: "200px"
133
134
  }
134
135
  } : {},
135
- children: [/* @__PURE__ */ o(d, {
136
- onChange: this.onHeaderChange(n),
137
- markup: e,
138
- className: F && !F[n] ? "marginBottom" : "headerInput",
136
+ children: [/* @__PURE__ */ s(p, {
137
+ onChange: this.onHeaderChange(r),
138
+ markup: n,
139
+ className: F && !F[r] ? "marginBottom" : "headerInput",
139
140
  label: "column label",
140
141
  activePlugins: R,
141
- pluginProps: t(E?.inputConfiguration, T),
142
+ pluginProps: e(E?.inputConfiguration, T),
142
143
  autoWidthToolbar: !0,
143
- spellCheck: h,
144
- uploadSoundSupport: w,
144
+ spellCheck: f,
145
+ uploadSoundSupport: g,
145
146
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
146
- error: F && F[n]
147
- }), F && F[n] && /* @__PURE__ */ o(x, { children: F[n] })]
148
- }, n)), /* @__PURE__ */ o(y, {})] }),
149
- e.rows.map((n, i) => /* @__PURE__ */ o(r, {
150
- model: e,
151
- row: n,
152
- idx: i,
147
+ error: F && F[r]
148
+ }), F && F[r] && /* @__PURE__ */ s(S, { children: F[r] })]
149
+ }, r)), /* @__PURE__ */ s(b, {})] }),
150
+ i.rows.map((t, n) => /* @__PURE__ */ s(r, {
151
+ model: i,
152
+ row: t,
153
+ idx: n,
153
154
  onDeleteRow: this.props.onDeleteRow,
154
155
  onChange: this.props.onChange,
155
- imageSupport: a,
156
- toolbarOpts: u,
157
- spellCheck: h,
158
- error: P?.[n.id],
156
+ imageSupport: o,
157
+ toolbarOpts: d,
158
+ spellCheck: f,
159
+ error: P?.[t.id],
159
160
  maxImageWidth: O && O.rowTitles || z,
160
161
  maxImageHeight: k && k.rowTitles || B,
161
- uploadSoundSupport: w,
162
+ uploadSoundSupport: g,
162
163
  mathMlOptions: A,
163
164
  minQuestions: j,
164
- inputConfiguration: t(D?.inputConfiguration, T)
165
- }, i)),
166
- N && /* @__PURE__ */ o(S, { children: N }),
167
- I && /* @__PURE__ */ o(S, { children: I }),
168
- L && /* @__PURE__ */ o(S, { children: L }),
169
- /* @__PURE__ */ o(n, { onAddClick: i })
165
+ inputConfiguration: e(D?.inputConfiguration, T)
166
+ }, n)),
167
+ N && /* @__PURE__ */ s(C, { children: N }),
168
+ I && /* @__PURE__ */ s(C, { children: I }),
169
+ L && /* @__PURE__ */ s(C, { children: L }),
170
+ /* @__PURE__ */ s(n, { onAddClick: a })
170
171
  ]
171
172
  })] })
172
173
  }) });
173
174
  }
174
175
  };
175
176
  //#endregion
176
- export { w as default };
177
+ export { T as default };
@@ -40,5 +40,6 @@ export default class MatchConfigure extends HTMLElement {
40
40
  insertSound(handler: any): void;
41
41
  onDeleteSound(src: any, done: any): void;
42
42
  _render(): void;
43
+ connectedCallback(): void;
43
44
  disconnectedCallback(): void;
44
45
  }
@@ -1,37 +1,35 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.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/set.js";
4
- import r from "./configure.js";
5
- import i from "./defaults.js";
6
- import a from "react";
7
- import { createRoot as o } from "react-dom/client";
1
+ import e from "./configure.js";
2
+ import t from "./defaults.js";
3
+ import n from "react";
4
+ import { createRoot as r } from "react-dom/client";
5
+ import { cloneDeep as i, isEmpty as a, set as o } from "@pie-element/shared-lodash";
8
6
  import s from "debug";
9
7
  import { DeleteImageEvent as c, DeleteSoundEvent as l, InsertImageEvent as u, InsertSoundEvent as d, ModelUpdatedEvent as f } from "@pie-element/shared-configure-events";
10
8
  //#region src/author/index.ts
11
9
  var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
12
10
  static createDefaultModel = (e = {}) => ({
13
- ...i.model,
11
+ ...t.model,
14
12
  ...e
15
13
  });
16
14
  constructor() {
17
- super(), this._root = null, this._model = s.createDefaultModel(), this._configuration = i.configuration;
15
+ super(), this._root = null, this._model = s.createDefaultModel(), this._configuration = t.configuration;
18
16
  }
19
- set model(t) {
20
- this._model = s.createDefaultModel(t), this._modelCopy = e(this._model), this._render();
17
+ set model(e) {
18
+ this._model = s.createDefaultModel(e), this._modelCopy = i(this._model), this._render();
21
19
  }
22
20
  resetModelAfterConfigurationIsSet = () => {
23
21
  let e = document.querySelectorAll("pie-author");
24
22
  this.hasPlayerAsParent = Array.from(e).some((e) => e.contains(this)), this.hasPlayerAsParent && (this._modelCopy ? this._model = this._modelCopy : delete this._modelCopy);
25
23
  };
26
24
  set configuration(e) {
27
- let r = {
28
- ...i.configuration,
25
+ let n = {
26
+ ...t.configuration,
29
27
  ...e
30
28
  };
31
- this._configuration = r, this.resetModelAfterConfigurationIsSet(), 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({
29
+ this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.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({
32
30
  value: this._model.language,
33
31
  label: this._model.language
34
- })) : delete this._model.language, t(e?.rows?.inputConfiguration) && (n(this._configuration.rows, "inputConfiguration.image.disabled", !this._model?.enableImages), n(this._configuration.rows, "inputConfiguration.video.disabled", !0), n(this._configuration.rows, "inputConfiguration.audio.disabled", !0)), this._render();
32
+ })) : delete this._model.language, a(e?.rows?.inputConfiguration) && (o(this._configuration.rows, "inputConfiguration.image.disabled", !this._model?.enableImages), o(this._configuration.rows, "inputConfiguration.video.disabled", !0), o(this._configuration.rows, "inputConfiguration.audio.disabled", !0)), this._render();
35
33
  }
36
34
  onModelChanged(e) {
37
35
  this._model = e, p("[onModelChanged]: ", this._model), this._render(), this.dispatchEvent(new f(this._model));
@@ -53,7 +51,7 @@ var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
53
51
  }
54
52
  _render() {
55
53
  if (this._model) {
56
- let e = a.createElement(r, {
54
+ let t = n.createElement(e, {
57
55
  onModelChanged: this.onModelChanged.bind(this),
58
56
  onConfigurationChanged: this.onConfigurationChanged.bind(this),
59
57
  model: this._model,
@@ -67,11 +65,14 @@ var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
67
65
  delete: this.onDeleteSound.bind(this)
68
66
  }
69
67
  });
70
- this._root ||= o(this), this._root.render(e);
68
+ this._root ||= r(this), this._root.render(t);
71
69
  }
72
70
  }
71
+ connectedCallback() {
72
+ this._render();
73
+ }
73
74
  disconnectedCallback() {
74
- this._root && this._root.unmount();
75
+ this._root &&= (this._root.unmount(), null);
75
76
  }
76
77
  };
77
78
  //#endregion
@@ -13,28 +13,28 @@ import m from "@mui/icons-material/Delete";
13
13
  import { useDraggable as h, useDroppable as g } from "@dnd-kit/core";
14
14
  //#region src/author/row.tsx
15
15
  s("@pie-element:categorize:configure:choice");
16
- var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
16
+ var _ = !1, v = o("span")({ cursor: "move" }), y = o("div")(({ theme: e }) => ({
17
17
  marginTop: e.spacing(2),
18
18
  display: "flex",
19
19
  alignItems: "center",
20
20
  flex: 1
21
- })), y = o("div")(({ theme: e }) => ({
21
+ })), b = o("div")(({ theme: e }) => ({
22
22
  flex: 1,
23
23
  display: "flex",
24
24
  justifyContent: "center",
25
25
  alignItems: "center",
26
26
  minWidth: "120px",
27
27
  padding: `0 ${e.spacing(1)}`
28
- })), b = o(a)(({ theme: e, error: t }) => ({
28
+ })), x = o(a)(({ theme: e, error: t }) => ({
29
29
  "& input": { width: "100% !important" },
30
30
  "&.MuiRadio-root": { color: `${t ? e.palette.error.main : n.tertiary()} !important` }
31
- })), x = o("div")(({ theme: e }) => ({
31
+ })), S = o("div")(({ theme: e }) => ({
32
32
  flex: .5,
33
33
  display: "flex",
34
34
  justifyContent: "center",
35
35
  minWidth: "45px",
36
36
  padding: `0 ${e.spacing(1)}`
37
- })), S = o(y)(({ theme: e }) => ({
37
+ })), C = o(b)(({ theme: e }) => ({
38
38
  flex: 2,
39
39
  display: "flex",
40
40
  justifyContent: "flex-start",
@@ -44,16 +44,16 @@ var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
44
44
  minWidth: "200px",
45
45
  marginRight: e.spacing(1),
46
46
  "&> div": { width: "100%" }
47
- })), C = o("hr")(({ theme: e }) => ({
47
+ })), w = o("hr")(({ theme: e }) => ({
48
48
  marginTop: e.spacing(2),
49
49
  border: 0,
50
- borderTop: `2px solid ${e.palette.grey.A100}`,
50
+ borderTop: `2px solid ${n.border()}`,
51
51
  width: "100%"
52
- })), w = o("div")(({ theme: e }) => ({
52
+ })), T = o("div")(({ theme: e }) => ({
53
53
  fontSize: e.typography.fontSize - 2,
54
54
  color: e.palette.error.main,
55
55
  paddingTop: e.spacing(1)
56
- })), T = class extends e.Component {
56
+ })), E = class extends e.Component {
57
57
  static propTypes = {
58
58
  model: t.object.isRequired,
59
59
  row: t.object.isRequired,
@@ -100,20 +100,24 @@ var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
100
100
  text: `There should be at least ${r} question row` + (r > 1 ? "s" : "") + "."
101
101
  } }) : n(e);
102
102
  };
103
- onMouseDownOnHandle = () => {};
104
- onMouseUpOnHandle = () => {};
103
+ onMouseDownOnHandle = () => {
104
+ _ = !0;
105
+ };
106
+ onMouseUpOnHandle = () => {
107
+ _ = !1;
108
+ };
105
109
  render() {
106
- let { imageSupport: e, model: t, row: n, idx: a, inputConfiguration: o = {}, toolbarOpts: s, spellCheck: h, error: g, maxImageWidth: T, maxImageHeight: E, uploadSoundSupport: D, mathMlOptions: O = {} } = this.props, { dialog: k } = this.state, A = (d || []).filter((e) => e !== "bulleted-list" && e !== "numbered-list");
110
+ let { imageSupport: e, model: t, row: n, idx: a, inputConfiguration: o = {}, toolbarOpts: s, spellCheck: h, error: g, maxImageWidth: _, maxImageHeight: E, uploadSoundSupport: D, mathMlOptions: O = {} } = this.props, { dialog: k } = this.state, A = (d || []).filter((e) => e !== "bulleted-list" && e !== "numbered-list");
107
111
  return /* @__PURE__ */ i("div", {
108
112
  style: { width: "100%" },
109
113
  children: [
110
- /* @__PURE__ */ r(_, {
114
+ /* @__PURE__ */ r(v, {
111
115
  itemID: "handle",
112
116
  onMouseDown: this.onMouseDownOnHandle,
113
117
  children: /* @__PURE__ */ r(f, { color: "primary" })
114
118
  }),
115
- /* @__PURE__ */ i(v, { children: [
116
- /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(u, {
119
+ /* @__PURE__ */ i(y, { children: [
120
+ /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(u, {
117
121
  imageSupport: e,
118
122
  autoWidthToolbar: !0,
119
123
  disableUnderline: !0,
@@ -124,14 +128,14 @@ var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
124
128
  toolbarOpts: s,
125
129
  activePlugins: A,
126
130
  spellCheck: h,
127
- maxImageWidth: T,
131
+ maxImageWidth: _,
128
132
  maxImageHeight: E,
129
133
  uploadSoundSupport: D,
130
134
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
131
135
  error: g && g !== "No correct response defined.",
132
136
  mathMlOptions: O
133
137
  }) }),
134
- n.values.map((e, n) => /* @__PURE__ */ r(y, { children: t.choiceMode === "radio" ? /* @__PURE__ */ r(b, {
138
+ n.values.map((e, n) => /* @__PURE__ */ r(b, { children: t.choiceMode === "radio" ? /* @__PURE__ */ r(x, {
135
139
  error: g?.includes("No correct response defined."),
136
140
  onChange: this.onRowValueChange(a, n),
137
141
  checked: e === !0
@@ -141,15 +145,15 @@ var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
141
145
  label: "",
142
146
  error: g?.includes("No correct response defined.")
143
147
  }) }, n)),
144
- /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(p, {
148
+ /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(p, {
145
149
  onClick: this.onDeleteRow(a),
146
150
  "aria-label": "Delete",
147
151
  size: "large",
148
152
  children: /* @__PURE__ */ r(m, {})
149
153
  }) })
150
154
  ] }),
151
- g && /* @__PURE__ */ r(w, { children: g }),
152
- /* @__PURE__ */ r(C, {}),
155
+ g && /* @__PURE__ */ r(T, { children: g }),
156
+ /* @__PURE__ */ r(w, {}),
153
157
  /* @__PURE__ */ r(c, {
154
158
  open: k.open,
155
159
  title: "Warning",
@@ -160,7 +164,7 @@ var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
160
164
  });
161
165
  }
162
166
  };
163
- function E(e) {
167
+ function D(e) {
164
168
  let { attributes: t, listeners: n, setNodeRef: i, transform: a, transition: o, isDragging: s } = h({
165
169
  id: `row-${e.row.id}`,
166
170
  data: {
@@ -196,9 +200,9 @@ function E(e) {
196
200
  t.closest("[contenteditable]") || t.closest("input") || t.closest("textarea") || t.isContentEditable || n?.onPointerDown?.(e);
197
201
  },
198
202
  ...t,
199
- children: /* @__PURE__ */ r(T, { ...e })
203
+ children: /* @__PURE__ */ r(E, { ...e })
200
204
  })
201
205
  });
202
206
  }
203
207
  //#endregion
204
- export { E as default };
208
+ export { E as Row, _ as canDrag, D as default };