@pie-element/match 12.1.2-next.0 → 12.1.2-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/author/answer-config-block.js +33 -33
- package/dist/author/index.js +15 -17
- package/dist/browser/{Typography-CbSskKxx.js → Typography-DSiRJjOv.js} +337 -330
- package/dist/browser/Typography-DSiRJjOv.js.map +1 -0
- package/dist/browser/author/index.js +6460 -6944
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-kkT1XVKw.js +13 -4
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +27 -27
- package/dist/browser/dist-i687VHmY.js +100 -0
- package/dist/browser/dist-i687VHmY.js.map +1 -0
- package/dist/controller/index.js +26 -28
- package/dist/index.iife.js +21 -21
- 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 +13 -10
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { getPluginProps as e } from "./utils.js";
|
|
2
|
+
import t from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
3
3
|
import n from "./add-row.js";
|
|
4
4
|
import r from "./row.js";
|
|
5
5
|
import * as i from "react";
|
|
@@ -7,12 +7,12 @@ import a from "prop-types";
|
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
import c from "@mui/material/Typography";
|
|
9
9
|
import { styled as l } from "@mui/material/styles";
|
|
10
|
-
import u from "
|
|
11
|
-
import d
|
|
12
|
-
import p from "
|
|
10
|
+
import { set as u } from "@pie-element/shared-lodash";
|
|
11
|
+
import d from "debug";
|
|
12
|
+
import f, { DEFAULT_PLUGINS as p } from "@pie-lib/editable-html-tip-tap";
|
|
13
13
|
import { DragProvider as m } from "@pie-lib/drag";
|
|
14
14
|
//#region src/author/answer-config-block.tsx
|
|
15
|
-
var h =
|
|
15
|
+
var h = d("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
|
|
16
16
|
marginBottom: e.spacing(2.5),
|
|
17
17
|
display: "flex",
|
|
18
18
|
flexDirection: "column"
|
|
@@ -91,9 +91,9 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
|
|
|
91
91
|
h("update: ", u), o.rows = u, a(o);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
onChange = (
|
|
95
|
-
let { model:
|
|
96
|
-
|
|
94
|
+
onChange = (e, t) => ({ target: n }) => {
|
|
95
|
+
let { model: r, onChange: i } = this.props, a;
|
|
96
|
+
a = t ? n.checked : n.value, u(r, e, a), i(r, e);
|
|
97
97
|
};
|
|
98
98
|
onHeaderChange = (e) => (t) => {
|
|
99
99
|
let { model: n, onChange: r } = this.props, i = { ...n };
|
|
@@ -104,7 +104,7 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
|
|
|
104
104
|
i.headers[e] = t, r(i);
|
|
105
105
|
};
|
|
106
106
|
render() {
|
|
107
|
-
let { model:
|
|
107
|
+
let { model: i, onAddRow: a, imageSupport: l, configuration: u, toolbarOpts: d, spellCheck: h, uploadSoundSupport: w } = 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 = (p || []).filter((e) => e !== "table" && e !== "bulleted-list" && e !== "numbered-list"), z = O && O.prompt, B = k && k.prompt;
|
|
108
108
|
return /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(m, {
|
|
109
109
|
onDragEnd: this.moveRow,
|
|
110
110
|
children: /* @__PURE__ */ s(g, { children: [/* @__PURE__ */ o(c, {
|
|
@@ -112,14 +112,14 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
|
|
|
112
112
|
component: "div",
|
|
113
113
|
children: "Click on the labels to edit or remove. Set the correct answers by clicking each correct answer per row."
|
|
114
114
|
}), /* @__PURE__ */ s(b, {
|
|
115
|
-
style:
|
|
116
|
-
width:
|
|
115
|
+
style: u.width ? {
|
|
116
|
+
width: u.width,
|
|
117
117
|
overflow: "scroll"
|
|
118
118
|
} : {},
|
|
119
119
|
children: [
|
|
120
|
-
/* @__PURE__ */ s(_, { children: [E.settings && (
|
|
121
|
-
className:
|
|
122
|
-
sx:
|
|
120
|
+
/* @__PURE__ */ s(_, { children: [E.settings && (i.headers || []).map((n, r) => /* @__PURE__ */ s(v, {
|
|
121
|
+
className: t({ questionText: r === 0 }),
|
|
122
|
+
sx: r === 0 ? {
|
|
123
123
|
flex: 2,
|
|
124
124
|
display: "flex",
|
|
125
125
|
justifyContent: "flex-start",
|
|
@@ -132,41 +132,41 @@ var h = u("pie-elements:match:configure"), g = l("div")(({ theme: e }) => ({
|
|
|
132
132
|
minWidth: "200px"
|
|
133
133
|
}
|
|
134
134
|
} : {},
|
|
135
|
-
children: [/* @__PURE__ */ o(
|
|
136
|
-
onChange: this.onHeaderChange(
|
|
137
|
-
markup:
|
|
138
|
-
className: F && !F[
|
|
135
|
+
children: [/* @__PURE__ */ o(f, {
|
|
136
|
+
onChange: this.onHeaderChange(r),
|
|
137
|
+
markup: n,
|
|
138
|
+
className: F && !F[r] ? "marginBottom" : "headerInput",
|
|
139
139
|
label: "column label",
|
|
140
140
|
activePlugins: R,
|
|
141
|
-
pluginProps:
|
|
141
|
+
pluginProps: e(E?.inputConfiguration, T),
|
|
142
142
|
autoWidthToolbar: !0,
|
|
143
143
|
spellCheck: h,
|
|
144
144
|
uploadSoundSupport: w,
|
|
145
145
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
146
|
-
error: F && F[
|
|
147
|
-
}), F && F[
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
model:
|
|
151
|
-
row:
|
|
152
|
-
idx:
|
|
146
|
+
error: F && F[r]
|
|
147
|
+
}), F && F[r] && /* @__PURE__ */ o(x, { children: F[r] })]
|
|
148
|
+
}, r)), /* @__PURE__ */ o(y, {})] }),
|
|
149
|
+
i.rows.map((t, n) => /* @__PURE__ */ o(r, {
|
|
150
|
+
model: i,
|
|
151
|
+
row: t,
|
|
152
|
+
idx: n,
|
|
153
153
|
onDeleteRow: this.props.onDeleteRow,
|
|
154
154
|
onChange: this.props.onChange,
|
|
155
|
-
imageSupport:
|
|
156
|
-
toolbarOpts:
|
|
155
|
+
imageSupport: l,
|
|
156
|
+
toolbarOpts: d,
|
|
157
157
|
spellCheck: h,
|
|
158
|
-
error: P?.[
|
|
158
|
+
error: P?.[t.id],
|
|
159
159
|
maxImageWidth: O && O.rowTitles || z,
|
|
160
160
|
maxImageHeight: k && k.rowTitles || B,
|
|
161
161
|
uploadSoundSupport: w,
|
|
162
162
|
mathMlOptions: A,
|
|
163
163
|
minQuestions: j,
|
|
164
|
-
inputConfiguration:
|
|
165
|
-
},
|
|
164
|
+
inputConfiguration: e(D?.inputConfiguration, T)
|
|
165
|
+
}, n)),
|
|
166
166
|
N && /* @__PURE__ */ o(S, { children: N }),
|
|
167
167
|
I && /* @__PURE__ */ o(S, { children: I }),
|
|
168
168
|
L && /* @__PURE__ */ o(S, { children: L }),
|
|
169
|
-
/* @__PURE__ */ o(n, { onAddClick:
|
|
169
|
+
/* @__PURE__ */ o(n, { onAddClick: a })
|
|
170
170
|
]
|
|
171
171
|
})] })
|
|
172
172
|
}) });
|
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,7 +65,7 @@ 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
|
}
|
|
73
71
|
disconnectedCallback() {
|