@pie-element/multiple-choice 13.2.2-next.0 → 13.2.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/index.js +23 -23
- package/dist/author/main.js +67 -67
- package/dist/browser/{debounce-PkR6OuzU.js → Radio-DADh6qUM.js} +2549 -2639
- package/dist/browser/Radio-DADh6qUM.js.map +1 -0
- package/dist/browser/author/index.js +7819 -8261
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +9 -8
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/dist-nl5urzAW.js +107 -0
- package/dist/browser/dist-nl5urzAW.js.map +1 -0
- package/dist/browser/{main-CmP4Uwst.js → main-C4I_9OBk.js} +220 -220
- package/dist/browser/{main-CmP4Uwst.js.map → main-C4I_9OBk.js.map} +1 -1
- package/dist/browser/print/index.js +11 -16
- package/dist/browser/print/index.js.map +1 -1
- package/dist/controller/index.js +26 -26
- package/dist/controller/utils.js +1 -1
- package/dist/delivery/choice-input.js +73 -73
- package/dist/delivery/index.js +19 -19
- package/dist/delivery/multiple-choice.js +72 -72
- 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/print/index.js +10 -11
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +13 -10
- package/dist/browser/_Uint8Array-CUOjhemR.js +0 -396
- package/dist/browser/_Uint8Array-CUOjhemR.js.map +0 -1
- package/dist/browser/_baseClone-fFvdZAu5.js +0 -245
- package/dist/browser/_baseClone-fFvdZAu5.js.map +0 -1
- package/dist/browser/debounce-PkR6OuzU.js.map +0 -1
- package/dist/browser/isEqual-CnAlrBXo.js +0 -182
- package/dist/browser/isEqual-CnAlrBXo.js.map +0 -1
- package/dist/browser/isObject-B-uKF3Sg.js +0 -38
- package/dist/browser/isObject-B-uKF3Sg.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/_apply.js +0 -12
- 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/_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/_assignMergeValue.js +0 -8
- 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/_baseFor.js +0 -5
- 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/_baseMerge.js +0 -19
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js +0 -31
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- 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/_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/_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/_createAssigner.js +0 -15
- 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/_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/_isIterateeCall.js +0 -12
- 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/_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/_overRest.js +0 -13
- 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/_safeGet.js +0 -6
- 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/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- 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/_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/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +0 -50
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
- 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/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/isArrayLikeObject.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/isPlainObject.js +0 -14
- 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/merge.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.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/toNumber.js +0 -19
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js +0 -8
package/dist/author/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "react";
|
|
5
|
-
import {
|
|
1
|
+
import e from "./main.js";
|
|
2
|
+
import t from "./defaults.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import { createRoot as r } from "react-dom/client";
|
|
5
|
+
import { defaults as i } from "@pie-element/shared-lodash";
|
|
6
6
|
import a from "debug";
|
|
7
7
|
import { DeleteImageEvent as o, DeleteSoundEvent as s, InsertImageEvent as c, InsertSoundEvent as l, ModelUpdatedEvent as u } from "@pie-element/shared-configure-events";
|
|
8
8
|
import { choiceUtils as d } from "@pie-lib/config-ui";
|
|
@@ -21,36 +21,36 @@ var f = a("multiple-choice:configure"), p = (e, t = 0) => {
|
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
23
23
|
return e;
|
|
24
|
-
}, m = (
|
|
25
|
-
let
|
|
24
|
+
}, m = (e, n) => {
|
|
25
|
+
let r = i(e, t.configuration);
|
|
26
26
|
return {
|
|
27
|
-
configuration:
|
|
27
|
+
configuration: r,
|
|
28
28
|
model: {
|
|
29
|
-
...
|
|
30
|
-
choices: p(
|
|
29
|
+
...n,
|
|
30
|
+
choices: p(n && n.choices || [], r && r.answerChoiceCount)
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
}, h = class
|
|
33
|
+
}, h = class i extends HTMLElement {
|
|
34
34
|
static createDefaultModel = (e = {}) => {
|
|
35
|
-
let
|
|
36
|
-
...
|
|
35
|
+
let n = d.normalizeChoices({
|
|
36
|
+
...t.model,
|
|
37
37
|
...e,
|
|
38
38
|
choices: p(e && e.choices || [])
|
|
39
39
|
});
|
|
40
|
-
return
|
|
40
|
+
return n.choicesLayout = e.choicesLayout || e.verticalMode === !1 && "horizontal" || t.model.choicesLayout, n;
|
|
41
41
|
};
|
|
42
42
|
constructor() {
|
|
43
|
-
super(), this._root = null, this._reactContainer = null, this._model =
|
|
43
|
+
super(), this._root = null, this._reactContainer = null, this._model = i.createDefaultModel(), this._configuration = t.configuration, this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
44
44
|
}
|
|
45
|
-
set model(
|
|
46
|
-
this._model =
|
|
45
|
+
set model(e) {
|
|
46
|
+
this._model = i.createDefaultModel(e), this._render();
|
|
47
47
|
}
|
|
48
48
|
set configuration(e) {
|
|
49
|
-
let
|
|
50
|
-
this.onModelChanged(
|
|
49
|
+
let n = m(e, this._model);
|
|
50
|
+
this.onModelChanged(n.model);
|
|
51
51
|
let r = {
|
|
52
|
-
...
|
|
53
|
-
...
|
|
52
|
+
...t.configuration,
|
|
53
|
+
...n.configuration
|
|
54
54
|
};
|
|
55
55
|
this._configuration = r, r?.language?.enabled ? r?.languageChoices?.options?.length && (this._model.language = r?.languageChoices.options[0].value) : r.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
|
|
56
56
|
value: this._model.language,
|
|
@@ -88,7 +88,7 @@ var f = a("multiple-choice:configure"), p = (e, t = 0) => {
|
|
|
88
88
|
_render() {
|
|
89
89
|
f("_render - Starting render"), f("_render - Model:", this._model ? "present" : "missing"), f("_render - Configuration:", this._configuration ? "present" : "missing"), f("_render - Root exists:", !!this._root);
|
|
90
90
|
try {
|
|
91
|
-
let
|
|
91
|
+
let t = n.createElement(e, {
|
|
92
92
|
model: this._model,
|
|
93
93
|
configuration: this._configuration,
|
|
94
94
|
onModelChanged: this.onModelChanged,
|
|
@@ -103,7 +103,7 @@ var f = a("multiple-choice:configure"), p = (e, t = 0) => {
|
|
|
103
103
|
delete: this.onDeleteSound.bind(this)
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
this._root || (f("_render - Creating React container"), this._reactContainer = document.createElement("div"), this._reactContainer.className = "pie-configure-wrapper", this.appendChild(this._reactContainer), f("_render - Creating new React root"), this._root =
|
|
106
|
+
this._root || (f("_render - Creating React container"), this._reactContainer = document.createElement("div"), this._reactContainer.className = "pie-configure-wrapper", this.appendChild(this._reactContainer), f("_render - Creating new React root"), this._root = r(this._reactContainer), f("_render - React root created successfully")), f("_render - Calling root.render()"), this._root.render(t), f("_render - Render completed successfully");
|
|
107
107
|
} catch (e) {
|
|
108
108
|
throw console.error("❌ [multiple-choice-configure] Render error:", e), console.error("Error stack:", e.stack), e;
|
|
109
109
|
}
|
package/dist/author/main.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import c from "@
|
|
1
|
+
import { generateValidationMessage as e } from "./utils.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { color as r } from "@pie-lib/render-ui";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { styled as o } from "@mui/material/styles";
|
|
7
|
+
import s from "@mui/material/Box";
|
|
8
|
+
import { merge as c } from "@pie-element/shared-lodash";
|
|
9
9
|
import l from "@pie-lib/editable-html-tip-tap";
|
|
10
10
|
import { AlertDialog as u, ChoiceConfiguration as ee, InputContainer as d, choiceUtils as f, layout as te, settings as p } from "@pie-lib/config-ui";
|
|
11
11
|
import m from "@mui/material/Button";
|
|
@@ -13,56 +13,56 @@ import h from "@mui/material/Tooltip";
|
|
|
13
13
|
import g from "@mui/material/Typography";
|
|
14
14
|
import ne from "@mui/icons-material/Info";
|
|
15
15
|
//#region src/author/main.tsx
|
|
16
|
-
var { Panel: re, toggle: _, radio: v, dropdown: y } = p,
|
|
16
|
+
var { Panel: re, toggle: _, radio: v, dropdown: y } = p, ie = 9, b = o(d)(({ theme: e }) => ({
|
|
17
17
|
width: "100%",
|
|
18
18
|
paddingTop: e.spacing(2),
|
|
19
19
|
marginBottom: e.spacing(2)
|
|
20
|
-
})), ae =
|
|
20
|
+
})), ae = o(d)(({ theme: e }) => ({
|
|
21
21
|
flex: 1,
|
|
22
22
|
marginTop: e.spacing(1.5),
|
|
23
23
|
paddingTop: e.spacing(2),
|
|
24
24
|
marginLeft: e.spacing(3.5)
|
|
25
|
-
})), oe =
|
|
25
|
+
})), oe = o(d)(({ theme: e }) => ({
|
|
26
26
|
display: "flex",
|
|
27
27
|
flexDirection: "column",
|
|
28
28
|
marginBottom: e.spacing(1),
|
|
29
29
|
width: "100%"
|
|
30
|
-
})), x =
|
|
30
|
+
})), x = o(m)(({ theme: e }) => ({
|
|
31
31
|
marginTop: e.spacing(1),
|
|
32
32
|
float: "right"
|
|
33
|
-
})), se =
|
|
33
|
+
})), se = o(x)({
|
|
34
34
|
cursor: "not-allowed",
|
|
35
35
|
pointerEvents: "all",
|
|
36
|
-
backgroundColor:
|
|
37
|
-
"&:hover": { backgroundColor:
|
|
38
|
-
"&:focus": { backgroundColor:
|
|
39
|
-
}), ce = s
|
|
36
|
+
backgroundColor: r.disabled(),
|
|
37
|
+
"&:hover": { backgroundColor: r.disabled() },
|
|
38
|
+
"&:focus": { backgroundColor: r.disabled() }
|
|
39
|
+
}), ce = o(s)({
|
|
40
40
|
display: "flex",
|
|
41
41
|
alignItems: "center"
|
|
42
|
-
}), le =
|
|
42
|
+
}), le = o(g)(({ theme: e }) => ({
|
|
43
43
|
fontSize: e.typography.fontSize + 2,
|
|
44
44
|
marginRight: e.spacing(1)
|
|
45
|
-
})), S =
|
|
45
|
+
})), S = o(h)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
46
46
|
fontSize: e.typography.fontSize - 2,
|
|
47
47
|
whiteSpace: "pre",
|
|
48
48
|
maxWidth: "500px"
|
|
49
|
-
} })), C =
|
|
49
|
+
} })), C = o("div")(({ theme: e }) => ({
|
|
50
50
|
fontSize: e.typography.fontSize - 2,
|
|
51
51
|
color: e.palette.error.main,
|
|
52
52
|
paddingTop: e.spacing(1)
|
|
53
|
-
})),
|
|
54
|
-
let { model: n, configuration: r, onPromptChanged:
|
|
55
|
-
he && (H =
|
|
53
|
+
})), ue = (t) => {
|
|
54
|
+
let { model: n, configuration: r, onPromptChanged: o, onChoiceChanged: s, onRemoveChoice: c, onAddChoice: u, imageSupport: d, uploadSoundSupport: f, onChangeModel: p, onConfigurationChanged: m, onTeacherInstructionsChanged: h } = t, { addChoiceButton: g = {}, contentDimensions: ue = {}, feedback: w = {}, deleteChoice: de = {}, choiceMode: T = {}, choicePrefix: fe = {}, partialScoring: E = {}, lockChoiceOrder: D = {}, teacherInstructions: O = {}, studentInstructions: k = {}, rationale: A = {}, scoringType: j = {}, sequentialChoiceLabels: M = {}, settingsPanelDisabled: pe, choicesLayout: N, spellCheck: P = {}, gridColumns: me, maxImageWidth: F = {}, maxImageHeight: I = {}, prompt: L = {}, withRubric: R = {}, mathMlOptions: z = {}, language: B = {}, languageChoices: V = {} } = r || {}, { maxAnswerChoices: H } = r || {}, { limitChoicesNumber: he, teacherInstructionsEnabled: ge, rationaleEnabled: _e, feedbackEnabled: ve, promptEnabled: ye, spellCheckEnabled: U, choices: W, errors: be, toolbarEditorPosition: xe, extraCSSRules: Se } = n || {}, { answerChoices: G, choices: Ce, correctResponse: K, prompt: q, rationale: J, teacherInstructions: Y } = be || {}, we = W?.length ? Array.from({ length: W.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = r, X = { position: xe === "top" ? "top" : "bottom" };
|
|
55
|
+
he && (H = ie);
|
|
56
56
|
let Z = (e = {}) => ({
|
|
57
57
|
...Te,
|
|
58
58
|
...e
|
|
59
|
-
}), Ee =
|
|
60
|
-
choiceMode:
|
|
59
|
+
}), Ee = e(r), Q = F && F.prompt, $ = I && I.prompt, De = H && W?.length >= H ? `Only ${H} allowed maximum` : "", Oe = {
|
|
60
|
+
choiceMode: T.settings && v(T.label, ["checkbox", "radio"]),
|
|
61
61
|
"sequentialChoiceLabels.enabled": M.settings && _(M.label, !0),
|
|
62
62
|
choicePrefix: fe.settings && v(fe.label, ["numbers", "letters"]),
|
|
63
63
|
partialScoring: E.settings && _(E.label),
|
|
64
64
|
lockChoiceOrder: D.settings && _(D.label),
|
|
65
|
-
feedbackEnabled:
|
|
65
|
+
feedbackEnabled: w.settings && _(w.label),
|
|
66
66
|
choicesLayout: N.settings && y(N.label, [
|
|
67
67
|
"vertical",
|
|
68
68
|
"grid",
|
|
@@ -80,12 +80,12 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
80
80
|
scoringType: j.settings && v(j.label, ["auto", "rubric"]),
|
|
81
81
|
rubricEnabled: R?.settings && _(R?.label)
|
|
82
82
|
};
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
dimensions:
|
|
83
|
+
return /* @__PURE__ */ a(te.ConfigLayout, {
|
|
84
|
+
dimensions: ue,
|
|
85
85
|
hideSettings: pe,
|
|
86
86
|
extraCSSRules: Se,
|
|
87
87
|
classes: {},
|
|
88
|
-
settings: /* @__PURE__ */
|
|
88
|
+
settings: /* @__PURE__ */ i(re, {
|
|
89
89
|
model: n,
|
|
90
90
|
onChangeModel: p,
|
|
91
91
|
configuration: r,
|
|
@@ -96,9 +96,9 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
96
96
|
}
|
|
97
97
|
}),
|
|
98
98
|
children: [
|
|
99
|
-
ge && /* @__PURE__ */
|
|
99
|
+
ge && /* @__PURE__ */ a(b, {
|
|
100
100
|
label: O.label,
|
|
101
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ i(l, {
|
|
102
102
|
markup: n.teacherInstructions || "",
|
|
103
103
|
onChange: h,
|
|
104
104
|
imageSupport: d,
|
|
@@ -113,13 +113,13 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
113
113
|
uploadSoundSupport: f,
|
|
114
114
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
115
115
|
mathMlOptions: z
|
|
116
|
-
}), Y && /* @__PURE__ */
|
|
116
|
+
}), Y && /* @__PURE__ */ i(C, { children: Y })]
|
|
117
117
|
}),
|
|
118
|
-
ye && /* @__PURE__ */
|
|
118
|
+
ye && /* @__PURE__ */ a(b, {
|
|
119
119
|
label: L.label,
|
|
120
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ i(l, {
|
|
121
121
|
markup: n.prompt,
|
|
122
|
-
onChange:
|
|
122
|
+
onChange: o,
|
|
123
123
|
imageSupport: d,
|
|
124
124
|
nonEmpty: !1,
|
|
125
125
|
disableUnderline: !0,
|
|
@@ -132,22 +132,22 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
132
132
|
uploadSoundSupport: f,
|
|
133
133
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
134
134
|
mathMlOptions: z
|
|
135
|
-
}), q && /* @__PURE__ */
|
|
135
|
+
}), q && /* @__PURE__ */ i(C, { children: q })]
|
|
136
136
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ a(ce, { children: [/* @__PURE__ */ i(le, {
|
|
138
138
|
component: "div",
|
|
139
139
|
children: "Choices"
|
|
140
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ i(S, {
|
|
141
141
|
disableFocusListener: !0,
|
|
142
142
|
disableTouchListener: !0,
|
|
143
143
|
placement: "right",
|
|
144
144
|
title: Ee,
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ i(ne, {
|
|
146
146
|
fontSize: "small",
|
|
147
147
|
color: "primary"
|
|
148
148
|
})
|
|
149
149
|
})] }),
|
|
150
|
-
W.map((e, t) => /* @__PURE__ */
|
|
150
|
+
W.map((e, t) => /* @__PURE__ */ a(oe, { children: [/* @__PURE__ */ i(ee, {
|
|
151
151
|
index: t + 1,
|
|
152
152
|
useLetterOrdering: n.choicePrefix === "letters",
|
|
153
153
|
mode: n.choiceMode,
|
|
@@ -158,7 +158,7 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
158
158
|
onDelete: () => c(t),
|
|
159
159
|
onChange: (e) => s(t, e),
|
|
160
160
|
allowFeedBack: ve,
|
|
161
|
-
allowDelete:
|
|
161
|
+
allowDelete: de.settings,
|
|
162
162
|
noLabels: !0,
|
|
163
163
|
pluginOpts: Z(r?.choices?.inputConfiguration),
|
|
164
164
|
toolbarOpts: X,
|
|
@@ -169,9 +169,9 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
169
169
|
maxImageHeight: I && I.choices || $,
|
|
170
170
|
uploadSoundSupport: f,
|
|
171
171
|
mathMlOptions: z
|
|
172
|
-
}, t), _e && /* @__PURE__ */
|
|
172
|
+
}, t), _e && /* @__PURE__ */ a(ae, {
|
|
173
173
|
label: A.label,
|
|
174
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ i(l, {
|
|
175
175
|
markup: e.rationale || "",
|
|
176
176
|
onChange: (n) => s(t, {
|
|
177
177
|
...e,
|
|
@@ -187,19 +187,19 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
187
187
|
uploadSoundSupport: f,
|
|
188
188
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
189
189
|
mathMlOptions: z
|
|
190
|
-
}), J?.[e.value] && /* @__PURE__ */
|
|
190
|
+
}), J?.[e.value] && /* @__PURE__ */ i(C, { children: J?.[e.value] })]
|
|
191
191
|
}, `rationale-${t}`)] }, `choice-${t}`)),
|
|
192
|
-
K && /* @__PURE__ */
|
|
193
|
-
G && /* @__PURE__ */
|
|
194
|
-
g.settings && /* @__PURE__ */
|
|
192
|
+
K && /* @__PURE__ */ i(C, { children: K }),
|
|
193
|
+
G && /* @__PURE__ */ i(C, { children: G }),
|
|
194
|
+
g.settings && /* @__PURE__ */ i(S, {
|
|
195
195
|
title: De,
|
|
196
|
-
children: H && W?.length >= H ? /* @__PURE__ */
|
|
196
|
+
children: H && W?.length >= H ? /* @__PURE__ */ i(se, {
|
|
197
197
|
variant: "contained",
|
|
198
198
|
color: "primary",
|
|
199
199
|
onClick: u,
|
|
200
200
|
disabled: !0,
|
|
201
201
|
children: g.label
|
|
202
|
-
}) : /* @__PURE__ */
|
|
202
|
+
}) : /* @__PURE__ */ i(x, {
|
|
203
203
|
variant: "contained",
|
|
204
204
|
color: "primary",
|
|
205
205
|
onClick: u,
|
|
@@ -208,16 +208,16 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
208
208
|
})
|
|
209
209
|
]
|
|
210
210
|
});
|
|
211
|
-
},
|
|
211
|
+
}, w = class extends t.Component {
|
|
212
212
|
static propTypes = {
|
|
213
|
-
model:
|
|
214
|
-
configuration:
|
|
215
|
-
disableSidePanel:
|
|
216
|
-
onModelChanged:
|
|
217
|
-
onConfigurationChanged:
|
|
218
|
-
imageSupport:
|
|
219
|
-
add:
|
|
220
|
-
delete:
|
|
213
|
+
model: n.object.isRequired,
|
|
214
|
+
configuration: n.object.isRequired,
|
|
215
|
+
disableSidePanel: n.bool,
|
|
216
|
+
onModelChanged: n.func.isRequired,
|
|
217
|
+
onConfigurationChanged: n.func.isRequired,
|
|
218
|
+
imageSupport: n.shape({
|
|
219
|
+
add: n.func.isRequired,
|
|
220
|
+
delete: n.func.isRequired
|
|
221
221
|
})
|
|
222
222
|
};
|
|
223
223
|
state = { showWarning: !1 };
|
|
@@ -231,15 +231,15 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
231
231
|
};
|
|
232
232
|
onAddChoice = () => {
|
|
233
233
|
let { model: e, configuration: t, onModelChanged: n } = this.props, { maxAnswerChoices: r } = t || {}, { limitChoicesNumber: i } = e || {};
|
|
234
|
-
i && (r =
|
|
234
|
+
i && (r = ie), !(r && e.choices.length >= r) && (e.choices.push({
|
|
235
235
|
label: "",
|
|
236
236
|
value: f.firstAvailableIndex(e.choices.map((e) => e.value), 0),
|
|
237
237
|
feedback: { type: "none" }
|
|
238
238
|
}), n({ choices: e.choices }));
|
|
239
239
|
};
|
|
240
|
-
onChoiceChanged = (
|
|
241
|
-
let { model:
|
|
242
|
-
|
|
240
|
+
onChoiceChanged = (e, t) => {
|
|
241
|
+
let { model: n, onModelChanged: r } = this.props;
|
|
242
|
+
t.correct && n.choiceMode === "radio" && (n.choices = n.choices.map((e) => c({}, e, { correct: !1 }))), n.choices.splice(e, 1, t), r({ choices: n.choices });
|
|
243
243
|
};
|
|
244
244
|
onPromptChanged = (e) => {
|
|
245
245
|
this.props.onModelChanged({ prompt: e });
|
|
@@ -266,13 +266,13 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
render() {
|
|
269
|
-
let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning:
|
|
270
|
-
return /* @__PURE__ */
|
|
271
|
-
open:
|
|
269
|
+
let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning: n } = this.state;
|
|
270
|
+
return /* @__PURE__ */ a(t.Fragment, { children: [/* @__PURE__ */ i(u, {
|
|
271
|
+
open: n,
|
|
272
272
|
title: "Warning",
|
|
273
273
|
text: `There can't be less than ${e || 0} choices.`,
|
|
274
274
|
onConfirm: () => this.setState({ showWarning: !1 })
|
|
275
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ i(ue, {
|
|
276
276
|
...this.props,
|
|
277
277
|
onChangeModel: this.onModelChanged,
|
|
278
278
|
onRemoveChoice: this.onRemoveChoice,
|
|
@@ -284,4 +284,4 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ the
|
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
286
|
//#endregion
|
|
287
|
-
export {
|
|
287
|
+
export { w as default };
|