@pie-element/drag-in-the-blank 0.1.0
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/choice.d.ts +23 -0
- package/dist/author/choice.d.ts.map +1 -0
- package/dist/author/choice.js +88 -0
- package/dist/author/choices.d.ts +41 -0
- package/dist/author/choices.d.ts.map +1 -0
- package/dist/author/choices.js +159 -0
- package/dist/author/defaults.d.ts +172 -0
- package/dist/author/defaults.d.ts.map +1 -0
- package/dist/author/defaults.js +123 -0
- package/dist/author/index.d.ts +43 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +92 -0
- package/dist/author/main.d.ts +37 -0
- package/dist/author/main.d.ts.map +1 -0
- package/dist/author/main.js +301 -0
- package/dist/author/markupUtils.d.ts +18 -0
- package/dist/author/markupUtils.d.ts.map +1 -0
- package/dist/author/markupUtils.js +38 -0
- package/dist/author/utils.d.ts +10 -0
- package/dist/author/utils.d.ts.map +1 -0
- package/dist/author/utils.js +7 -0
- package/dist/controller/defaults.d.ts +27 -0
- package/dist/controller/defaults.d.ts.map +1 -0
- package/dist/controller/defaults.js +20 -0
- package/dist/controller/index.d.ts +42 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +104 -0
- package/dist/controller/utils.d.ts +14 -0
- package/dist/controller/utils.d.ts.map +1 -0
- package/dist/controller/utils.js +15 -0
- package/dist/delivery/index.d.ts +22 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +105 -0
- package/dist/delivery/main.d.ts +29 -0
- package/dist/delivery/main.d.ts.map +1 -0
- package/dist/delivery/main.js +83 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.iife.d.ts +9 -0
- package/dist/index.iife.d.ts.map +1 -0
- package/dist/index.iife.js +152 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayReduce.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js +26 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseReduce.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseEach.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_escapeHtmlChar.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js +18 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/escape.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/reduce.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
- package/package.json +72 -0
- package/src/author/choice.tsx +132 -0
- package/src/author/choices.tsx +314 -0
- package/src/author/defaults.ts +132 -0
- package/src/author/index.tsx +176 -0
- package/src/author/main.tsx +498 -0
- package/src/author/markupUtils.tsx +106 -0
- package/src/author/utils.ts +27 -0
- package/src/controller/defaults.ts +27 -0
- package/src/controller/index.ts +274 -0
- package/src/controller/utils.ts +50 -0
- package/src/delivery/index.ts +266 -0
- package/src/delivery/main.tsx +146 -0
- package/src/index.iife.ts +16 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import e from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js";
|
|
2
|
+
import { createSlateMarkup as t, processMarkup as n } from "./markupUtils.js";
|
|
3
|
+
import r from "./main.js";
|
|
4
|
+
import i from "./defaults.js";
|
|
5
|
+
import a from "react";
|
|
6
|
+
import { createRoot as o } from "react-dom/client";
|
|
7
|
+
import { renderMath as s } from "@pie-element/shared-math-rendering-mathjax";
|
|
8
|
+
import { DeleteImageEvent as c, DeleteSoundEvent as l, InsertImageEvent as u, InsertSoundEvent as d, ModelUpdatedEvent as f } from "@pie-element/shared-configure-events";
|
|
9
|
+
import p from "debug";
|
|
10
|
+
//#region src/author/index.tsx
|
|
11
|
+
var m = p("multiple-choice:configure"), h = class p extends HTMLElement {
|
|
12
|
+
static prepareModel = (e = {}) => {
|
|
13
|
+
let r = {
|
|
14
|
+
...i.model,
|
|
15
|
+
...e
|
|
16
|
+
}, a = e.slateMarkup || t(r.markup, r.choices, r.correctResponse), o = n(a);
|
|
17
|
+
return {
|
|
18
|
+
...r,
|
|
19
|
+
slateMarkup: a,
|
|
20
|
+
markup: o.markup,
|
|
21
|
+
correctResponse: o.correctResponse
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
constructor() {
|
|
25
|
+
super(), this._root = null, this._model = p.prepareModel(), this._configuration = i.configuration, this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
26
|
+
}
|
|
27
|
+
set model(e) {
|
|
28
|
+
let t = {
|
|
29
|
+
...e,
|
|
30
|
+
markup: `<div>${e.markup || i.model.markup}</div>`
|
|
31
|
+
};
|
|
32
|
+
this._model = p.prepareModel(t), this._render();
|
|
33
|
+
}
|
|
34
|
+
set configuration(t) {
|
|
35
|
+
let n = e(t, i.configuration);
|
|
36
|
+
this._configuration = n, 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({
|
|
37
|
+
value: this._model.language,
|
|
38
|
+
label: this._model.language
|
|
39
|
+
})) : delete this._model.language, this._render();
|
|
40
|
+
}
|
|
41
|
+
set disableSidePanel(e) {
|
|
42
|
+
this._disableSidePanel = e, this._render();
|
|
43
|
+
}
|
|
44
|
+
dispatchModelUpdated(e) {
|
|
45
|
+
let t = !!e;
|
|
46
|
+
this.dispatchEvent(new f(this._model, t));
|
|
47
|
+
}
|
|
48
|
+
onModelChanged(e, t) {
|
|
49
|
+
this._model = p.prepareModel(e), this._render(), this.dispatchModelUpdated(t);
|
|
50
|
+
}
|
|
51
|
+
onConfigurationChanged(e) {
|
|
52
|
+
this._configuration = e, this._render();
|
|
53
|
+
}
|
|
54
|
+
insertImage(e) {
|
|
55
|
+
this.dispatchEvent(new u(e));
|
|
56
|
+
}
|
|
57
|
+
onDeleteImage(e, t) {
|
|
58
|
+
this.dispatchEvent(new c(e, t));
|
|
59
|
+
}
|
|
60
|
+
insertSound(e) {
|
|
61
|
+
this.dispatchEvent(new d(e));
|
|
62
|
+
}
|
|
63
|
+
onDeleteSound(e, t) {
|
|
64
|
+
this.dispatchEvent(new l(e, t));
|
|
65
|
+
}
|
|
66
|
+
_render() {
|
|
67
|
+
m("_render");
|
|
68
|
+
let e = a.createElement(r, {
|
|
69
|
+
model: this._model,
|
|
70
|
+
configuration: this._configuration,
|
|
71
|
+
onModelChanged: this.onModelChanged,
|
|
72
|
+
onConfigurationChanged: this.onConfigurationChanged,
|
|
73
|
+
disableSidePanel: this._disableSidePanel,
|
|
74
|
+
imageSupport: {
|
|
75
|
+
add: this.insertImage.bind(this),
|
|
76
|
+
delete: this.onDeleteImage.bind(this)
|
|
77
|
+
},
|
|
78
|
+
uploadSoundSupport: {
|
|
79
|
+
add: this.insertSound.bind(this),
|
|
80
|
+
delete: this.onDeleteSound.bind(this)
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
this._root ||= o(this), this._root.render(e), setTimeout(() => {
|
|
84
|
+
s(this);
|
|
85
|
+
}, 0);
|
|
86
|
+
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
this._root && this._root.unmount();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { h as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drag-in-the-blank/configure/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
|
+
configuration: PropTypes.Validator<object>;
|
|
14
|
+
model: PropTypes.Validator<object>;
|
|
15
|
+
disableSidePanel: PropTypes.Requireable<boolean>;
|
|
16
|
+
onModelChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
onConfigurationChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
+
imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
|
+
add: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
+
delete: PropTypes.Validator<(...args: any[]) => any>;
|
|
21
|
+
}>>;
|
|
22
|
+
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
23
|
+
};
|
|
24
|
+
state: {
|
|
25
|
+
activeDragItem: null;
|
|
26
|
+
};
|
|
27
|
+
constructor(props: any);
|
|
28
|
+
onModelChange: any;
|
|
29
|
+
onPromptChanged: any;
|
|
30
|
+
onRationaleChanged: any;
|
|
31
|
+
onTeacherInstructionsChanged: any;
|
|
32
|
+
onMarkupChanged: any;
|
|
33
|
+
onResponsesChanged: any;
|
|
34
|
+
render(): React.JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
export default Main;
|
|
37
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/author/main.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAgHnC,qBAAa,IAAK,SAAQ,KAAK,CAAC,SAAS;IACvC,MAAM,CAAC,SAAS;;;;;;;;;;;MAWd;IAEF,KAAK;;MAEH;gBAEU,KAAK,KAAA;IAKjB,aAAa,EAAE,GAAG,CAKhB;IAEF,eAAe,EAAE,GAAG,CAKlB;IAEF,kBAAkB,EAAE,GAAG,CAKrB;IAEF,4BAA4B,EAAE,GAAG,CAK/B;IAEF,eAAe,EAAE,GAAG,CAKlB;IAEF,kBAAkB,EAAE,GAAG,CAWrB;IAEF,MAAM;CA6SP;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { createSlateMarkup as e } from "./markupUtils.js";
|
|
2
|
+
import t from "./choice.js";
|
|
3
|
+
import n from "./choices.js";
|
|
4
|
+
import { generateValidationMessage as r } from "./utils.js";
|
|
5
|
+
import i from "react";
|
|
6
|
+
import { renderMath as a } from "@pie-element/shared-math-rendering-mathjax";
|
|
7
|
+
import * as o from "@pie-lib/render-ui";
|
|
8
|
+
import { InputContainer as s } from "@pie-lib/render-ui";
|
|
9
|
+
import c from "prop-types";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
import { styled as d } from "@mui/material/styles";
|
|
12
|
+
import f, { ALL_PLUGINS as ee } from "@pie-lib/editable-html-tip-tap";
|
|
13
|
+
import { layout as te, settings as p } from "@pie-lib/config-ui";
|
|
14
|
+
import { DragProvider as m } from "@pie-lib/drag";
|
|
15
|
+
import h from "@mui/material/Typography";
|
|
16
|
+
import ne from "@mui/icons-material/Info";
|
|
17
|
+
import g from "@mui/material/Tooltip";
|
|
18
|
+
import { DragOverlay as re } from "@dnd-kit/core";
|
|
19
|
+
//#region src/author/main.tsx
|
|
20
|
+
function _(e) {
|
|
21
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
22
|
+
}
|
|
23
|
+
function v(e, t) {
|
|
24
|
+
return !e || _(e) ? e : _(e.default) ? e.default : t && _(e[t]) ? e[t] : t && _(e[t]?.default) ? e[t].default : e;
|
|
25
|
+
}
|
|
26
|
+
var y = v(s, "InputContainer") || v(S.InputContainer, "InputContainer"), b = o, x = b.default, S = x && typeof x == "object" ? x : b, ie = class extends i.Component {
|
|
27
|
+
containerRef = i.createRef();
|
|
28
|
+
componentDidMount() {
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
this.containerRef.current && a(this.containerRef.current);
|
|
31
|
+
}, 0);
|
|
32
|
+
}
|
|
33
|
+
componentDidUpdate() {
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
this.containerRef.current && a(this.containerRef.current);
|
|
36
|
+
}, 0);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return /* @__PURE__ */ l("div", {
|
|
40
|
+
ref: this.containerRef,
|
|
41
|
+
children: this.props.children
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, { dropdown: C, toggle: w, Panel: T } = p, E = d(y)(({ theme: e }) => ({
|
|
45
|
+
width: "100%",
|
|
46
|
+
paddingTop: e.spacing(2),
|
|
47
|
+
marginBottom: e.spacing(2)
|
|
48
|
+
})), D = d("div")(({ theme: e }) => ({
|
|
49
|
+
minHeight: "235px",
|
|
50
|
+
paddingTop: e.spacing(1),
|
|
51
|
+
paddingBottom: e.spacing(2),
|
|
52
|
+
width: "100%",
|
|
53
|
+
"& [data-slate-editor=\"true\"]": { minHeight: "235px" }
|
|
54
|
+
})), ae = d(h)(({ theme: e }) => ({ fontSize: e.typography.fontSize + 2 })), oe = d(g)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
55
|
+
fontSize: e.typography.fontSize - 2,
|
|
56
|
+
whiteSpace: "pre",
|
|
57
|
+
maxWidth: "500px"
|
|
58
|
+
} })), O = d("div")(({ theme: e }) => ({
|
|
59
|
+
fontSize: e.typography.fontSize - 2,
|
|
60
|
+
color: e.palette.error.main,
|
|
61
|
+
paddingTop: e.spacing(1)
|
|
62
|
+
})), k = d("div")({
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center"
|
|
65
|
+
}), A = class extends i.Component {
|
|
66
|
+
static propTypes = {
|
|
67
|
+
configuration: c.object.isRequired,
|
|
68
|
+
model: c.object.isRequired,
|
|
69
|
+
disableSidePanel: c.bool,
|
|
70
|
+
onModelChanged: c.func.isRequired,
|
|
71
|
+
onConfigurationChanged: c.func.isRequired,
|
|
72
|
+
imageSupport: c.shape({
|
|
73
|
+
add: c.func.isRequired,
|
|
74
|
+
delete: c.func.isRequired
|
|
75
|
+
}),
|
|
76
|
+
uploadSoundSupport: c.object
|
|
77
|
+
};
|
|
78
|
+
state = { activeDragItem: null };
|
|
79
|
+
constructor(e) {
|
|
80
|
+
super(e), this.markupRef = i.createRef();
|
|
81
|
+
}
|
|
82
|
+
onModelChange = (e) => {
|
|
83
|
+
this.props.onModelChanged({
|
|
84
|
+
...this.props.model,
|
|
85
|
+
...e
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
onPromptChanged = (e) => {
|
|
89
|
+
this.props.onModelChanged({
|
|
90
|
+
...this.props.model,
|
|
91
|
+
prompt: e
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
onRationaleChanged = (e) => {
|
|
95
|
+
this.props.onModelChanged({
|
|
96
|
+
...this.props.model,
|
|
97
|
+
rationale: e
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
onTeacherInstructionsChanged = (e) => {
|
|
101
|
+
this.props.onModelChanged({
|
|
102
|
+
...this.props.model,
|
|
103
|
+
teacherInstructions: e
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
onMarkupChanged = (e) => {
|
|
107
|
+
this.props.onModelChanged({
|
|
108
|
+
...this.props.model,
|
|
109
|
+
slateMarkup: e
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
onResponsesChanged = (t) => {
|
|
113
|
+
let { model: { correctResponse: n, markup: r } } = this.props, i = e(r, t, n);
|
|
114
|
+
this.props.onModelChanged({
|
|
115
|
+
...this.props.model,
|
|
116
|
+
slateMarkup: i,
|
|
117
|
+
choices: t
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
render() {
|
|
121
|
+
let { model: e, configuration: i, onConfigurationChanged: a, imageSupport: o, uploadSoundSupport: s } = this.props, { addChoice: c = {}, baseInputConfiguration: d = {}, contentDimensions: p = {}, duplicates: h = {}, prompt: g = {}, partialScoring: _ = {}, lockChoiceOrder: v = {}, rationale: y = {}, teacherInstructions: b = {}, choicesPosition: x = {}, spellCheck: S = {}, settingsPanelDisabled: A, maxChoices: se, maxResponseAreas: ce, maxImageWidth: j = {}, maxImageHeight: M = {}, withRubric: N = {}, mathMlOptions: P = {}, language: F = {}, languageChoices: I = {}, maxLength: L = {} } = i || {}, { rationaleEnabled: R, promptEnabled: z, teacherInstructionsEnabled: B, spellCheckEnabled: V, toolbarEditorPosition: H, errors: U, extraCSSRules: W } = e || {}, { choicesError: le, correctResponseError: G, prompt: K, rationale: q, responseAreasError: J, teacherInstructions: Y } = U || {}, ue = r(i), X = j && j.prompt, Z = M && M.prompt, Q = { position: H === "top" ? "top" : "bottom" }, de = {
|
|
122
|
+
partialScoring: _.settings && w(_.label),
|
|
123
|
+
duplicates: h.settings && w(h.label),
|
|
124
|
+
lockChoiceOrder: v.settings && w(v.label),
|
|
125
|
+
choicesPosition: x.settings && C(x.label, [
|
|
126
|
+
"above",
|
|
127
|
+
"below",
|
|
128
|
+
"left",
|
|
129
|
+
"right"
|
|
130
|
+
]),
|
|
131
|
+
"language.enabled": F.settings && w(F.label, !0),
|
|
132
|
+
language: F.settings && F.enabled && C(I.label, I.options)
|
|
133
|
+
}, fe = {
|
|
134
|
+
teacherInstructionsEnabled: b.settings && w(b.label),
|
|
135
|
+
rationaleEnabled: y.settings && w(y.label),
|
|
136
|
+
spellCheckEnabled: S.settings && w(S.label),
|
|
137
|
+
promptEnabled: g.settings && w(g.label),
|
|
138
|
+
rubricEnabled: N?.settings && w(N?.label)
|
|
139
|
+
}, $ = (e) => Object.assign({ ...d }, e || {});
|
|
140
|
+
return /* @__PURE__ */ u(m, {
|
|
141
|
+
onDragEnd: ({ active: e, over: t }) => {
|
|
142
|
+
if (e && !t) {
|
|
143
|
+
let t = e.data.current;
|
|
144
|
+
if (t && t.type === "drag-in-the-blank-placed-choice" && this.markupRef.current) {
|
|
145
|
+
let n = this.markupRef.current.getBoundingClientRect(), r = e.rect.current.translated?.x || 0, i = e.rect.current.translated?.y || 0;
|
|
146
|
+
(r < n.left || r > n.right || i < n.top || i > n.bottom) && t.onRemove && typeof t.onRemove == "function" && t.onRemove(t);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!e || !t) {
|
|
150
|
+
this.setState({ activeDragItem: null });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
let n = e.data.current, r = t.data.current;
|
|
154
|
+
if (r && typeof r.onDrop == "function") {
|
|
155
|
+
r.onDrop(n, r);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
n && typeof n.onDrop == "function" && n.onDrop(n, r), this.setState({ activeDragItem: null });
|
|
159
|
+
},
|
|
160
|
+
onDragStart: (e) => {
|
|
161
|
+
let { active: t } = e;
|
|
162
|
+
t?.data?.current && this.setState({ activeDragItem: t.data.current });
|
|
163
|
+
},
|
|
164
|
+
children: [/* @__PURE__ */ u(te.ConfigLayout, {
|
|
165
|
+
extraCSSRules: W,
|
|
166
|
+
dimensions: p,
|
|
167
|
+
hideSettings: A,
|
|
168
|
+
settings: /* @__PURE__ */ l(T, {
|
|
169
|
+
model: e,
|
|
170
|
+
configuration: i,
|
|
171
|
+
onChangeModel: (e) => this.onModelChange(e),
|
|
172
|
+
onChangeConfiguration: (e) => a(e, !0),
|
|
173
|
+
groups: {
|
|
174
|
+
Settings: de,
|
|
175
|
+
Properties: fe
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
178
|
+
children: [
|
|
179
|
+
B && /* @__PURE__ */ u(E, {
|
|
180
|
+
label: b.label,
|
|
181
|
+
children: [/* @__PURE__ */ l(f, {
|
|
182
|
+
markup: e.teacherInstructions || "",
|
|
183
|
+
onChange: this.onTeacherInstructionsChanged,
|
|
184
|
+
imageSupport: o,
|
|
185
|
+
nonEmpty: !1,
|
|
186
|
+
error: Y,
|
|
187
|
+
toolbarOpts: Q,
|
|
188
|
+
pluginProps: $(b?.inputConfiguration),
|
|
189
|
+
spellCheck: V,
|
|
190
|
+
maxImageWidth: j && j.teacherInstructions || X,
|
|
191
|
+
maxImageHeight: M && M.teacherInstructions || Z,
|
|
192
|
+
uploadSoundSupport: s,
|
|
193
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
194
|
+
mathMlOptions: P
|
|
195
|
+
}), Y && /* @__PURE__ */ l(O, { children: Y })]
|
|
196
|
+
}),
|
|
197
|
+
z && /* @__PURE__ */ u(E, {
|
|
198
|
+
label: g.label,
|
|
199
|
+
children: [/* @__PURE__ */ l(f, {
|
|
200
|
+
markup: e.prompt,
|
|
201
|
+
onChange: this.onPromptChanged,
|
|
202
|
+
imageSupport: o,
|
|
203
|
+
nonEmpty: !1,
|
|
204
|
+
disableUnderline: !0,
|
|
205
|
+
error: K,
|
|
206
|
+
toolbarOpts: Q,
|
|
207
|
+
pluginProps: $(g?.inputConfiguration),
|
|
208
|
+
spellCheck: V,
|
|
209
|
+
maxImageWidth: X,
|
|
210
|
+
maxImageHeight: Z,
|
|
211
|
+
uploadSoundSupport: s,
|
|
212
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
213
|
+
mathMlOptions: P
|
|
214
|
+
}), K && /* @__PURE__ */ l(O, { children: K })]
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ u(k, { children: [/* @__PURE__ */ l(ae, {
|
|
217
|
+
component: "div",
|
|
218
|
+
children: "Define Template, Choices, and Correct Responses"
|
|
219
|
+
}), /* @__PURE__ */ l(oe, {
|
|
220
|
+
disableFocusListener: !0,
|
|
221
|
+
disableTouchListener: !0,
|
|
222
|
+
placement: "right",
|
|
223
|
+
title: ue,
|
|
224
|
+
children: /* @__PURE__ */ l(ne, {
|
|
225
|
+
fontSize: "small",
|
|
226
|
+
color: "primary",
|
|
227
|
+
style: { marginLeft: "5px" }
|
|
228
|
+
})
|
|
229
|
+
})] }),
|
|
230
|
+
/* @__PURE__ */ l(D, {
|
|
231
|
+
ref: this.markupRef,
|
|
232
|
+
children: /* @__PURE__ */ l(f, {
|
|
233
|
+
activePlugins: ee,
|
|
234
|
+
responseAreaProps: {
|
|
235
|
+
type: "drag-in-the-blank",
|
|
236
|
+
options: { duplicates: e.duplicates },
|
|
237
|
+
maxResponseAreas: ce
|
|
238
|
+
},
|
|
239
|
+
pluginProps: $(),
|
|
240
|
+
markup: e.slateMarkup,
|
|
241
|
+
onChange: this.onMarkupChanged,
|
|
242
|
+
imageSupport: o,
|
|
243
|
+
disableImageAlignmentButtons: !0,
|
|
244
|
+
nonEmpty: !1,
|
|
245
|
+
disableUnderline: !0,
|
|
246
|
+
error: J || G,
|
|
247
|
+
toolbarOpts: Q,
|
|
248
|
+
spellCheck: V,
|
|
249
|
+
uploadSoundSupport: s,
|
|
250
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
251
|
+
mathMlOptions: P
|
|
252
|
+
})
|
|
253
|
+
}),
|
|
254
|
+
J && /* @__PURE__ */ l(O, { children: J }),
|
|
255
|
+
G && /* @__PURE__ */ l(O, { children: G }),
|
|
256
|
+
/* @__PURE__ */ l(n, {
|
|
257
|
+
model: e,
|
|
258
|
+
imageSupport: o,
|
|
259
|
+
duplicates: e.duplicates,
|
|
260
|
+
error: le,
|
|
261
|
+
onChange: this.onResponsesChanged,
|
|
262
|
+
toolbarOpts: Q,
|
|
263
|
+
maxChoices: se,
|
|
264
|
+
uploadSoundSupport: s,
|
|
265
|
+
mathMlOptions: P,
|
|
266
|
+
pluginProps: $(c?.inputConfiguration),
|
|
267
|
+
maxImageWidth: j && j.choice || X,
|
|
268
|
+
maxImageHeight: M && M.choice || Z,
|
|
269
|
+
maxLength: L
|
|
270
|
+
}),
|
|
271
|
+
R && /* @__PURE__ */ u(E, {
|
|
272
|
+
label: y.label,
|
|
273
|
+
children: [/* @__PURE__ */ l(f, {
|
|
274
|
+
markup: e.rationale || "",
|
|
275
|
+
onChange: this.onRationaleChanged,
|
|
276
|
+
imageSupport: o,
|
|
277
|
+
error: q,
|
|
278
|
+
toolbarOpts: Q,
|
|
279
|
+
pluginProps: $(y?.inputConfiguration),
|
|
280
|
+
spellCheck: V,
|
|
281
|
+
maxImageWidth: j && j.rationale || X,
|
|
282
|
+
maxImageHeight: M && M.rationale || Z,
|
|
283
|
+
uploadSoundSupport: s,
|
|
284
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
285
|
+
mathMlOptions: P
|
|
286
|
+
}), q && /* @__PURE__ */ l(O, { children: q })]
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
}), /* @__PURE__ */ l(re, { children: /* @__PURE__ */ l(ie, { children: (() => {
|
|
290
|
+
let { activeDragItem: e } = this.state, { model: n } = this.props;
|
|
291
|
+
if (!e) return null;
|
|
292
|
+
if ((e.type === "drag-in-the-blank-choice" || e.type === "drag-in-the-blank-placed-choice") && e.value) {
|
|
293
|
+
let r = n.choices?.find((t) => t.id === e.value.id);
|
|
294
|
+
return r ? /* @__PURE__ */ l(t, { choice: r }) : null;
|
|
295
|
+
}
|
|
296
|
+
})() }) })]
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
//#endregion
|
|
301
|
+
export { A as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drag-in-the-blank/configure/src/markupUtils.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
|
+
export declare const createElementFromHTML: (htmlString: any) => HTMLDivElement;
|
|
10
|
+
export declare const removeUnwantedCharacters: (markup: any) => any;
|
|
11
|
+
export declare const processMarkup: (markup: any) => {
|
|
12
|
+
markup: string;
|
|
13
|
+
choices: any[];
|
|
14
|
+
correctResponse: any;
|
|
15
|
+
};
|
|
16
|
+
export declare const createSlateMarkup: (markup: any, choices: any, correctResponse: any) => any;
|
|
17
|
+
export declare const choiceIsEmpty: (choice: any) => boolean;
|
|
18
|
+
//# sourceMappingURL=markupUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markupUtils.d.ts","sourceRoot":"","sources":["../../src/author/markupUtils.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH,eAAO,MAAM,qBAAqB,GAAI,eAAU,mBAM/C,CAAC;AAYF,eAAO,MAAM,wBAAwB,GAAI,WAAM,QACoC,CAAC;AAEpF,eAAO,MAAM,aAAa,GAAI,WAAM;;;;CA8BnC,CAAC;AAIF,eAAO,MAAM,iBAAiB,GAAI,WAAM,EAAE,YAAO,EAAE,oBAAe,QAmBjE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAM,YAiBnC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import e from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/escape.js";
|
|
2
|
+
//#region src/author/markupUtils.tsx
|
|
3
|
+
var t = (e) => {
|
|
4
|
+
let t = document.createElement("div");
|
|
5
|
+
return t.innerHTML = e.trim(), t;
|
|
6
|
+
}, n = "imes|riangle|an|heta|herefore", r = "throot|parallel|cong|approx|eq|e|sim", i = RegExp(`(\\t(?!${n}))|(\\n(?!${r}))|(\\\\t(?!${n}))|(\\\\n(?!${r}))`, "g"), a = (e) => e.replace(i, "").replace(/\\"/g, "\"").replace(/\\\//g, "/"), o = (e) => {
|
|
7
|
+
let n = t(a(e)), r = [], i = 0;
|
|
8
|
+
return n.querySelectorAll("[data-type=\"drag_in_the_blank\"]").forEach((e) => {
|
|
9
|
+
let t = e.dataset.value && e.dataset.value.replace(/ /g, " ").trim();
|
|
10
|
+
t ||= "", r.push({
|
|
11
|
+
value: t,
|
|
12
|
+
id: e.dataset.id
|
|
13
|
+
}), e.replaceWith(`{{${i++}}}`);
|
|
14
|
+
}), {
|
|
15
|
+
markup: n.innerHTML,
|
|
16
|
+
choices: r,
|
|
17
|
+
correctResponse: r.reduce((e, t, n) => (e[n] = t.id !== void 0 && t.id || "", e), {})
|
|
18
|
+
};
|
|
19
|
+
}, s = /\{\{(\d+)\}\}/g, c = (t, n, r) => {
|
|
20
|
+
let i = a(t), o = 0;
|
|
21
|
+
return i.replace(s, (t, i) => {
|
|
22
|
+
let a = r[i], s = n.find((e) => e.id === a);
|
|
23
|
+
return (!s || !s.value) && (s = {
|
|
24
|
+
id: "",
|
|
25
|
+
value: ""
|
|
26
|
+
}), `<span data-type="drag_in_the_blank" data-index="${o++}" data-id="${s.id}" data-value="${e(s.value)}"></span>`;
|
|
27
|
+
});
|
|
28
|
+
}, l = (e) => {
|
|
29
|
+
if (e) {
|
|
30
|
+
let { value: n = "" } = e, r = t(n);
|
|
31
|
+
return Array.from(r.querySelectorAll("*")).forEach((e) => {
|
|
32
|
+
e.tagName !== "IMG" && e.childNodes.length === 0 && e.remove();
|
|
33
|
+
}), r.innerHTML.trim() === "";
|
|
34
|
+
}
|
|
35
|
+
return !1;
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { l as choiceIsEmpty, c as createSlateMarkup, o as processMarkup };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drag-in-the-blank/configure/utils.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
|
+
export declare const generateValidationMessage: (config: any) => string;
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/author/utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,eAAO,MAAM,yBAAyB,GAAI,WAAM,WAgB/C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/author/utils.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let { maxResponseAreas: t, minChoices: n, maxChoices: r } = e;
|
|
4
|
+
return n ||= 2, "Validation requirements:" + ("\nThe tokens should not be empty and should be unique.\nThere should be at least 1 " + (t ? `and at most ${t} ` : "") + "response area" + (t ? "s" : "") + ` defined.\nThere should be at least ${n} ` + (r ? `and at most ${r} ` : "") + "tokens defined.");
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as generateValidationMessage };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drag-in-the-blank/controller/src/defaults.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
|
+
declare const _default: {
|
|
10
|
+
choices: never[];
|
|
11
|
+
choicesPosition: string;
|
|
12
|
+
correctResponse: {};
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
duplicates: boolean;
|
|
15
|
+
markup: string;
|
|
16
|
+
mode: string;
|
|
17
|
+
prompt: string;
|
|
18
|
+
promptEnabled: boolean;
|
|
19
|
+
rationale: string;
|
|
20
|
+
rationaleEnabled: boolean;
|
|
21
|
+
studentInstructionsEnabled: boolean;
|
|
22
|
+
teacherInstructions: string;
|
|
23
|
+
teacherInstructionsEnabled: boolean;
|
|
24
|
+
toolbarEditorPosition: string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
27
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/controller/defaults.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;AAEH,wBAgBE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/controller/defaults.ts
|
|
2
|
+
var e = {
|
|
3
|
+
choices: [],
|
|
4
|
+
choicesPosition: "below",
|
|
5
|
+
correctResponse: {},
|
|
6
|
+
disabled: !1,
|
|
7
|
+
duplicates: !0,
|
|
8
|
+
markup: "",
|
|
9
|
+
mode: "gather",
|
|
10
|
+
prompt: "",
|
|
11
|
+
promptEnabled: !0,
|
|
12
|
+
rationale: "",
|
|
13
|
+
rationaleEnabled: !0,
|
|
14
|
+
studentInstructionsEnabled: !0,
|
|
15
|
+
teacherInstructions: "",
|
|
16
|
+
teacherInstructionsEnabled: !0,
|
|
17
|
+
toolbarEditorPosition: "bottom"
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { e as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drag-in-the-blank/controller/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
|
+
export declare const normalize: (question: any) => any;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {*} question
|
|
13
|
+
* @param {*} session
|
|
14
|
+
* @param {*} env
|
|
15
|
+
* @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
|
|
16
|
+
*/
|
|
17
|
+
export declare function model(question: any, session: any, env: any, updateSession: any): Promise<any>;
|
|
18
|
+
export declare const getScore: (config: any, session: any) => number;
|
|
19
|
+
/**
|
|
20
|
+
* Generates detailed trace log for scoring evaluation
|
|
21
|
+
* @param {Object} model - the question model
|
|
22
|
+
* @param {Object} session - the student session
|
|
23
|
+
* @param {Object} env - the environment
|
|
24
|
+
* @returns {Array} traceLog - array of trace messages
|
|
25
|
+
*/
|
|
26
|
+
export declare const getLogTrace: (model: any, session: any, env: any) => string[];
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* The score is partial by default for checkbox mode, allOrNothing for radio mode.
|
|
30
|
+
* To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =
|
|
31
|
+
* false. the value in `env` will override the value in `model`.
|
|
32
|
+
* @param {Object} model - the main model
|
|
33
|
+
* @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)
|
|
34
|
+
* @param {*} session
|
|
35
|
+
* @param {Object} env
|
|
36
|
+
* @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides
|
|
37
|
+
* `model.partialScoring`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function outcome(model: any, session: any, env?: {}): Promise<unknown>;
|
|
40
|
+
export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
|
|
41
|
+
export declare const validate: (model?: {}, config?: {}) => {};
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controller/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAOH,eAAO,MAAM,SAAS,GAAI,aAAQ,QAGhC,CAAC;AAEH;;;;;;GAMG;AACH,wBAAsB,KAAK,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA,EAAE,GAAG,KAAA,EAAE,aAAa,KAAA,gBA0EhE;AAED,eAAO,MAAM,QAAQ,GAAI,WAAM,EAAE,YAAO,WAgCvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,UAAK,EAAE,YAAO,EAAE,QAAG,aA0C9C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA,EAAE,GAAG,KAAK,oBAoB/C;AAED,eAAO,MAAM,4BAA4B,GAAI,aAAQ,EAAE,QAAG,qBAWzD,CAAC;AAQF,eAAO,MAAM,QAAQ,GAAI,UAAU,EAAE,WAAW,OAgC/C,CAAC"}
|