@pie-element/match-list 7.1.1-next.1 → 7.1.1-next.11
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.
- package/CHANGELOG.json +572 -0
- package/CHANGELOG.md +1485 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/controller/CHANGELOG.json +242 -0
- package/controller/CHANGELOG.md +1043 -0
- package/controller/lib/defaults.js +15 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +246 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +25 -0
- package/docs/config-schema.json +70 -0
- package/docs/config-schema.json.md +55 -0
- package/docs/demo/config.js +34 -0
- package/docs/demo/generate.js +54 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +170 -0
- package/docs/pie-schema.json.md +104 -0
- package/lib/answer-area.js +168 -0
- package/lib/answer-area.js.map +1 -0
- package/lib/answer.js +267 -0
- package/lib/answer.js.map +1 -0
- package/lib/arrow.js +57 -0
- package/lib/arrow.js.map +1 -0
- package/lib/choices-list.js +60 -0
- package/lib/choices-list.js.map +1 -0
- package/lib/droppable-placeholder.js +60 -0
- package/lib/droppable-placeholder.js.map +1 -0
- package/lib/index.js +86 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +220 -0
- package/lib/main.js.map +1 -0
- package/package.json +21 -50
- package/dist/controller/defaults.d.ts +0 -17
- package/dist/controller/defaults.js +0 -9
- package/dist/controller/index.d.ts +0 -38
- package/dist/controller/index.js +0 -105
- package/dist/delivery/answer-area.d.ts +0 -27
- package/dist/delivery/answer-area.js +0 -94
- package/dist/delivery/answer.d.ts +0 -40
- package/dist/delivery/answer.js +0 -176
- package/dist/delivery/arrow.d.ts +0 -17
- package/dist/delivery/arrow.js +0 -35
- package/dist/delivery/choices-list.d.ts +0 -21
- package/dist/delivery/choices-list.js +0 -37
- package/dist/delivery/droppable-placeholder.d.ts +0 -24
- package/dist/delivery/droppable-placeholder.js +0 -42
- package/dist/delivery/index.d.ts +0 -21
- package/dist/delivery/index.js +0 -49
- package/dist/delivery/main.d.ts +0 -26
- package/dist/delivery/main.js +0 -149
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -152
- package/dist/index.js +0 -2
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindKey.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createFind.js +0 -19
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/find.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findIndex.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findKey.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toFinite.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toInteger.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
package/dist/delivery/answer.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
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";
|
|
10
|
-
//#region src/delivery/answer.tsx
|
|
11
|
-
var u = n("pie-elements:match-title:answer"), d = l("div")(({ theme: e }) => ({
|
|
12
|
-
width: "100%",
|
|
13
|
-
fontSize: "18px",
|
|
14
|
-
textAlign: "center",
|
|
15
|
-
color: `rgba(${e.palette.common.black}, 0.6)`
|
|
16
|
-
})), f = ({ index: e, isOver: t, disabled: n, type: r }) => /* @__PURE__ */ c(i, {
|
|
17
|
-
extraStyles: {
|
|
18
|
-
display: "flex",
|
|
19
|
-
padding: "0",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
height: "40px"
|
|
23
|
-
},
|
|
24
|
-
disabled: n,
|
|
25
|
-
isOver: t,
|
|
26
|
-
type: r,
|
|
27
|
-
children: e !== void 0 && /* @__PURE__ */ c(d, { children: e })
|
|
28
|
-
});
|
|
29
|
-
f.propTypes = {
|
|
30
|
-
index: r.number,
|
|
31
|
-
isOver: r.bool,
|
|
32
|
-
disabled: r.bool,
|
|
33
|
-
type: r.string
|
|
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]}`,
|
|
39
|
-
cursor: r ? "not-allowed" : "pointer",
|
|
40
|
-
width: "100%",
|
|
41
|
-
padding: "10px",
|
|
42
|
-
boxSizing: "border-box",
|
|
43
|
-
overflow: "hidden",
|
|
44
|
-
transition: "opacity 200ms linear",
|
|
45
|
-
wordBreak: "break-word",
|
|
46
|
-
opacity: t && !r ? .5 : n && !r ? .2 : 1,
|
|
47
|
-
touchAction: "none"
|
|
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,
|
|
52
|
-
isOver: n,
|
|
53
|
-
disabled: i,
|
|
54
|
-
type: l
|
|
55
|
-
}) : /* @__PURE__ */ c(p, {
|
|
56
|
-
isDragging: t,
|
|
57
|
-
isOver: n,
|
|
58
|
-
disabled: i,
|
|
59
|
-
outcome: o,
|
|
60
|
-
dangerouslySetInnerHTML: { __html: r }
|
|
61
|
-
});
|
|
62
|
-
}, h = l("div")(({ correct: e, theme: t }) => ({
|
|
63
|
-
boxSizing: "border-box",
|
|
64
|
-
minHeight: 40,
|
|
65
|
-
minWidth: "200px",
|
|
66
|
-
overflow: "hidden",
|
|
67
|
-
margin: t.spacing(.5),
|
|
68
|
-
padding: "0px",
|
|
69
|
-
textAlign: "center",
|
|
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 {
|
|
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
|
|
83
|
-
};
|
|
84
|
-
componentDidMount() {
|
|
85
|
-
this.ref && this.ref.addEventListener("touchstart", this.handleTouchStart, { passive: !0 });
|
|
86
|
-
}
|
|
87
|
-
componentWillUnmount() {
|
|
88
|
-
this.ref && this.ref.removeEventListener("touchstart", this.handleTouchStart);
|
|
89
|
-
}
|
|
90
|
-
handleTouchStart = (e) => {};
|
|
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,
|
|
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
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
};
|
|
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({
|
|
111
|
-
id: u,
|
|
112
|
-
data: {
|
|
113
|
-
type: l || "answer",
|
|
114
|
-
id: t,
|
|
115
|
-
instanceId: n,
|
|
116
|
-
value: e.title,
|
|
117
|
-
promptId: r
|
|
118
|
-
},
|
|
119
|
-
disabled: !i || s
|
|
120
|
-
}), y = o({
|
|
121
|
-
id: d,
|
|
122
|
-
data: d ? {
|
|
123
|
-
type: "drop-zone",
|
|
124
|
-
promptId: r,
|
|
125
|
-
instanceId: n
|
|
126
|
-
} : void 0,
|
|
127
|
-
disabled: s || !d
|
|
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", {
|
|
130
|
-
ref: b,
|
|
131
|
-
style: {
|
|
132
|
-
flex: 1,
|
|
133
|
-
transform: S,
|
|
134
|
-
transition: _,
|
|
135
|
-
opacity: v ? .5 : 1,
|
|
136
|
-
backgroundColor: x ? "rgba(0,0,0,0.05)" : "transparent"
|
|
137
|
-
},
|
|
138
|
-
children: /* @__PURE__ */ c("div", {
|
|
139
|
-
ref: m,
|
|
140
|
-
...p,
|
|
141
|
-
...f,
|
|
142
|
-
children: /* @__PURE__ */ c(g, {
|
|
143
|
-
...e,
|
|
144
|
-
isDragging: v,
|
|
145
|
-
isOver: x
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
}) : /* @__PURE__ */ c("div", {
|
|
149
|
-
ref: m,
|
|
150
|
-
...p,
|
|
151
|
-
...f,
|
|
152
|
-
style: {
|
|
153
|
-
transform: S,
|
|
154
|
-
transition: _,
|
|
155
|
-
cursor: s ? "not-allowed" : "grab",
|
|
156
|
-
opacity: v ? .5 : 1,
|
|
157
|
-
touchAction: i && !s ? "none" : "auto"
|
|
158
|
-
},
|
|
159
|
-
children: /* @__PURE__ */ c(g, {
|
|
160
|
-
...e,
|
|
161
|
-
isDragging: v,
|
|
162
|
-
isOver: !1
|
|
163
|
-
})
|
|
164
|
-
});
|
|
165
|
-
}
|
|
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
|
|
174
|
-
};
|
|
175
|
-
//#endregion
|
|
176
|
-
export { g as Answer, _ as default };
|
package/dist/delivery/arrow.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/arrow.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class Arrow extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
direction: PropTypes.Requireable<string>;
|
|
14
|
-
};
|
|
15
|
-
render(): React.JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
export default Arrow;
|
package/dist/delivery/arrow.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import t from "prop-types";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import { styled as i } from "@mui/material/styles";
|
|
5
|
-
import a from "@mui/icons-material/ArrowDropDown";
|
|
6
|
-
//#region src/delivery/arrow.tsx
|
|
7
|
-
var o = i("div")({
|
|
8
|
-
display: "inline-block",
|
|
9
|
-
position: "relative",
|
|
10
|
-
width: "100%"
|
|
11
|
-
}), s = i("span")(({ theme: e, isRight: t }) => ({
|
|
12
|
-
backgroundColor: e.palette.grey[500],
|
|
13
|
-
bottom: t ? 20 : 19,
|
|
14
|
-
content: "\"\"",
|
|
15
|
-
display: "block",
|
|
16
|
-
height: 1,
|
|
17
|
-
left: 20,
|
|
18
|
-
position: "absolute",
|
|
19
|
-
width: "100%"
|
|
20
|
-
})), c = class extends e.Component {
|
|
21
|
-
static propTypes = { direction: t.string };
|
|
22
|
-
render() {
|
|
23
|
-
let { direction: e } = this.props;
|
|
24
|
-
return /* @__PURE__ */ r(o, {
|
|
25
|
-
style: e === "left" ? {} : { transform: "rotate(180deg)" },
|
|
26
|
-
children: [/* @__PURE__ */ n(a, { style: {
|
|
27
|
-
transform: "rotate(90deg)",
|
|
28
|
-
color: "#979797",
|
|
29
|
-
fontSize: 40
|
|
30
|
-
} }), /* @__PURE__ */ n(s, { isRight: e !== "left" })]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
export { c as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/choices-list.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class ChoicesList extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
session: PropTypes.Validator<object>;
|
|
14
|
-
instanceId: PropTypes.Validator<string>;
|
|
15
|
-
model: PropTypes.Validator<object>;
|
|
16
|
-
disabled: PropTypes.Validator<boolean>;
|
|
17
|
-
onRemoveAnswer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
};
|
|
19
|
-
render(): React.JSX.Element;
|
|
20
|
-
}
|
|
21
|
-
export default ChoicesList;
|
|
@@ -1,37 +0,0 @@
|
|
|
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";
|
|
10
|
-
//#region src/delivery/choices-list.tsx
|
|
11
|
-
var l = c("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), u = class extends a.Component {
|
|
12
|
-
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
|
|
18
|
-
};
|
|
19
|
-
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, {
|
|
22
|
-
id: "choices-pool",
|
|
23
|
-
disabled: o,
|
|
24
|
-
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, {
|
|
26
|
-
instanceId: u,
|
|
27
|
-
draggable: !0,
|
|
28
|
-
disabled: o,
|
|
29
|
-
session: c,
|
|
30
|
-
type: "choice",
|
|
31
|
-
...e
|
|
32
|
-
}, e.id))
|
|
33
|
-
}) });
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { u as default };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/droppable-placeholder.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare function DroppablePlaceholder({ id, disabled, children, ...rest }: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
id: any;
|
|
14
|
-
disabled: any;
|
|
15
|
-
children: any;
|
|
16
|
-
}): React.JSX.Element;
|
|
17
|
-
export declare namespace DroppablePlaceholder {
|
|
18
|
-
var propTypes: {
|
|
19
|
-
id: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
20
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
21
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export default DroppablePlaceholder;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import e from "prop-types";
|
|
3
|
-
import { MatchDroppablePlaceholder as t } from "@pie-lib/drag";
|
|
4
|
-
import { useDroppable as n } from "@dnd-kit/core";
|
|
5
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
-
import { styled as i } from "@mui/material/styles";
|
|
7
|
-
//#region src/delivery/droppable-placeholder.tsx
|
|
8
|
-
var a = i("div")(({ theme: e }) => ({
|
|
9
|
-
alignItems: "center",
|
|
10
|
-
display: "flex",
|
|
11
|
-
flexDirection: "row",
|
|
12
|
-
flexWrap: "wrap",
|
|
13
|
-
justifyContent: "space-between",
|
|
14
|
-
marginTop: e.spacing(1),
|
|
15
|
-
marginBottom: e.spacing(1),
|
|
16
|
-
minHeight: 50,
|
|
17
|
-
transition: "background-color 200ms ease"
|
|
18
|
-
}));
|
|
19
|
-
function o({ id: e, disabled: i, children: o, ...s }) {
|
|
20
|
-
let { setNodeRef: c, isOver: l } = n({
|
|
21
|
-
id: e || "choices-pool",
|
|
22
|
-
data: { type: "choices-pool" },
|
|
23
|
-
disabled: i
|
|
24
|
-
});
|
|
25
|
-
return /* @__PURE__ */ r(a, {
|
|
26
|
-
ref: c,
|
|
27
|
-
style: { backgroundColor: l ? "rgba(0,0,0,0.05)" : "transparent" },
|
|
28
|
-
...s,
|
|
29
|
-
children: /* @__PURE__ */ r(t, {
|
|
30
|
-
id: e,
|
|
31
|
-
disabled: i,
|
|
32
|
-
children: o
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
o.propTypes = {
|
|
37
|
-
id: e.oneOfType([e.string, e.number]),
|
|
38
|
-
disabled: e.bool,
|
|
39
|
-
children: e.node
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
|
-
export { o as default };
|
package/dist/delivery/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import Main from './main.js';
|
|
10
|
-
export { Main as Component };
|
|
11
|
-
export declare const isComplete: (session: any, model: any) => boolean;
|
|
12
|
-
export default class MatchList extends HTMLElement {
|
|
13
|
-
constructor();
|
|
14
|
-
set model(m: any);
|
|
15
|
-
set session(s: any);
|
|
16
|
-
get session(): any;
|
|
17
|
-
sessionChanged(s: any): void;
|
|
18
|
-
connectedCallback(): void;
|
|
19
|
-
_render(): void;
|
|
20
|
-
disconnectedCallback(): void;
|
|
21
|
-
}
|
package/dist/delivery/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import e from "./main.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import { createRoot as n } from "react-dom/client";
|
|
4
|
-
import r from "debug";
|
|
5
|
-
import { SessionChangedEvent as i } from "@pie-element/shared-player-events";
|
|
6
|
-
import { renderMath as a } from "@pie-element/shared-math-rendering-mathjax";
|
|
7
|
-
//#region src/delivery/index.ts
|
|
8
|
-
var o = r("pie-ui:graph-lines"), s = (e, t) => {
|
|
9
|
-
if (!e) return !1;
|
|
10
|
-
let n = e.value, r = !0;
|
|
11
|
-
return n && (t.config.prompts || []).forEach((e) => {
|
|
12
|
-
Number.isFinite(n[e.id]) || (r = !1);
|
|
13
|
-
}), r;
|
|
14
|
-
}, c = class extends HTMLElement {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(), this._root = null;
|
|
17
|
-
}
|
|
18
|
-
set model(e) {
|
|
19
|
-
this._model = e, this._render();
|
|
20
|
-
}
|
|
21
|
-
set session(e) {
|
|
22
|
-
this._session = e, this._render();
|
|
23
|
-
}
|
|
24
|
-
get session() {
|
|
25
|
-
return this._session;
|
|
26
|
-
}
|
|
27
|
-
sessionChanged(e) {
|
|
28
|
-
this._session.value = e.value, this.dispatchEvent(new i(this.tagName.toLowerCase(), s(this._session, this._model))), o("session: ", this._session), this._render();
|
|
29
|
-
}
|
|
30
|
-
connectedCallback() {
|
|
31
|
-
this._render();
|
|
32
|
-
}
|
|
33
|
-
_render() {
|
|
34
|
-
if (!this._model || !this._session) return;
|
|
35
|
-
let r = t.createElement(e, {
|
|
36
|
-
model: this._model,
|
|
37
|
-
session: this._session,
|
|
38
|
-
onSessionChange: this.sessionChanged.bind(this)
|
|
39
|
-
});
|
|
40
|
-
this._root ||= n(this), this._root.render(r), queueMicrotask(() => {
|
|
41
|
-
a(this);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
disconnectedCallback() {
|
|
45
|
-
this._root && this._root.unmount();
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
//#endregion
|
|
49
|
-
export { e as Component, c as default, s as isComplete };
|
package/dist/delivery/main.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/main.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class Main extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
session: PropTypes.Validator<object>;
|
|
14
|
-
onSessionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
-
model: PropTypes.Validator<object>;
|
|
16
|
-
prompt: PropTypes.Requireable<string>;
|
|
17
|
-
};
|
|
18
|
-
constructor(props: any);
|
|
19
|
-
onRemoveAnswer(id: any): void;
|
|
20
|
-
onDragStart: any;
|
|
21
|
-
onPlaceAnswer: any;
|
|
22
|
-
toggleShowCorrect: any;
|
|
23
|
-
renderDragOverlay: any;
|
|
24
|
-
render(): React.JSX.Element;
|
|
25
|
-
}
|
|
26
|
-
export default Main;
|
package/dist/delivery/main.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
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";
|
|
17
|
-
//#region src/delivery/main.tsx
|
|
18
|
-
function b(e) {
|
|
19
|
-
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
20
|
-
}
|
|
21
|
-
function x(e, t) {
|
|
22
|
-
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
|
-
}
|
|
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")({
|
|
25
|
-
display: "flex",
|
|
26
|
-
flexDirection: "column",
|
|
27
|
-
justifyContent: "center",
|
|
28
|
-
color: g.text(),
|
|
29
|
-
backgroundColor: g.background()
|
|
30
|
-
}), O = class extends o.Component {
|
|
31
|
-
static propTypes = {
|
|
32
|
-
session: s.object.isRequired,
|
|
33
|
-
onSessionChange: s.func,
|
|
34
|
-
model: s.object.isRequired,
|
|
35
|
-
prompt: s.string
|
|
36
|
-
};
|
|
37
|
-
constructor(e) {
|
|
38
|
-
super(e), this.instanceId = n(), this.state = {
|
|
39
|
-
showCorrectAnswer: !1,
|
|
40
|
-
draggingElement: null
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
onRemoveAnswer(e) {
|
|
44
|
-
let { session: t, onSessionChange: n } = this.props;
|
|
45
|
-
t.value[e] = void 0, n(t);
|
|
46
|
-
}
|
|
47
|
-
onDragStart = (e) => {
|
|
48
|
-
let { active: t } = e;
|
|
49
|
-
if (t?.data?.current) {
|
|
50
|
-
let e = null, n = t.node?.current;
|
|
51
|
-
if (n) {
|
|
52
|
-
let { width: t, height: r } = n.getBoundingClientRect();
|
|
53
|
-
e = {
|
|
54
|
-
width: t,
|
|
55
|
-
height: r
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
this.setState({ draggingElement: {
|
|
59
|
-
...t.data.current,
|
|
60
|
-
rect: e
|
|
61
|
-
} });
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
onPlaceAnswer = (n) => {
|
|
65
|
-
this.setState({ draggingElement: null });
|
|
66
|
-
let { active: r, over: i } = n;
|
|
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);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
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]);
|
|
87
|
-
}
|
|
88
|
-
l(s);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
toggleShowCorrect = () => {
|
|
92
|
-
this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
|
|
93
|
-
};
|
|
94
|
-
renderDragOverlay = () => {
|
|
95
|
-
let { draggingElement: e } = this.state;
|
|
96
|
-
return e ? /* @__PURE__ */ _(r, {
|
|
97
|
-
id: e.id,
|
|
98
|
-
title: e.value,
|
|
99
|
-
disabled: !1,
|
|
100
|
-
isDragging: !1,
|
|
101
|
-
style: e.rect ? {
|
|
102
|
-
width: e.rect.width,
|
|
103
|
-
height: e.rect.height,
|
|
104
|
-
boxSizing: "border-box"
|
|
105
|
-
} : {}
|
|
106
|
-
}) : null;
|
|
107
|
-
};
|
|
108
|
-
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, {
|
|
111
|
-
onDragStart: this.onDragStart,
|
|
112
|
-
onDragEnd: this.onPlaceAnswer,
|
|
113
|
-
modifiers: [d],
|
|
114
|
-
children: [/* @__PURE__ */ v(D, { children: [
|
|
115
|
-
/* @__PURE__ */ _(S, {
|
|
116
|
-
className: "prompt",
|
|
117
|
-
prompt: s
|
|
118
|
-
}),
|
|
119
|
-
/* @__PURE__ */ _(f, {
|
|
120
|
-
show: o === "evaluate",
|
|
121
|
-
toggled: e,
|
|
122
|
-
onToggle: this.toggleShowCorrect,
|
|
123
|
-
language: c
|
|
124
|
-
}),
|
|
125
|
-
/* @__PURE__ */ _(i, {
|
|
126
|
-
instanceId: this.instanceId,
|
|
127
|
-
model: t,
|
|
128
|
-
session: n,
|
|
129
|
-
onRemoveAnswer: (e) => this.onRemoveAnswer(e),
|
|
130
|
-
disabled: o !== "gather",
|
|
131
|
-
showCorrect: e
|
|
132
|
-
}),
|
|
133
|
-
/* @__PURE__ */ _(a, {
|
|
134
|
-
instanceId: this.instanceId,
|
|
135
|
-
model: t,
|
|
136
|
-
session: n,
|
|
137
|
-
disabled: o !== "gather",
|
|
138
|
-
onRemoveAnswer: (e) => this.onRemoveAnswer(e)
|
|
139
|
-
}),
|
|
140
|
-
t.correctness && t.feedback && !e && /* @__PURE__ */ _(C, {
|
|
141
|
-
correctness: t.correctness.correctness,
|
|
142
|
-
feedback: t.feedback
|
|
143
|
-
})
|
|
144
|
-
] }), /* @__PURE__ */ _(u, { children: this.renderDragOverlay() })]
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
//#endregion
|
|
149
|
-
export { O as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './delivery/index.js';
|
package/dist/index.iife.d.ts
DELETED