@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.
- package/dist/author/add-row.js +1 -1
- package/dist/author/answer-config-block.js +61 -60
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +19 -18
- package/dist/author/row.js +27 -23
- package/dist/browser/{Typography-CbSskKxx.js → Typography-DS6VD63M.js} +1805 -1787
- package/dist/browser/Typography-DS6VD63M.js.map +1 -0
- package/dist/browser/author/index.js +24886 -22557
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-kkT1XVKw.js +13 -4
- package/dist/browser/browser-kkT1XVKw.js.map +1 -1
- package/dist/browser/controller/index.js +3 -3
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +36 -30
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/dist-C4gh2n2Z.js +104 -0
- package/dist/browser/dist-C4gh2n2Z.js.map +1 -0
- package/dist/controller/index.js +26 -28
- package/dist/delivery/answer-grid.d.ts +1 -0
- package/dist/delivery/answer-grid.js +34 -26
- package/dist/delivery/index.js +2 -2
- package/dist/delivery/main.js +2 -2
- package/dist/index.iife.js +32 -32
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +22 -19
- package/dist/browser/Typography-CbSskKxx.js.map +0 -1
- package/dist/browser/isEqual-xtQxYITi.js +0 -856
- package/dist/browser/isEqual-xtQxYITi.js.map +0 -1
- 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/_arrayEach.js +0 -7
- 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/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- 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/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- 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/_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/_baseIsMap.js +0 -9
- 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/_baseIsSet.js +0 -9
- 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/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
- 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/_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/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- 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/_defineProperty.js +0 -10
- 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/_getAllKeysIn.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/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- 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/_getSymbolsIn.js +0 -11
- 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/_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/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.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/_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/_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/_nativeKeysIn.js +0 -8
- 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/cloneDeep.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/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/isEqual.js +0 -7
- 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/isMap.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/isSet.js +0 -7
- 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/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.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/set.js +0 -7
- 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/toString.js +0 -7
package/dist/author/add-row.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
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 {
|
|
8
|
-
import c from "
|
|
9
|
-
import
|
|
10
|
-
import u from "
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
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
|
|
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
|
-
})),
|
|
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 ${
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
40
|
+
})), b = u("div")(({ theme: e }) => ({
|
|
40
41
|
flex: .5,
|
|
41
42
|
minWidth: "45px",
|
|
42
43
|
padding: `0 ${e.spacing(1)}`
|
|
43
|
-
})),
|
|
44
|
+
})), x = u("div")({
|
|
44
45
|
display: "flex",
|
|
45
46
|
flexDirection: "column"
|
|
46
|
-
}),
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
56
|
+
})), w = u("div")(({ theme: e }) => ({
|
|
56
57
|
"& .marginBottom": { marginBottom: e.typography.fontSize - 2 + e.spacing(1) },
|
|
57
58
|
"& .headerInput": { "& > div": { fontWeight: "bold" } }
|
|
58
|
-
})),
|
|
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
|
-
|
|
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
|
-
|
|
92
|
+
g("update: ", u), o.rows = u, a(o);
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
|
-
onChange = (
|
|
95
|
-
let { model:
|
|
96
|
-
|
|
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:
|
|
108
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
115
|
-
style:
|
|
116
|
-
width:
|
|
115
|
+
}), /* @__PURE__ */ c(x, {
|
|
116
|
+
style: u.width ? {
|
|
117
|
+
width: u.width,
|
|
117
118
|
overflow: "scroll"
|
|
118
119
|
} : {},
|
|
119
120
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
className:
|
|
122
|
-
sx:
|
|
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__ */
|
|
136
|
-
onChange: this.onHeaderChange(
|
|
137
|
-
markup:
|
|
138
|
-
className: F && !F[
|
|
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:
|
|
142
|
+
pluginProps: e(E?.inputConfiguration, T),
|
|
142
143
|
autoWidthToolbar: !0,
|
|
143
|
-
spellCheck:
|
|
144
|
-
uploadSoundSupport:
|
|
144
|
+
spellCheck: f,
|
|
145
|
+
uploadSoundSupport: g,
|
|
145
146
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
146
|
-
error: F && F[
|
|
147
|
-
}), F && F[
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
model:
|
|
151
|
-
row:
|
|
152
|
-
idx:
|
|
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:
|
|
156
|
-
toolbarOpts:
|
|
157
|
-
spellCheck:
|
|
158
|
-
error: P?.[
|
|
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:
|
|
162
|
+
uploadSoundSupport: g,
|
|
162
163
|
mathMlOptions: A,
|
|
163
164
|
minQuestions: j,
|
|
164
|
-
inputConfiguration:
|
|
165
|
-
},
|
|
166
|
-
N && /* @__PURE__ */
|
|
167
|
-
I && /* @__PURE__ */
|
|
168
|
-
L && /* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
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 {
|
|
177
|
+
export { T as default };
|
package/dist/author/index.d.ts
CHANGED
package/dist/author/index.js
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
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
|
-
...
|
|
11
|
+
...t.model,
|
|
14
12
|
...e
|
|
15
13
|
});
|
|
16
14
|
constructor() {
|
|
17
|
-
super(), this._root = null, this._model = s.createDefaultModel(), this._configuration =
|
|
15
|
+
super(), this._root = null, this._model = s.createDefaultModel(), this._configuration = t.configuration;
|
|
18
16
|
}
|
|
19
|
-
set model(
|
|
20
|
-
this._model = s.createDefaultModel(
|
|
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
|
|
28
|
-
...
|
|
25
|
+
let n = {
|
|
26
|
+
...t.configuration,
|
|
29
27
|
...e
|
|
30
28
|
};
|
|
31
|
-
this._configuration =
|
|
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,
|
|
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
|
|
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 ||=
|
|
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
|
|
75
|
+
this._root &&= (this._root.unmount(), null);
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
//#endregion
|
package/dist/author/row.js
CHANGED
|
@@ -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" }),
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
47
|
+
})), w = o("hr")(({ theme: e }) => ({
|
|
48
48
|
marginTop: e.spacing(2),
|
|
49
49
|
border: 0,
|
|
50
|
-
borderTop: `2px solid ${
|
|
50
|
+
borderTop: `2px solid ${n.border()}`,
|
|
51
51
|
width: "100%"
|
|
52
|
-
})),
|
|
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
|
-
})),
|
|
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
|
-
|
|
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:
|
|
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(
|
|
116
|
-
/* @__PURE__ */ r(
|
|
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:
|
|
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(
|
|
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(
|
|
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(
|
|
152
|
-
/* @__PURE__ */ r(
|
|
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
|
|
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(
|
|
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 };
|