@pie-element/placement-ordering 14.1.2-next.0 → 14.1.2-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/author/choice-editor.js +16 -17
- package/dist/author/choice-tile.js +3 -2
- package/dist/author/design.js +50 -51
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +25 -22
- package/dist/author/utils.js +1 -1
- package/dist/browser/author/index.js +23612 -21053
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-Bd36Xf5z.js +376 -0
- package/dist/browser/browser-Bd36Xf5z.js.map +1 -0
- package/dist/browser/controller/index.js +87 -164
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +476 -336
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-BTHiIs74.js → dist-DiGNNRzu.js} +354 -538
- package/dist/browser/dist-DiGNNRzu.js.map +1 -0
- package/dist/browser/{drag-provider-DaPxkh4j.js → drag-provider-B5wazJHM.js} +3284 -3615
- package/dist/browser/drag-provider-B5wazJHM.js.map +1 -0
- package/dist/controller/index.js +44 -49
- package/dist/controller/scoring.js +2 -4
- package/dist/delivery/index.js +12 -12
- package/dist/delivery/keyboard-coordinates.d.ts +47 -0
- package/dist/delivery/keyboard-coordinates.js +51 -0
- package/dist/delivery/main.js +1 -1
- package/dist/delivery/ordering.js +4 -6
- package/dist/delivery/placement-ordering.d.ts +11 -0
- package/dist/delivery/placement-ordering.js +175 -105
- package/dist/delivery/tile.d.ts +3 -0
- package/dist/delivery/tile.js +66 -57
- package/dist/delivery/tiler.d.ts +6 -0
- package/dist/delivery/tiler.js +6 -3
- package/dist/index.iife.js +35 -35
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +22 -18
- package/dist/browser/browser-CvJkn_Ec.js +0 -1019
- package/dist/browser/browser-CvJkn_Ec.js.map +0 -1
- package/dist/browser/dist-BTHiIs74.js.map +0 -1
- package/dist/browser/drag-provider-DaPxkh4j.js.map +0 -1
- package/dist/browser/last-D7N4Qfx4.js +0 -9
- package/dist/browser/last-D7N4Qfx4.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/_arrayEvery.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/_arrayIncludes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_baseDifference.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
- 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/_baseIsMatch.js +0 -26
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
- 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/_baseIteratee.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_baseShuffle.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +0 -9
- 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/_createAssigner.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
- 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/_getMatchData.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_hasPath.js +0 -18
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_isFlattenable.js +0 -10
- 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/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_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/_shuffleSelf.js +0 -12
- 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/_strictIndexOf.js +0 -7
- 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/assign.js +0 -16
- 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/compact.js +0 -10
- 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/defaults.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
- 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/every.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/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/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/last.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
- 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/noop.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +0 -8
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import k, { createElement as
|
|
5
|
-
import { createRoot as
|
|
6
|
-
import
|
|
7
|
-
import { jsx as
|
|
8
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js
|
|
9
|
-
var pe = Object.prototype.hasOwnProperty, me = f(function(e, r) {
|
|
10
|
-
if (t(r) || u(r)) {
|
|
11
|
-
m(r, n(r), e);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
for (var i in r) pe.call(r, i) && ne(e, i, r[i]);
|
|
15
|
-
}), M = r(function(e, t) {
|
|
16
|
-
return a(e) ? se(e, i(t, 1, a, !0)) : [];
|
|
17
|
-
}), he = 0;
|
|
18
|
-
function ge(t) {
|
|
19
|
-
var n = ++he;
|
|
20
|
-
return e(t) + n;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
1
|
+
import { C as e, _ as t, b as n, g as r, k as i, l as a, r as o, t as s, u as c, v as l } from "../browser-Bd36Xf5z.js";
|
|
2
|
+
import { Lt as u, Rt as d, T as f, at as p, c as m, ct as h, dt as g, ft as _, l as v, lt as y, mt as b, n as x, ot as S, s as C, st as w, t as ee, u as T, ut as E, v as D } from "../drag-provider-B5wazJHM.js";
|
|
3
|
+
import { t as O } from "../dist-DiGNNRzu.js";
|
|
4
|
+
import k, { createElement as A, useRef as j } from "react";
|
|
5
|
+
import { createRoot as M } from "react-dom/client";
|
|
6
|
+
import N from "react-dom";
|
|
7
|
+
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
23
8
|
//#region ../../shared/player-events/dist/index.js
|
|
24
|
-
var
|
|
9
|
+
var I = /* @__PURE__ */ i(s(), 1);
|
|
25
10
|
(class e extends CustomEvent {
|
|
26
11
|
static {
|
|
27
12
|
this.TYPE = "model-set";
|
|
@@ -38,7 +23,7 @@ var N = /* @__PURE__ */ s(l(), 1);
|
|
|
38
23
|
}), this.component = t, this.complete = n;
|
|
39
24
|
}
|
|
40
25
|
});
|
|
41
|
-
var
|
|
26
|
+
var te = class e extends CustomEvent {
|
|
42
27
|
static {
|
|
43
28
|
this.TYPE = "session-changed";
|
|
44
29
|
}
|
|
@@ -52,39 +37,47 @@ var _e = class e extends CustomEvent {
|
|
|
52
37
|
}
|
|
53
38
|
}), this.component = t, this.complete = n;
|
|
54
39
|
}
|
|
55
|
-
},
|
|
40
|
+
}, L = /* @__PURE__ */ i(u(), 1);
|
|
41
|
+
function ne(e, t, n) {
|
|
42
|
+
let r = { ...e };
|
|
43
|
+
return t.top + e.y <= n.top ? r.y = n.top - t.top : t.bottom + e.y >= n.top + n.height && (r.y = n.top + n.height - t.bottom), t.left + e.x <= n.left ? r.x = n.left - t.left : t.right + e.x >= n.left + n.width && (r.x = n.left + n.width - t.right), r;
|
|
44
|
+
}
|
|
45
|
+
var re = (e) => {
|
|
46
|
+
let { containerNodeRect: t, draggingNodeRect: n, transform: r } = e;
|
|
47
|
+
return !n || !t ? r : ne(r, n, t);
|
|
48
|
+
}, R = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ F("svg", {
|
|
56
49
|
preserveAspectRatio: "xMinYMin meet",
|
|
57
50
|
version: "1.1",
|
|
58
51
|
viewBox: "-283 359 34 35",
|
|
59
52
|
style: { enableBackground: "new -283 359 34 35" },
|
|
60
53
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ P("circle", {
|
|
62
55
|
cx: "-266",
|
|
63
56
|
cy: "375.9",
|
|
64
57
|
r: "14",
|
|
65
58
|
fill: e
|
|
66
59
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ P("path", {
|
|
68
61
|
d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
|
|
69
62
|
fill: e
|
|
70
63
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ P("polygon", {
|
|
72
65
|
points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
|
|
73
66
|
fill: t
|
|
74
67
|
})
|
|
75
68
|
]
|
|
76
69
|
});
|
|
77
|
-
|
|
78
|
-
bgFill:
|
|
79
|
-
fgFill:
|
|
70
|
+
R.propTypes = {
|
|
71
|
+
bgFill: L.default.string.isRequired,
|
|
72
|
+
fgFill: L.default.string.isRequired
|
|
80
73
|
};
|
|
81
|
-
var
|
|
74
|
+
var ie = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ F("svg", {
|
|
82
75
|
preserveAspectRatio: "xMinYMin meet",
|
|
83
76
|
version: "1.1",
|
|
84
77
|
viewBox: "-129.5 127 34 35",
|
|
85
78
|
style: { enableBackground: "new -129.5 127 34 35" },
|
|
86
79
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ P("path", {
|
|
88
81
|
style: {
|
|
89
82
|
fill: "#D0CAC5",
|
|
90
83
|
stroke: "#E6E3E0",
|
|
@@ -93,7 +86,7 @@ var I = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ j("svg", {
|
|
|
93
86
|
},
|
|
94
87
|
d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
|
|
95
88
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ P("path", {
|
|
97
90
|
style: {
|
|
98
91
|
fill: "#B3ABA4",
|
|
99
92
|
stroke: "#CDC7C2",
|
|
@@ -102,48 +95,48 @@ var I = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ j("svg", {
|
|
|
102
95
|
},
|
|
103
96
|
d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
|
|
104
97
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ P("circle", {
|
|
106
99
|
cx: "-114.2",
|
|
107
100
|
cy: "143.5",
|
|
108
101
|
r: "14",
|
|
109
102
|
fill: e
|
|
110
103
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ P("path", {
|
|
112
105
|
d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
|
|
113
106
|
fill: n
|
|
114
107
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ P("polygon", {
|
|
116
109
|
points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
|
|
117
110
|
fill: t
|
|
118
111
|
})
|
|
119
112
|
]
|
|
120
113
|
});
|
|
121
|
-
|
|
122
|
-
bgFill:
|
|
123
|
-
fgFill:
|
|
124
|
-
borderFill:
|
|
114
|
+
ie.propTypes = {
|
|
115
|
+
bgFill: L.default.string.isRequired,
|
|
116
|
+
fgFill: L.default.string.isRequired,
|
|
117
|
+
borderFill: L.default.string.isRequired
|
|
125
118
|
};
|
|
126
|
-
var
|
|
119
|
+
var ae = b("div")(({ size: e }) => ({
|
|
127
120
|
width: e || "25px",
|
|
128
121
|
height: e || "25px"
|
|
129
|
-
})),
|
|
122
|
+
})), z = ({ open: e, size: t }) => /* @__PURE__ */ P(ae, {
|
|
130
123
|
size: t,
|
|
131
|
-
children: e ? /* @__PURE__ */
|
|
124
|
+
children: e ? /* @__PURE__ */ P(R, {
|
|
132
125
|
bgFill: "#bce2ff",
|
|
133
126
|
fgFill: "#1a9cff"
|
|
134
|
-
}) : /* @__PURE__ */
|
|
127
|
+
}) : /* @__PURE__ */ P(ie, {
|
|
135
128
|
bgFill: "white",
|
|
136
129
|
fgFill: "#1a9cff",
|
|
137
130
|
borderFill: "#bce2ff"
|
|
138
131
|
})
|
|
139
132
|
});
|
|
140
|
-
|
|
141
|
-
open:
|
|
142
|
-
size:
|
|
143
|
-
},
|
|
133
|
+
z.propTypes = {
|
|
134
|
+
open: L.default.bool,
|
|
135
|
+
size: L.default.string
|
|
136
|
+
}, z.defaultProps = { open: !1 };
|
|
144
137
|
//#endregion
|
|
145
138
|
//#region ../../lib-react/correct-answer-toggle/dist/expander.js
|
|
146
|
-
var
|
|
139
|
+
var oe = "height ease-in 300ms, opacity ease-in 300ms", se = b("div")(() => ({
|
|
147
140
|
position: "relative",
|
|
148
141
|
height: 0,
|
|
149
142
|
overflow: "hidden",
|
|
@@ -151,7 +144,7 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
|
|
|
151
144
|
visibility: "hidden",
|
|
152
145
|
width: 0,
|
|
153
146
|
"&.enter": {
|
|
154
|
-
transition:
|
|
147
|
+
transition: oe,
|
|
155
148
|
opacity: 1,
|
|
156
149
|
height: "auto",
|
|
157
150
|
width: "auto",
|
|
@@ -165,7 +158,7 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
|
|
|
165
158
|
minHeight: "25px"
|
|
166
159
|
},
|
|
167
160
|
"&.exit": {
|
|
168
|
-
transition:
|
|
161
|
+
transition: oe,
|
|
169
162
|
opacity: 0,
|
|
170
163
|
height: 0,
|
|
171
164
|
visibility: "visible",
|
|
@@ -177,9 +170,9 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
|
|
|
177
170
|
height: 0,
|
|
178
171
|
width: 0
|
|
179
172
|
}
|
|
180
|
-
})),
|
|
181
|
-
let { show: t, children: n, className: r } = e, i =
|
|
182
|
-
return /* @__PURE__ */
|
|
173
|
+
})), ce = (e) => {
|
|
174
|
+
let { show: t, children: n, className: r } = e, i = j(null);
|
|
175
|
+
return /* @__PURE__ */ P(S, {
|
|
183
176
|
nodeRef: i,
|
|
184
177
|
in: t,
|
|
185
178
|
appear: !0,
|
|
@@ -191,49 +184,49 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
|
|
|
191
184
|
exit: "exit",
|
|
192
185
|
exitDone: "exit-done"
|
|
193
186
|
},
|
|
194
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ P(se, {
|
|
195
188
|
ref: i,
|
|
196
189
|
className: r,
|
|
197
190
|
children: n
|
|
198
191
|
})
|
|
199
192
|
});
|
|
200
193
|
};
|
|
201
|
-
|
|
202
|
-
show:
|
|
203
|
-
className:
|
|
204
|
-
children:
|
|
194
|
+
ce.propTypes = {
|
|
195
|
+
show: L.default.bool.isRequired,
|
|
196
|
+
className: L.default.string,
|
|
197
|
+
children: L.default.oneOfType([L.default.arrayOf(L.default.node), L.default.node]).isRequired
|
|
205
198
|
};
|
|
206
199
|
//#endregion
|
|
207
200
|
//#region ../../lib-react/correct-answer-toggle/dist/index.js
|
|
208
201
|
function B(e) {
|
|
209
202
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
210
203
|
}
|
|
211
|
-
function
|
|
204
|
+
function le(e, t) {
|
|
212
205
|
return !e || B(e) ? e : B(e.default) ? e.default : t && B(e[t]) ? e[t] : t && B(e[t]?.default) ? e[t].default : e;
|
|
213
206
|
}
|
|
214
|
-
var
|
|
207
|
+
var ue = le(v, "Readable") || le(fe.Readable, "Readable"), de = x, V = de.default, fe = V && typeof V == "object" ? V : de, { translator: H } = O, pe = {
|
|
215
208
|
WebkitTouchCallout: "none",
|
|
216
209
|
WebkitUserSelect: "none",
|
|
217
210
|
KhtmlUserSelect: "none",
|
|
218
211
|
MozUserSelect: "none",
|
|
219
212
|
msUserSelect: "none",
|
|
220
213
|
userSelect: "none"
|
|
221
|
-
},
|
|
214
|
+
}, me = b("div")(() => ({
|
|
222
215
|
width: "100%",
|
|
223
216
|
cursor: "pointer"
|
|
224
|
-
})),
|
|
217
|
+
})), he = b("div")(() => ({
|
|
225
218
|
margin: "0 auto",
|
|
226
219
|
textAlign: "center",
|
|
227
220
|
display: "flex"
|
|
228
|
-
})),
|
|
221
|
+
})), ge = b("div")(() => ({
|
|
229
222
|
width: "fit-content",
|
|
230
223
|
minWidth: "140px",
|
|
231
224
|
alignSelf: "center",
|
|
232
225
|
verticalAlign: "middle",
|
|
233
|
-
color: `var(--correct-answer-toggle-label-color, ${
|
|
226
|
+
color: `var(--correct-answer-toggle-label-color, ${w.text()})`,
|
|
234
227
|
fontWeight: "normal",
|
|
235
|
-
...
|
|
236
|
-
})),
|
|
228
|
+
...pe
|
|
229
|
+
})), U = b("div")(() => ({
|
|
237
230
|
position: "absolute",
|
|
238
231
|
width: "25px",
|
|
239
232
|
"&.enter": { opacity: "0" },
|
|
@@ -246,20 +239,20 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
246
239
|
opacity: "0",
|
|
247
240
|
transition: "opacity 0.3s ease-in"
|
|
248
241
|
}
|
|
249
|
-
})),
|
|
242
|
+
})), _e = b("div")(() => ({
|
|
250
243
|
width: "25px",
|
|
251
244
|
marginRight: "5px",
|
|
252
245
|
display: "flex",
|
|
253
246
|
alignItems: "center"
|
|
254
|
-
})),
|
|
247
|
+
})), ve = class e extends k.Component {
|
|
255
248
|
static propTypes = {
|
|
256
|
-
onToggle:
|
|
257
|
-
toggled:
|
|
258
|
-
show:
|
|
259
|
-
hideMessage:
|
|
260
|
-
showMessage:
|
|
261
|
-
className:
|
|
262
|
-
language:
|
|
249
|
+
onToggle: L.default.func,
|
|
250
|
+
toggled: L.default.bool,
|
|
251
|
+
show: L.default.bool,
|
|
252
|
+
hideMessage: L.default.string,
|
|
253
|
+
showMessage: L.default.string,
|
|
254
|
+
className: L.default.string,
|
|
255
|
+
language: L.default.string
|
|
263
256
|
};
|
|
264
257
|
static defaultProps = {
|
|
265
258
|
showMessage: "Show correct answer",
|
|
@@ -289,14 +282,14 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
289
282
|
}
|
|
290
283
|
render() {
|
|
291
284
|
let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
|
|
292
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ P(me, {
|
|
293
286
|
className: e,
|
|
294
|
-
children: /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ P(ce, {
|
|
295
288
|
show: this.state.show,
|
|
296
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ F(he, {
|
|
297
290
|
onClick: this.onClick.bind(this),
|
|
298
291
|
onTouchEnd: this.onTouch.bind(this),
|
|
299
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ F(_e, { children: [/* @__PURE__ */ P(S, {
|
|
300
293
|
nodeRef: this.openIconRef,
|
|
301
294
|
timeout: 400,
|
|
302
295
|
in: t,
|
|
@@ -307,11 +300,11 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
307
300
|
exit: "exit",
|
|
308
301
|
exitActive: "exit-active"
|
|
309
302
|
},
|
|
310
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ P(U, {
|
|
311
304
|
ref: this.openIconRef,
|
|
312
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ P(z, { open: t }, "correct-open")
|
|
313
306
|
})
|
|
314
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ P(S, {
|
|
315
308
|
nodeRef: this.closedIconRef,
|
|
316
309
|
timeout: 5e3,
|
|
317
310
|
in: !t,
|
|
@@ -322,13 +315,13 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
322
315
|
exit: "exit",
|
|
323
316
|
exitActive: "exit-active"
|
|
324
317
|
},
|
|
325
|
-
children: /* @__PURE__ */
|
|
318
|
+
children: /* @__PURE__ */ P(U, {
|
|
326
319
|
ref: this.closedIconRef,
|
|
327
|
-
children: /* @__PURE__ */
|
|
320
|
+
children: /* @__PURE__ */ P(z, { open: t }, "correct-closed")
|
|
328
321
|
})
|
|
329
|
-
})] }), /* @__PURE__ */
|
|
322
|
+
})] }), /* @__PURE__ */ P(ue, {
|
|
330
323
|
false: !0,
|
|
331
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ P(ge, {
|
|
332
325
|
"aria-hidden": !this.state.show,
|
|
333
326
|
children: t ? n : r
|
|
334
327
|
})
|
|
@@ -337,7 +330,25 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
337
330
|
})
|
|
338
331
|
});
|
|
339
332
|
}
|
|
340
|
-
}
|
|
333
|
+
};
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region ../../lib-react/drag/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js
|
|
336
|
+
function ye(e) {
|
|
337
|
+
var t, n, r = "";
|
|
338
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
339
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
340
|
+
var i = e.length;
|
|
341
|
+
for (t = 0; t < i; t++) e[t] && (n = ye(e[t])) && (r && (r += " "), r += n);
|
|
342
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
343
|
+
return r;
|
|
344
|
+
}
|
|
345
|
+
function be() {
|
|
346
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = ye(e)) && (r && (r += " "), r += t);
|
|
347
|
+
return r;
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region ../../lib-react/drag/dist/placeholder.js
|
|
351
|
+
var xe = b("div")(({ theme: e }) => ({
|
|
341
352
|
"&.placeholder": {
|
|
342
353
|
WebkitTouchCallout: "none",
|
|
343
354
|
WebkitUserSelect: "none",
|
|
@@ -347,22 +358,22 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
347
358
|
userSelect: "none",
|
|
348
359
|
width: "100%",
|
|
349
360
|
height: "100%",
|
|
350
|
-
background:
|
|
361
|
+
background: w.white(),
|
|
351
362
|
transition: "background-color 200ms linear, border-color 200ms linear",
|
|
352
363
|
boxSizing: "border-box",
|
|
353
364
|
display: "grid",
|
|
354
365
|
gridRowGap: e.spacing(1),
|
|
355
366
|
gridColumnGap: e.spacing(1),
|
|
356
367
|
padding: e.spacing(1),
|
|
357
|
-
border: `2px dashed ${
|
|
368
|
+
border: `2px dashed ${w.black()}`
|
|
358
369
|
},
|
|
359
|
-
"&.
|
|
370
|
+
"&.placeholderDisabled": {
|
|
360
371
|
boxShadow: "none",
|
|
361
|
-
background:
|
|
372
|
+
background: w.white()
|
|
362
373
|
},
|
|
363
374
|
"&.over": {
|
|
364
|
-
border: `1px solid ${
|
|
365
|
-
backgroundColor:
|
|
375
|
+
border: `1px solid ${w.border()}`,
|
|
376
|
+
backgroundColor: w.backgroundDark()
|
|
366
377
|
},
|
|
367
378
|
"&.board": {
|
|
368
379
|
padding: e.spacing(1),
|
|
@@ -373,7 +384,7 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
373
384
|
justifyContent: "center",
|
|
374
385
|
overflow: "hidden",
|
|
375
386
|
touchAction: "none",
|
|
376
|
-
backgroundColor:
|
|
387
|
+
backgroundColor: w.surface()
|
|
377
388
|
},
|
|
378
389
|
"&.categorizeBoard": {
|
|
379
390
|
padding: e.spacing(.5),
|
|
@@ -384,183 +395,189 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
|
|
|
384
395
|
justifyContent: "center",
|
|
385
396
|
overflow: "hidden",
|
|
386
397
|
touchAction: "none",
|
|
387
|
-
backgroundColor:
|
|
398
|
+
backgroundColor: w.surface()
|
|
388
399
|
},
|
|
389
400
|
"&.verticalPool": {
|
|
390
401
|
display: "flex",
|
|
391
402
|
flexFlow: "column wrap"
|
|
392
403
|
}
|
|
393
|
-
})),
|
|
394
|
-
let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: u, extraStyles: d } = e, f = (
|
|
404
|
+
})), Se = (e) => {
|
|
405
|
+
let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: u, extraStyles: d } = e, f = be("placeholder", o && "placeholderDisabled", r && "over", i, n), p = {};
|
|
395
406
|
if (a && a.columns && (p.gridTemplateColumns = `repeat(${a.columns}, 1fr)`), a && a.rows) {
|
|
396
407
|
let e = a.rowsRepeatValue || "1fr";
|
|
397
408
|
p.gridTemplateRows = `repeat(${a.rows}, ${e})`;
|
|
398
409
|
}
|
|
399
|
-
i === "choice" && (p.border = `1px solid ${
|
|
410
|
+
i === "choice" && (p.border = `1px solid ${w.borderLight()}`, p.background = w.backgroundDark());
|
|
400
411
|
let m = c ? "categorizeBoard" : "board";
|
|
401
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ P(xe, {
|
|
402
413
|
style: {
|
|
403
414
|
...p,
|
|
404
415
|
minHeight: u,
|
|
405
416
|
...d
|
|
406
417
|
},
|
|
407
|
-
className: (
|
|
418
|
+
className: be(s ? m : f, l && "verticalPool"),
|
|
408
419
|
children: t
|
|
409
420
|
});
|
|
410
421
|
};
|
|
411
|
-
|
|
412
|
-
choiceBoard:
|
|
413
|
-
grid:
|
|
414
|
-
columns:
|
|
415
|
-
rows:
|
|
416
|
-
rowsRepeatValue:
|
|
422
|
+
Se.propTypes = {
|
|
423
|
+
choiceBoard: L.default.bool,
|
|
424
|
+
grid: L.default.shape({
|
|
425
|
+
columns: L.default.number,
|
|
426
|
+
rows: L.default.number,
|
|
427
|
+
rowsRepeatValue: L.default.string
|
|
417
428
|
}),
|
|
418
|
-
children:
|
|
419
|
-
className:
|
|
420
|
-
isOver:
|
|
421
|
-
index:
|
|
422
|
-
type:
|
|
423
|
-
disabled:
|
|
424
|
-
isCategorize:
|
|
425
|
-
isVerticalPool:
|
|
426
|
-
minHeight:
|
|
429
|
+
children: L.default.oneOfType([L.default.arrayOf(L.default.node), L.default.node]).isRequired,
|
|
430
|
+
className: L.default.string,
|
|
431
|
+
isOver: L.default.bool,
|
|
432
|
+
index: L.default.number,
|
|
433
|
+
type: L.default.string,
|
|
434
|
+
disabled: L.default.bool,
|
|
435
|
+
isCategorize: L.default.bool,
|
|
436
|
+
isVerticalPool: L.default.bool,
|
|
437
|
+
minHeight: L.default.number
|
|
427
438
|
};
|
|
428
439
|
//#endregion
|
|
429
440
|
//#region src/delivery/tile.tsx
|
|
430
|
-
var
|
|
441
|
+
var Ce = (0, I.default)("pie-elements:placement-ordering:tile"), we = b("div")(({ theme: e }) => ({
|
|
431
442
|
width: "100%",
|
|
432
443
|
fontSize: e.typography.fontSize + 4,
|
|
433
444
|
textAlign: "center",
|
|
434
445
|
color: `rgba(${e.palette.common.black}, 0.6)`
|
|
435
|
-
})),
|
|
446
|
+
})), Te = ({ type: e, index: t, isOver: n, disabled: r }) => /* @__PURE__ */ P(Se, {
|
|
436
447
|
type: e,
|
|
437
448
|
isOver: n,
|
|
438
449
|
disabled: r,
|
|
439
|
-
children: e === "target" && t !== void 0 && /* @__PURE__ */
|
|
450
|
+
children: e === "target" && t !== void 0 && /* @__PURE__ */ P(we, { children: t })
|
|
440
451
|
});
|
|
441
|
-
|
|
442
|
-
type:
|
|
443
|
-
index:
|
|
444
|
-
isOver:
|
|
445
|
-
disabled:
|
|
452
|
+
Te.propTypes = {
|
|
453
|
+
type: L.default.string,
|
|
454
|
+
index: L.default.number,
|
|
455
|
+
isOver: L.default.bool,
|
|
456
|
+
disabled: L.default.bool
|
|
446
457
|
};
|
|
447
|
-
var
|
|
448
|
-
cursor:
|
|
458
|
+
var Ee = b("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: i, outcome: a, label: o, type: s }) => ({
|
|
459
|
+
cursor: i ? "not-allowed" : "grab",
|
|
449
460
|
width: "100%",
|
|
450
461
|
height: "100%",
|
|
451
462
|
padding: "10px",
|
|
452
463
|
boxSizing: "border-box",
|
|
453
464
|
overflow: "hidden",
|
|
454
|
-
border:
|
|
455
|
-
backgroundColor:
|
|
456
|
-
transition:
|
|
465
|
+
border: s === "choice" || s === "target" ? `1px solid ${w.border()}` : "1px solid transparent",
|
|
466
|
+
backgroundColor: s === "choice" || s === "target" ? w.background() : "transparent",
|
|
467
|
+
transition: s === "choice" || s === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
|
|
457
468
|
pointerEvents: "none",
|
|
458
469
|
userSelect: "none",
|
|
459
|
-
...(
|
|
460
|
-
backgroundColor:
|
|
461
|
-
borderColor:
|
|
462
|
-
transform:
|
|
470
|
+
...(s === "choice" || s === "target") && { "&:hover": {
|
|
471
|
+
backgroundColor: i ? w.background() : w.secondary(),
|
|
472
|
+
borderColor: i ? w.disabled() : e.palette.primary.main,
|
|
473
|
+
transform: i ? "none" : "scale(1.02)"
|
|
463
474
|
} },
|
|
464
|
-
...(
|
|
475
|
+
...(s === "choice" || s === "target") && r && !i && {
|
|
465
476
|
opacity: .4,
|
|
466
|
-
backgroundColor:
|
|
477
|
+
backgroundColor: w.primaryLight(),
|
|
467
478
|
borderColor: e.palette.primary.main,
|
|
468
479
|
borderStyle: "dashed",
|
|
469
480
|
transform: "scale(1.05)"
|
|
470
481
|
},
|
|
471
|
-
...(
|
|
482
|
+
...(s === "choice" || s === "target") && (t || n) && !i && {
|
|
472
483
|
opacity: .6,
|
|
473
|
-
backgroundColor:
|
|
484
|
+
backgroundColor: w.secondaryLight(),
|
|
474
485
|
transform: "scale(1.05) rotate(2deg)",
|
|
475
486
|
boxShadow: "0 8px 16px rgba(0,0,0,0.2)",
|
|
476
487
|
cursor: "grabbing"
|
|
477
488
|
},
|
|
478
|
-
...(
|
|
489
|
+
...(s === "choice" || s === "target") && i && {
|
|
479
490
|
cursor: "not-allowed",
|
|
480
491
|
"&:hover": {
|
|
481
|
-
backgroundColor:
|
|
492
|
+
backgroundColor: w.background(),
|
|
482
493
|
transform: "none"
|
|
483
494
|
}
|
|
484
495
|
},
|
|
485
|
-
...(
|
|
486
|
-
...(
|
|
487
|
-
...!
|
|
496
|
+
...(s === "choice" || s === "target") && a === "incorrect" && { border: `1px solid ${w.incorrect()}` },
|
|
497
|
+
...(s === "choice" || s === "target") && a === "correct" && { border: `1px solid ${w.correct()}` },
|
|
498
|
+
...!o && {
|
|
488
499
|
border: "none",
|
|
489
500
|
"&:hover": { backgroundColor: "unset" }
|
|
490
501
|
}
|
|
491
|
-
})),
|
|
492
|
-
let { type: t, isDragging: n,
|
|
493
|
-
return
|
|
502
|
+
})), De = (e) => {
|
|
503
|
+
let { type: t, isDragging: n, isSelected: r, empty: i, isOver: a, label: o, disabled: s, outcome: c, guideIndex: l } = e;
|
|
504
|
+
return i ? /* @__PURE__ */ P(Te, {
|
|
494
505
|
type: t,
|
|
495
|
-
index:
|
|
496
|
-
isOver:
|
|
497
|
-
disabled:
|
|
498
|
-
}) : /* @__PURE__ */
|
|
506
|
+
index: l,
|
|
507
|
+
isOver: a,
|
|
508
|
+
disabled: s
|
|
509
|
+
}) : /* @__PURE__ */ P(Ee, {
|
|
499
510
|
type: t,
|
|
500
511
|
isDragging: n,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
512
|
+
isSelected: r,
|
|
513
|
+
isOver: a,
|
|
514
|
+
disabled: s,
|
|
515
|
+
outcome: c,
|
|
516
|
+
label: o,
|
|
517
|
+
dangerouslySetInnerHTML: { __html: o }
|
|
506
518
|
});
|
|
507
519
|
}, W = (e) => {
|
|
508
|
-
let { label: t, type: n, id: r, empty: i, disabled: a, outcome: o, index: s, guideIndex: c, instanceId: l, draggable: u, tileIndex: d } = e,
|
|
509
|
-
id:
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
520
|
+
let { label: t, type: n, id: r, empty: i, disabled: a, outcome: o, index: s, guideIndex: c, instanceId: l, draggable: u, tileIndex: d, selectedChoice: f, onChoiceClick: p, onPlacementClick: m } = e, h = `tile-${n}-${r ?? "empty"}-${d}-${l}`, v = `drop-${n}-${r ?? "empty"}-${d}-${l}`, y = {
|
|
521
|
+
id: r,
|
|
522
|
+
type: n,
|
|
523
|
+
instanceId: l,
|
|
524
|
+
value: t,
|
|
525
|
+
index: s
|
|
526
|
+
}, { attributes: b, listeners: x, setNodeRef: S, transform: C, isDragging: w } = g({
|
|
527
|
+
id: h,
|
|
528
|
+
data: y,
|
|
517
529
|
disabled: !u || a
|
|
518
|
-
}), { setNodeRef:
|
|
519
|
-
id:
|
|
520
|
-
data:
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
disabled: v
|
|
528
|
-
}), x = k.useRef(null);
|
|
530
|
+
}), { setNodeRef: ee, isOver: T } = _({
|
|
531
|
+
id: v,
|
|
532
|
+
data: y,
|
|
533
|
+
disabled: w
|
|
534
|
+
}), E = !!f && f.type === y.type && f.id === y.id && f.index === y.index, [D, O] = k.useState(!1), A = !!f && !a, j = T || n === "target" && A && D, M = () => {
|
|
535
|
+
a || (n === "choice" ? f?.type === "target" ? m?.(y) : u && p?.(y) : n === "target" && (E ? p?.(y) : f ? m?.(y) : u && p?.(y)));
|
|
536
|
+
}, N = !(u && !a) && !a, F = (e) => {
|
|
537
|
+
(e.code === "Space" || e.code === "Enter") && (e.preventDefault(), M());
|
|
538
|
+
}, I = k.useRef(null);
|
|
529
539
|
return k.useEffect(() => {
|
|
530
|
-
let e =
|
|
540
|
+
let e = I.current, t = (e) => {
|
|
531
541
|
e.preventDefault();
|
|
532
542
|
};
|
|
533
543
|
return e && e.addEventListener("touchstart", t, { passive: !1 }), () => {
|
|
534
544
|
e && e.removeEventListener("touchstart", t);
|
|
535
545
|
};
|
|
536
|
-
}, []),
|
|
546
|
+
}, []), Ce("[render], props: ", e), /* @__PURE__ */ P("div", {
|
|
537
547
|
ref: (e) => {
|
|
538
|
-
|
|
548
|
+
I.current = e, S(e), ee(e);
|
|
539
549
|
},
|
|
540
550
|
style: {
|
|
541
|
-
transform:
|
|
551
|
+
transform: C ? `translate3d(${C.x}px, ${C.y}px, 0)` : void 0,
|
|
542
552
|
boxSizing: "border-box",
|
|
543
553
|
overflow: "visible",
|
|
544
554
|
padding: 0,
|
|
545
555
|
margin: 0,
|
|
546
556
|
textAlign: "center",
|
|
547
557
|
pointerEvents: "auto",
|
|
548
|
-
cursor: a ? "not-allowed" :
|
|
549
|
-
zIndex:
|
|
550
|
-
willChange:
|
|
558
|
+
cursor: a ? "not-allowed" : n === "target" && A ? "pointer" : w ? "grabbing" : "grab",
|
|
559
|
+
zIndex: w ? 1e3 : "auto",
|
|
560
|
+
willChange: w ? "transform" : "auto"
|
|
551
561
|
},
|
|
562
|
+
role: N ? "button" : void 0,
|
|
563
|
+
tabIndex: N ? 0 : void 0,
|
|
564
|
+
onKeyDown: N ? F : void 0,
|
|
565
|
+
onClick: M,
|
|
566
|
+
onMouseEnter: () => O(!0),
|
|
567
|
+
onMouseLeave: () => O(!1),
|
|
552
568
|
...u && !a ? {
|
|
553
|
-
...
|
|
554
|
-
...
|
|
569
|
+
...x,
|
|
570
|
+
...b
|
|
555
571
|
} : {},
|
|
556
|
-
children: /* @__PURE__ */
|
|
572
|
+
children: /* @__PURE__ */ P(De, {
|
|
557
573
|
label: t,
|
|
558
574
|
id: r,
|
|
559
575
|
empty: i,
|
|
560
576
|
index: s,
|
|
561
577
|
guideIndex: c,
|
|
562
|
-
isOver:
|
|
563
|
-
isDragging:
|
|
578
|
+
isOver: j,
|
|
579
|
+
isDragging: w,
|
|
580
|
+
isSelected: E,
|
|
564
581
|
disabled: a,
|
|
565
582
|
outcome: o,
|
|
566
583
|
type: n
|
|
@@ -568,125 +585,131 @@ var Ie = C("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i
|
|
|
568
585
|
});
|
|
569
586
|
};
|
|
570
587
|
W.propTypes = {
|
|
571
|
-
id:
|
|
572
|
-
label:
|
|
573
|
-
isOver:
|
|
574
|
-
type:
|
|
575
|
-
empty:
|
|
576
|
-
disabled:
|
|
577
|
-
outcome:
|
|
578
|
-
index:
|
|
579
|
-
guideIndex:
|
|
580
|
-
instanceId:
|
|
581
|
-
draggable:
|
|
582
|
-
tileIndex:
|
|
588
|
+
id: L.default.any,
|
|
589
|
+
label: L.default.string,
|
|
590
|
+
isOver: L.default.bool,
|
|
591
|
+
type: L.default.string,
|
|
592
|
+
empty: L.default.bool,
|
|
593
|
+
disabled: L.default.bool,
|
|
594
|
+
outcome: L.default.string,
|
|
595
|
+
index: L.default.number,
|
|
596
|
+
guideIndex: L.default.number,
|
|
597
|
+
instanceId: L.default.any,
|
|
598
|
+
draggable: L.default.bool,
|
|
599
|
+
tileIndex: L.default.number,
|
|
600
|
+
selectedChoice: L.default.object,
|
|
601
|
+
onChoiceClick: L.default.func,
|
|
602
|
+
onPlacementClick: L.default.func
|
|
583
603
|
};
|
|
584
604
|
//#endregion
|
|
585
605
|
//#region src/delivery/tiler.tsx
|
|
586
606
|
var G = {
|
|
587
|
-
choiceLabel:
|
|
588
|
-
targetLabel:
|
|
589
|
-
disabled:
|
|
590
|
-
tiles:
|
|
591
|
-
tileSize:
|
|
592
|
-
addGuide:
|
|
593
|
-
|
|
607
|
+
choiceLabel: L.default.string,
|
|
608
|
+
targetLabel: L.default.string,
|
|
609
|
+
disabled: L.default.bool,
|
|
610
|
+
tiles: L.default.array.isRequired,
|
|
611
|
+
tileSize: L.default.string,
|
|
612
|
+
addGuide: L.default.bool,
|
|
613
|
+
selectedChoice: L.default.object,
|
|
614
|
+
onChoiceClick: L.default.func,
|
|
615
|
+
onPlacementClick: L.default.func
|
|
616
|
+
}, Oe = {
|
|
594
617
|
tileSize: "1fr",
|
|
595
618
|
disabled: !1,
|
|
596
619
|
addGuide: !1
|
|
597
|
-
},
|
|
598
|
-
let t = (t, n) => (t.instanceId = e.instanceId, t.disabled = e.disabled, t.guideIndex = e.addGuide ? t.index + 1 : void 0, t.tileIndex = n, e.includeTargets || t.type === "choice" ? /* @__PURE__ */
|
|
620
|
+
}, ke = (e) => {
|
|
621
|
+
let t = (t, n) => (t.instanceId = e.instanceId, t.disabled = e.disabled, t.guideIndex = e.addGuide ? t.index + 1 : void 0, t.tileIndex = n, t.selectedChoice = e.selectedChoice, t.onChoiceClick = e.onChoiceClick, t.onPlacementClick = e.onPlacementClick, e.includeTargets || t.type === "choice" ? /* @__PURE__ */ A(W, {
|
|
599
622
|
...t,
|
|
600
623
|
key: n
|
|
601
|
-
}) : /* @__PURE__ */
|
|
624
|
+
}) : /* @__PURE__ */ A(W, {
|
|
602
625
|
...t,
|
|
603
626
|
label: "",
|
|
604
627
|
key: n
|
|
605
628
|
}));
|
|
606
629
|
return t.propTypes = { ...G }, t;
|
|
607
|
-
},
|
|
630
|
+
}, Ae = b("div")(({ theme: e, includeTargets: t }) => ({
|
|
608
631
|
display: "grid",
|
|
609
632
|
paddingBottom: e.spacing(2),
|
|
610
633
|
...t && { gridGap: "10px" }
|
|
611
|
-
})),
|
|
634
|
+
})), je = b("div")({ textAlign: "center" }), Me = b("div")({
|
|
612
635
|
textAlign: "center",
|
|
613
636
|
gridRow: "3/4"
|
|
614
|
-
}),
|
|
637
|
+
}), Ne = b("div")(({ includeTargets: e }) => ({
|
|
615
638
|
gridAutoFlow: "column",
|
|
616
639
|
display: "grid",
|
|
617
640
|
...e && { gridGap: "10px" }
|
|
618
|
-
})),
|
|
641
|
+
})), Pe = b("div")({
|
|
619
642
|
gridColumn: "1/2",
|
|
620
643
|
textAlign: "center"
|
|
621
|
-
}),
|
|
644
|
+
}), Fe = b("div")({
|
|
622
645
|
gridColumn: "2/3",
|
|
623
646
|
textAlign: "center"
|
|
624
|
-
}),
|
|
647
|
+
}), Ie = class extends k.Component {
|
|
625
648
|
static propTypes = { ...G };
|
|
626
|
-
static defaultProps = { ...
|
|
649
|
+
static defaultProps = { ...Oe };
|
|
627
650
|
render() {
|
|
628
651
|
let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: a } = this.props, o = e ? `auto ${a} auto ${a}` : `auto ${a} auto`, s = e ? i.length / 2 : i.length, c = {
|
|
629
652
|
gridTemplateColumns: e ? `repeat(${s}, ${a})` : `auto repeat(${Math.floor(s / 2) - 1}, ${a} 10px) ${a} auto`,
|
|
630
653
|
gridTemplateRows: o
|
|
631
654
|
}, l = { gridColumn: `1/${s + 1}` };
|
|
632
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ F(Ae, {
|
|
633
656
|
includeTargets: e,
|
|
634
657
|
style: c,
|
|
635
658
|
children: [
|
|
636
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ P(je, {
|
|
637
660
|
style: l,
|
|
638
661
|
dangerouslySetInnerHTML: { __html: t ? n : "" }
|
|
639
662
|
}),
|
|
640
|
-
e && /* @__PURE__ */
|
|
663
|
+
e && /* @__PURE__ */ P(Me, {
|
|
641
664
|
style: l,
|
|
642
665
|
dangerouslySetInnerHTML: { __html: r }
|
|
643
666
|
}),
|
|
644
|
-
i.map(
|
|
667
|
+
i.map(ke(this.props))
|
|
645
668
|
]
|
|
646
669
|
});
|
|
647
670
|
}
|
|
648
|
-
},
|
|
671
|
+
}, Le = class extends k.Component {
|
|
649
672
|
static propTypes = { ...G };
|
|
650
|
-
static defaultProps = { ...
|
|
673
|
+
static defaultProps = { ...Oe };
|
|
651
674
|
render() {
|
|
652
675
|
let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: a } = this.props, o = e ? 2 : 1, s = e ? i.length / 2 : i.length;
|
|
653
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ F(Ne, {
|
|
654
677
|
includeTargets: e,
|
|
655
678
|
style: {
|
|
656
679
|
gridTemplateColumns: `repeat(${o}, ${a})`,
|
|
657
680
|
gridTemplateRows: e ? `auto repeat(${s}, ${a})` : `auto auto repeat(${Math.floor(s / 2) - 1}, ${a} 10px) ${a} auto`
|
|
658
681
|
},
|
|
659
682
|
children: [
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
e && /* @__PURE__ */
|
|
662
|
-
i.map(
|
|
683
|
+
/* @__PURE__ */ P(Pe, { dangerouslySetInnerHTML: { __html: t ? n : "" } }),
|
|
684
|
+
e && /* @__PURE__ */ P(Fe, { dangerouslySetInnerHTML: { __html: r } }),
|
|
685
|
+
i.map(ke(this.props))
|
|
663
686
|
]
|
|
664
687
|
});
|
|
665
688
|
}
|
|
666
|
-
}, K = (0,
|
|
689
|
+
}, K = (0, I.default)("pie-elements:placement-ordering:ordering"), Re = (e, t, n) => {
|
|
667
690
|
let r = e.find((e, n) => n === t), i = e.filter((e, n) => n !== t);
|
|
668
691
|
return [
|
|
669
692
|
...i.slice(0, n),
|
|
670
693
|
r,
|
|
671
694
|
...i.slice(n)
|
|
672
695
|
];
|
|
673
|
-
},
|
|
674
|
-
if (K("[swap]", e,
|
|
675
|
-
let
|
|
676
|
-
return r
|
|
696
|
+
}, ze = (e, n, r) => {
|
|
697
|
+
if (K("[swap]", e, n, r), !e || e.length <= 1 || n === void 0 || r === void 0) throw Error(`swap requires a non-empty array, fromIndex, toIndex: ${e}, ${n} ${r}`);
|
|
698
|
+
let i = t(e), a = e[r];
|
|
699
|
+
return i[r] = i[n], i[n] = a, i;
|
|
677
700
|
};
|
|
678
|
-
function
|
|
679
|
-
let
|
|
680
|
-
if (n
|
|
681
|
-
else throw Error(`Tried to remove from index: ${
|
|
682
|
-
return
|
|
701
|
+
function Be(e, n) {
|
|
702
|
+
let r = t(e.response);
|
|
703
|
+
if (r[n.index] === n.id) r[n.index] = void 0;
|
|
704
|
+
else throw Error(`Tried to remove from index: ${n.index}, but the id doesn't match: array: ${r}, target: ${n.id}`);
|
|
705
|
+
return r;
|
|
683
706
|
}
|
|
684
|
-
function
|
|
685
|
-
let { response:
|
|
686
|
-
if (
|
|
707
|
+
function Ve(e, n, r) {
|
|
708
|
+
let { response: i, opts: a } = e, o = t(i);
|
|
709
|
+
if (a.includeTargets) return n.type === "choice" && r.type === "target" ? (o[r.index] = n.id, o) : n.type === "target" && r.type === "choice" ? (o[n.index] = void 0, o) : n.type === "target" && r.type === "target" ? ze(i, n.index, r.index) : (K("do nothing to the response"), i);
|
|
687
710
|
{
|
|
688
|
-
let
|
|
689
|
-
return K("fromIndex: ",
|
|
711
|
+
let t = e.response.findIndex((e) => e !== void 0 && e === n.id), i = e.response.findIndex((e) => e !== void 0 && e === r.id);
|
|
712
|
+
return K("fromIndex: ", t, "toIndex:", i), Re(e.response, t, i);
|
|
690
713
|
}
|
|
691
714
|
}
|
|
692
715
|
function q(e, t, n, r) {
|
|
@@ -702,6 +725,7 @@ function q(e, t, n, r) {
|
|
|
702
725
|
}
|
|
703
726
|
return e.map((e) => t.indexOf(e.id) !== -1 && !r.allowSameChoiceInTargets ? {
|
|
704
727
|
type: "choice",
|
|
728
|
+
id: e.id,
|
|
705
729
|
empty: !0,
|
|
706
730
|
droppable: !0,
|
|
707
731
|
draggable: !1
|
|
@@ -723,26 +747,26 @@ function q(e, t, n, r) {
|
|
|
723
747
|
return i === 0 && t.push(a), t.push(o, a), t;
|
|
724
748
|
}, []);
|
|
725
749
|
}
|
|
726
|
-
function
|
|
727
|
-
return
|
|
750
|
+
function He(e, t, r, i) {
|
|
751
|
+
return i = n({ includeTargets: !0 }, i), r ||= [], t = !t || a(t) ? i.includeTargets ? Array(e.length) : c(e, (e) => e.id) : t, {
|
|
728
752
|
choices: e,
|
|
729
753
|
response: t,
|
|
730
|
-
opts:
|
|
731
|
-
outcomes:
|
|
732
|
-
tiles: q(e, t,
|
|
754
|
+
opts: i,
|
|
755
|
+
outcomes: r,
|
|
756
|
+
tiles: q(e, t, r, i)
|
|
733
757
|
};
|
|
734
758
|
}
|
|
735
|
-
function
|
|
759
|
+
function Ue(e, t) {
|
|
736
760
|
switch (e.type) {
|
|
737
761
|
case "move": {
|
|
738
|
-
let { from: n, to: r } = e, i =
|
|
762
|
+
let { from: n, to: r } = e, i = Ve(t, n, r), a = q(t.choices, i, t.outcomes, t.opts);
|
|
739
763
|
return Object.assign({}, t, {
|
|
740
764
|
response: i,
|
|
741
765
|
tiles: a
|
|
742
766
|
});
|
|
743
767
|
}
|
|
744
768
|
case "remove": {
|
|
745
|
-
let { target: n } = e, r =
|
|
769
|
+
let { target: n } = e, r = Be(t, n), i = q(t.choices, r, t.outcomes, t.opts);
|
|
746
770
|
return Object.assign({}, t, {
|
|
747
771
|
response: r,
|
|
748
772
|
tiles: i
|
|
@@ -753,11 +777,57 @@ function $e(e, t) {
|
|
|
753
777
|
}
|
|
754
778
|
//#endregion
|
|
755
779
|
//#region src/delivery/utils.ts
|
|
756
|
-
var
|
|
780
|
+
var We = (e, t) => {
|
|
757
781
|
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) return !1;
|
|
758
782
|
let n = (e) => e.map((e) => JSON.stringify(e)).sort(), r = n(e), i = n(t), a = r.every((e, t) => e === i[t]), o = e.every((e, n) => JSON.stringify(e) === JSON.stringify(t[n]));
|
|
759
783
|
return a && !o;
|
|
760
|
-
}
|
|
784
|
+
}, Ge = (e, { active: t, context: n, currentCoordinates: r }) => {
|
|
785
|
+
let { code: i } = e, a = i === "Tab", o = i === h.Down || i === h.Up || i === h.Left || i === h.Right;
|
|
786
|
+
if (!a && !o) return;
|
|
787
|
+
if (o) return y(e, {
|
|
788
|
+
context: n,
|
|
789
|
+
currentCoordinates: r
|
|
790
|
+
});
|
|
791
|
+
e.preventDefault();
|
|
792
|
+
let { droppableRects: s, droppableContainers: c, collisionRect: l, draggableNodes: u, active: d } = n;
|
|
793
|
+
if (!s || s.size === 0) return r;
|
|
794
|
+
let f = {
|
|
795
|
+
x: (l?.width || 0) / 2,
|
|
796
|
+
y: (l?.height || 0) / 2
|
|
797
|
+
}, p = {
|
|
798
|
+
x: r.x + f.x,
|
|
799
|
+
y: r.y + f.y
|
|
800
|
+
}, m = u?.get(t)?.data?.current?.id, g = d?.rect?.current?.initial, _ = typeof t == "string" ? t.replace(/^tile-/, "drop-") : void 0, v = [], b;
|
|
801
|
+
for (let [e, t] of c) {
|
|
802
|
+
let n = t?.data?.current, r = e === _;
|
|
803
|
+
if (t?.disabled && !r) continue;
|
|
804
|
+
let i = n?.type === "choice" && n?.id === m;
|
|
805
|
+
if (n?.type === "choice" && !i) continue;
|
|
806
|
+
let a = (r ? g : null) || s.get(e);
|
|
807
|
+
if (!a) continue;
|
|
808
|
+
let o = {
|
|
809
|
+
x: a.left + a.width / 2,
|
|
810
|
+
y: a.top + a.height / 2
|
|
811
|
+
}, c = {
|
|
812
|
+
id: e,
|
|
813
|
+
dropPosition: {
|
|
814
|
+
x: a.left,
|
|
815
|
+
y: a.top + a.height / 2 - f.y
|
|
816
|
+
},
|
|
817
|
+
center: o
|
|
818
|
+
};
|
|
819
|
+
i ? b = c : v.push(c);
|
|
820
|
+
}
|
|
821
|
+
if (v.length === 0 && !b) return r;
|
|
822
|
+
let x = e.shiftKey;
|
|
823
|
+
v.sort((e, t) => Math.abs(e.center.y - t.center.y) > 10 ? e.center.y - t.center.y : e.center.x - t.center.x), b && v.push(b);
|
|
824
|
+
let S = 0, C = Infinity;
|
|
825
|
+
for (let e = 0; e < v.length; e++) {
|
|
826
|
+
let t = Ke(p, v[e].center);
|
|
827
|
+
t < C && (C = t, S = e);
|
|
828
|
+
}
|
|
829
|
+
return v[x ? (S - 1 + v.length) % v.length : (S + 1) % v.length].dropPosition;
|
|
830
|
+
}, Ke = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
761
831
|
//#endregion
|
|
762
832
|
//#region src/delivery/placement-ordering.tsx
|
|
763
833
|
function J(e) {
|
|
@@ -766,71 +836,95 @@ function J(e) {
|
|
|
766
836
|
function Y(e, t) {
|
|
767
837
|
return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
|
|
768
838
|
}
|
|
769
|
-
var
|
|
770
|
-
|
|
771
|
-
|
|
839
|
+
var qe = Y(D, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(T, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), Je = Y(p, "Feedback") || Y(Q.Feedback, "Feedback"), Ye = Y(f, "Collapsible") || Y(Q.Collapsible, "Collapsible"), Xe = x, Z = Xe.default, Q = Z && typeof Z == "object" ? Z : Xe, Ze = 250, Qe = (e, t) => {
|
|
840
|
+
if (!e || !t) return !1;
|
|
841
|
+
let n = t.left + t.width / 2, r = t.top + t.height / 2;
|
|
842
|
+
return n >= e.left && n <= e.right && r >= e.top && r <= e.bottom;
|
|
843
|
+
}, $e = (e) => e ? {
|
|
844
|
+
keyboardCoordinateGetter: Ge,
|
|
845
|
+
keyboardCodes: {
|
|
846
|
+
start: ["Space", "Enter"],
|
|
847
|
+
cancel: ["Escape"],
|
|
848
|
+
end: ["Space", "Enter"]
|
|
849
|
+
},
|
|
850
|
+
accessibility: { screenReaderInstructions: { draggable: "Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel." } }
|
|
851
|
+
} : {}, { translator: et } = O, tt = (0, I.default)("pie-elements:placement-ordering"), nt = b("div")({
|
|
852
|
+
color: w.text(),
|
|
853
|
+
backgroundColor: w.background(),
|
|
772
854
|
display: "flex",
|
|
773
855
|
flexDirection: "column",
|
|
774
856
|
alignItems: "center",
|
|
775
857
|
boxSizing: "border-box"
|
|
776
|
-
}),
|
|
858
|
+
}), rt = b("div")({
|
|
859
|
+
alignSelf: "stretch",
|
|
860
|
+
maxWidth: "100%",
|
|
861
|
+
overflowX: "auto",
|
|
862
|
+
overflowY: "hidden"
|
|
863
|
+
}), it = b("div")({
|
|
864
|
+
display: "flex",
|
|
865
|
+
justifyContent: "center",
|
|
866
|
+
minWidth: "min-content"
|
|
867
|
+
}), at = b("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), ot = b("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), st = b(ve)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), ct = b(Ye)(({ theme: e }) => ({
|
|
777
868
|
marginBottom: e.spacing(2),
|
|
778
869
|
alignSelf: "flex-start"
|
|
779
|
-
})),
|
|
870
|
+
})), lt = (e) => {
|
|
780
871
|
let { tiler: t, ordering: n, onDropChoice: r, onRemoveChoice: i, ...a } = e;
|
|
781
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ P(t, {
|
|
782
873
|
...a,
|
|
783
874
|
tiles: n.tiles,
|
|
784
875
|
onDropChoice: (e, t) => r(e, t, n),
|
|
785
876
|
onRemoveChoice: (e) => i(e, n)
|
|
786
877
|
});
|
|
787
878
|
};
|
|
788
|
-
|
|
789
|
-
tiler:
|
|
790
|
-
ordering:
|
|
791
|
-
onDropChoice:
|
|
792
|
-
onRemoveChoice:
|
|
879
|
+
lt.propTypes = {
|
|
880
|
+
tiler: L.default.func,
|
|
881
|
+
ordering: L.default.any,
|
|
882
|
+
onDropChoice: L.default.func,
|
|
883
|
+
onRemoveChoice: L.default.func
|
|
793
884
|
};
|
|
794
|
-
var
|
|
885
|
+
var ut = class extends k.Component {
|
|
795
886
|
static propTypes = {
|
|
796
|
-
onSessionChange:
|
|
797
|
-
model:
|
|
798
|
-
session:
|
|
887
|
+
onSessionChange: L.default.func.isRequired,
|
|
888
|
+
model: L.default.object.isRequired,
|
|
889
|
+
session: L.default.oneOfType([L.default.array.isRequired, L.default.object.isRequired])
|
|
799
890
|
};
|
|
800
891
|
constructor(e) {
|
|
801
|
-
super(e), this.instanceId =
|
|
892
|
+
super(e), this.instanceId = r();
|
|
802
893
|
let { value: t, needsReset: n } = this.validateSession(e);
|
|
803
|
-
this.state = {
|
|
804
|
-
|
|
805
|
-
|
|
894
|
+
this.state = {
|
|
895
|
+
showingCorrect: !1,
|
|
896
|
+
selectedChoice: null
|
|
897
|
+
}, this.lastDragEndAt = 0;
|
|
898
|
+
let { model: i } = e || {}, { env: a } = i || {}, { mode: o } = a || {};
|
|
899
|
+
n && o === "gather" && this.props.onSessionChange({
|
|
806
900
|
...e.session,
|
|
807
901
|
value: t
|
|
808
902
|
});
|
|
809
903
|
}
|
|
810
904
|
toggleCorrect = (e) => this.setState({ showingCorrect: e });
|
|
811
905
|
componentDidUpdate() {
|
|
812
|
-
|
|
906
|
+
d(N.findDOMNode(this));
|
|
813
907
|
}
|
|
814
908
|
validateSession = ({ model: e, session: t }, n = !1) => {
|
|
815
|
-
let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, s = i.map((e) => e.id), { value: c } = t || {},
|
|
816
|
-
if (a) c && c.length !== s.length && (
|
|
909
|
+
let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, s = i.map((e) => e.id), { value: c } = t || {}, u;
|
|
910
|
+
if (a) c && c.length !== s.length && (u = !0, c = c.length < s.length ? c.concat(Array(s.length - c.length)) : c.filter((e) => s.includes(e)));
|
|
817
911
|
else {
|
|
818
912
|
if (!c || !c.length || n) c = s;
|
|
819
913
|
else {
|
|
820
|
-
let e =
|
|
914
|
+
let e = l(s, c), t = l(c, s);
|
|
821
915
|
(e.length || t.length) && (c = s);
|
|
822
916
|
}
|
|
823
|
-
|
|
917
|
+
u = !o(t.value, c);
|
|
824
918
|
}
|
|
825
|
-
return
|
|
919
|
+
return u && console.warn("This session is not valid anymore. It will be reset."), {
|
|
826
920
|
value: c,
|
|
827
|
-
needsReset:
|
|
921
|
+
needsReset: u
|
|
828
922
|
};
|
|
829
923
|
};
|
|
830
924
|
UNSAFE_componentWillReceiveProps(e) {
|
|
831
|
-
let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: i, choices: a = [], env: o } = t, { includeTargets: s } = i || {}, c = {}, l = n.language && n.language !== t.language, u = n.note && n.note ===
|
|
832
|
-
l && u && (n.note =
|
|
833
|
-
let d =
|
|
925
|
+
let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: i, choices: a = [], env: o } = t, { includeTargets: s } = i || {}, c = {}, l = n.language && n.language !== t.language, u = n.note && n.note === et.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
|
|
926
|
+
l && u && (n.note = et.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (c.showingCorrect = !1);
|
|
927
|
+
let d = We(a, n.choices), { value: f, needsReset: p } = this.validateSession(e, d), m = {
|
|
834
928
|
...e.session,
|
|
835
929
|
value: f
|
|
836
930
|
}, h = n.config?.includeTargets !== s;
|
|
@@ -841,8 +935,8 @@ var pt = class extends k.Component {
|
|
|
841
935
|
}
|
|
842
936
|
onDropChoice = (e, t, n) => {
|
|
843
937
|
let { onSessionChange: r, session: i } = this.props, a = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), o = e;
|
|
844
|
-
|
|
845
|
-
let s =
|
|
938
|
+
tt("[onDropChoice] ", a, o);
|
|
939
|
+
let s = Ue({
|
|
846
940
|
type: "move",
|
|
847
941
|
from: a,
|
|
848
942
|
to: o
|
|
@@ -851,8 +945,8 @@ var pt = class extends k.Component {
|
|
|
851
945
|
};
|
|
852
946
|
onRemoveChoice = (e, t) => {
|
|
853
947
|
let { onSessionChange: n, session: r } = this.props;
|
|
854
|
-
|
|
855
|
-
let i =
|
|
948
|
+
tt("[onRemoveChoice]", e);
|
|
949
|
+
let i = Ue({
|
|
856
950
|
type: "remove",
|
|
857
951
|
target: e
|
|
858
952
|
}, t);
|
|
@@ -863,20 +957,20 @@ var pt = class extends k.Component {
|
|
|
863
957
|
orientation: "vertical",
|
|
864
958
|
includeTargets: !0
|
|
865
959
|
};
|
|
866
|
-
return n ?
|
|
960
|
+
return n ? He(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
|
|
867
961
|
id: e,
|
|
868
962
|
outcome: "correct"
|
|
869
963
|
})), {
|
|
870
964
|
includeTargets: r,
|
|
871
965
|
allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
|
|
872
|
-
}) :
|
|
966
|
+
}) : He(e.choices, t.value, e.outcomes, {
|
|
873
967
|
includeTargets: r,
|
|
874
968
|
allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
|
|
875
969
|
});
|
|
876
970
|
};
|
|
877
971
|
onDragEnd = (e) => {
|
|
878
972
|
let { over: t, active: n } = e, r = this.createOrdering();
|
|
879
|
-
if (t && n) {
|
|
973
|
+
if (this.cancelSelection(), this.lastDragEndAt = Date.now(), t && n) {
|
|
880
974
|
let e = n.data.current, i = t.data.current;
|
|
881
975
|
if (e && i && i.type === "target") {
|
|
882
976
|
this.onDropChoice(i, e, r);
|
|
@@ -884,67 +978,113 @@ var pt = class extends k.Component {
|
|
|
884
978
|
}
|
|
885
979
|
e && i && this.onDropChoice(i, e, r);
|
|
886
980
|
} else if (!t && n) {
|
|
887
|
-
let e = n.data.current;
|
|
888
|
-
e && e.type === "target" && this.onRemoveChoice(e, r);
|
|
981
|
+
let e = n.data.current, t = Qe(n.rect?.current?.initial, n.rect?.current?.translated);
|
|
982
|
+
e && e.type === "target" && !t && this.onRemoveChoice(e, r);
|
|
889
983
|
}
|
|
890
984
|
};
|
|
985
|
+
onDragStart = (e) => {
|
|
986
|
+
let { active: t } = e;
|
|
987
|
+
t?.data?.current && this.selectChoice(t.data.current);
|
|
988
|
+
};
|
|
989
|
+
onDragCancel = () => {
|
|
990
|
+
this.cancelSelection(), this.lastDragEndAt = Date.now();
|
|
991
|
+
};
|
|
992
|
+
isSameChoice = (e, t) => !!e && !!t && e.type === t.type && e.id === t.id && e.index === t.index;
|
|
993
|
+
selectChoice = (e) => {
|
|
994
|
+
this.setState({ selectedChoice: e });
|
|
995
|
+
};
|
|
996
|
+
toggleChoiceSelection = (e) => {
|
|
997
|
+
this.setState((t) => ({ selectedChoice: this.isSameChoice(t.selectedChoice, e) ? null : e }));
|
|
998
|
+
};
|
|
999
|
+
cancelSelection = () => {
|
|
1000
|
+
this.setState({ selectedChoice: null });
|
|
1001
|
+
};
|
|
1002
|
+
endAnyLiveKeyboardDrag = () => {
|
|
1003
|
+
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
1004
|
+
code: "Escape",
|
|
1005
|
+
bubbles: !0,
|
|
1006
|
+
cancelable: !0
|
|
1007
|
+
}));
|
|
1008
|
+
};
|
|
1009
|
+
placeSelectedChoice = (e) => {
|
|
1010
|
+
let { selectedChoice: t } = this.state;
|
|
1011
|
+
if (!t) return;
|
|
1012
|
+
let n = this.createOrdering();
|
|
1013
|
+
this.onDropChoice(e, t, n), this.cancelSelection(), this.endAnyLiveKeyboardDrag(), this.lastDragEndAt = Date.now();
|
|
1014
|
+
};
|
|
1015
|
+
isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < Ze;
|
|
1016
|
+
onChoiceClick = (e) => {
|
|
1017
|
+
this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
|
|
1018
|
+
};
|
|
1019
|
+
onPlacementClick = (e) => {
|
|
1020
|
+
this.isClickSoonAfterDragEnd() || this.placeSelectedChoice(e);
|
|
1021
|
+
};
|
|
891
1022
|
render() {
|
|
892
|
-
let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: r, prompt: i, rationale: a, feedback: o, config: s, note: c, showNote: l, env: u, disabled: d, teacherInstructions: f, language: p } = e,
|
|
1023
|
+
let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: r, prompt: i, rationale: a, feedback: o, config: s, note: c, showNote: l, env: u, disabled: d, teacherInstructions: f, language: p } = e, h = t && t.length > 0, { showingCorrect: g } = this.state, _ = s || {
|
|
893
1024
|
orientation: "vertical",
|
|
894
1025
|
includeTargets: !0
|
|
895
|
-
}, { orientation:
|
|
896
|
-
color:
|
|
897
|
-
backgroundColor:
|
|
1026
|
+
}, { orientation: v, includeTargets: y } = _, b = v === "vertical", x = this.createOrdering(), { mode: S, role: T } = u || {}, D = b ? Le : Ie, O = (g || S === "view" && T === "instructor") && l && c, k = a && (m(a) || C(a)), A = f && (m(f) || C(f)), j = {
|
|
1027
|
+
color: w.text(),
|
|
1028
|
+
backgroundColor: w.background(),
|
|
898
1029
|
display: "flex",
|
|
899
1030
|
flexDirection: "column",
|
|
900
1031
|
alignItems: "center",
|
|
901
|
-
boxSizing: "border-box"
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1032
|
+
boxSizing: "border-box",
|
|
1033
|
+
width: "100%"
|
|
1034
|
+
}, M = y ? {
|
|
1035
|
+
selectedChoice: this.state.selectedChoice,
|
|
1036
|
+
onChoiceClick: this.onChoiceClick,
|
|
1037
|
+
onPlacementClick: this.onPlacementClick
|
|
1038
|
+
} : {};
|
|
1039
|
+
return /* @__PURE__ */ P(ee, {
|
|
1040
|
+
onDragStart: this.onDragStart,
|
|
905
1041
|
onDragEnd: this.onDragEnd,
|
|
906
|
-
|
|
907
|
-
|
|
1042
|
+
onDragCancel: this.onDragCancel,
|
|
1043
|
+
collisionDetection: E,
|
|
1044
|
+
modifiers: [re],
|
|
1045
|
+
...$e(y),
|
|
1046
|
+
children: /* @__PURE__ */ P(nt, { children: /* @__PURE__ */ F(qe, {
|
|
908
1047
|
extraCSSRules: r,
|
|
909
|
-
style:
|
|
1048
|
+
style: j,
|
|
910
1049
|
children: [
|
|
911
|
-
|
|
1050
|
+
A && /* @__PURE__ */ P(ct, {
|
|
912
1051
|
labels: {
|
|
913
1052
|
hidden: "Show Teacher Instructions",
|
|
914
1053
|
visible: "Hide Teacher Instructions"
|
|
915
1054
|
},
|
|
916
1055
|
className: "collapsible",
|
|
917
|
-
children: /* @__PURE__ */
|
|
1056
|
+
children: /* @__PURE__ */ P(X, { prompt: f })
|
|
918
1057
|
}),
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
show:
|
|
922
|
-
toggled:
|
|
1058
|
+
/* @__PURE__ */ P(at, { children: /* @__PURE__ */ P(X, { prompt: i }) }),
|
|
1059
|
+
/* @__PURE__ */ P(st, {
|
|
1060
|
+
show: h,
|
|
1061
|
+
toggled: g,
|
|
923
1062
|
onToggle: this.toggleCorrect,
|
|
924
1063
|
language: p
|
|
925
1064
|
}),
|
|
926
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ P(rt, { children: /* @__PURE__ */ P(it, { children: /* @__PURE__ */ P(lt, {
|
|
927
1066
|
instanceId: this.instanceId,
|
|
928
|
-
choiceLabel:
|
|
929
|
-
targetLabel:
|
|
1067
|
+
choiceLabel: _.choiceLabel,
|
|
1068
|
+
targetLabel: _.targetLabel,
|
|
930
1069
|
ordering: x,
|
|
931
|
-
tiler:
|
|
1070
|
+
tiler: D,
|
|
932
1071
|
disabled: d,
|
|
933
|
-
addGuide:
|
|
934
|
-
tileSize:
|
|
935
|
-
includeTargets:
|
|
936
|
-
choiceLabelEnabled: e.config && e.config.choiceLabelEnabled
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1072
|
+
addGuide: _.showOrdering,
|
|
1073
|
+
tileSize: _.tileSize,
|
|
1074
|
+
includeTargets: y,
|
|
1075
|
+
choiceLabelEnabled: e.config && e.config.choiceLabelEnabled,
|
|
1076
|
+
...M
|
|
1077
|
+
}) }) }),
|
|
1078
|
+
O && /* @__PURE__ */ P(ot, { dangerouslySetInnerHTML: { __html: c } }),
|
|
1079
|
+
k && /* @__PURE__ */ P(ct, {
|
|
940
1080
|
labels: {
|
|
941
1081
|
hidden: "Show Rationale",
|
|
942
1082
|
visible: "Hide Rationale"
|
|
943
1083
|
},
|
|
944
1084
|
className: "collapsible",
|
|
945
|
-
children: /* @__PURE__ */
|
|
1085
|
+
children: /* @__PURE__ */ P(X, { prompt: a })
|
|
946
1086
|
}),
|
|
947
|
-
!
|
|
1087
|
+
!g && /* @__PURE__ */ P(Je, {
|
|
948
1088
|
correctness: n,
|
|
949
1089
|
feedback: o
|
|
950
1090
|
})
|
|
@@ -952,30 +1092,30 @@ var pt = class extends k.Component {
|
|
|
952
1092
|
}) })
|
|
953
1093
|
});
|
|
954
1094
|
}
|
|
955
|
-
},
|
|
1095
|
+
}, dt = class extends k.Component {
|
|
956
1096
|
static propTypes = {
|
|
957
|
-
model:
|
|
958
|
-
session:
|
|
959
|
-
onSessionChange:
|
|
1097
|
+
model: L.default.object.isRequired,
|
|
1098
|
+
session: L.default.oneOfType([L.default.array.isRequired, L.default.object.isRequired]),
|
|
1099
|
+
onSessionChange: L.default.func.isRequired
|
|
960
1100
|
};
|
|
961
1101
|
render() {
|
|
962
1102
|
let { model: e, session: t, onSessionChange: n } = this.props;
|
|
963
|
-
return /* @__PURE__ */
|
|
1103
|
+
return /* @__PURE__ */ P(ut, {
|
|
964
1104
|
model: e,
|
|
965
1105
|
session: t,
|
|
966
1106
|
onSessionChange: n
|
|
967
1107
|
});
|
|
968
1108
|
}
|
|
969
|
-
}, $ = (0,
|
|
970
|
-
let { config:
|
|
971
|
-
return
|
|
972
|
-
},
|
|
1109
|
+
}, $ = (0, I.default)("pie-elements:placement-ordering"), ft = ({ model: t, session: n }) => {
|
|
1110
|
+
let { config: r } = t, i = (n && e(n.value) || []).length === t.choices.length;
|
|
1111
|
+
return r.includeTargets || i;
|
|
1112
|
+
}, pt = class extends HTMLElement {
|
|
973
1113
|
constructor() {
|
|
974
1114
|
super(), this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
|
|
975
1115
|
}
|
|
976
1116
|
_scheduleMathRender = () => {
|
|
977
1117
|
this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
|
|
978
|
-
this._mathObserver && this._mathObserver.disconnect(),
|
|
1118
|
+
this._mathObserver && this._mathObserver.disconnect(), d(this), this._mathRenderPending = !1, setTimeout(() => {
|
|
979
1119
|
this._mathObserver && this._mathObserver.observe(this, {
|
|
980
1120
|
childList: !0,
|
|
981
1121
|
subtree: !0
|
|
@@ -992,9 +1132,9 @@ var pt = class extends k.Component {
|
|
|
992
1132
|
_disconnectMathObserver() {
|
|
993
1133
|
this._mathObserver &&= (this._mathObserver.disconnect(), null);
|
|
994
1134
|
}
|
|
995
|
-
isComplete = (
|
|
1135
|
+
isComplete = (t) => t && e(t).length === this._model.completeLength;
|
|
996
1136
|
sessionChange = (e) => {
|
|
997
|
-
this._session.value = e.value, this.render(), this.dispatchEvent(new
|
|
1137
|
+
this._session.value = e.value, this.render(), this.dispatchEvent(new te(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)));
|
|
998
1138
|
};
|
|
999
1139
|
set model(e) {
|
|
1000
1140
|
this._model = e, this.render(), this.dispatchEvent(new CustomEvent("model-set", {
|
|
@@ -1011,22 +1151,22 @@ var pt = class extends k.Component {
|
|
|
1011
1151
|
render() {
|
|
1012
1152
|
if (this._model && this._session) {
|
|
1013
1153
|
$("[render] session: ", this._session.value), $("[render] model: ", this._model), this._initMathObserver();
|
|
1014
|
-
let e = k.createElement(
|
|
1154
|
+
let e = k.createElement(dt, {
|
|
1015
1155
|
model: this._model,
|
|
1016
1156
|
session: this._session,
|
|
1017
1157
|
onSessionChange: this.sessionChange
|
|
1018
1158
|
});
|
|
1019
|
-
this._root ||=
|
|
1159
|
+
this._root ||= M(this), this._root.render(e);
|
|
1020
1160
|
}
|
|
1021
1161
|
}
|
|
1022
1162
|
connectedCallback() {
|
|
1023
|
-
this._initMathObserver();
|
|
1163
|
+
this._initMathObserver(), this.render();
|
|
1024
1164
|
}
|
|
1025
1165
|
disconnectedCallback() {
|
|
1026
|
-
this._disconnectMathObserver(), this._root
|
|
1166
|
+
this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
|
|
1027
1167
|
}
|
|
1028
1168
|
};
|
|
1029
1169
|
//#endregion
|
|
1030
|
-
export {
|
|
1170
|
+
export { pt as default, ft as isValidSession };
|
|
1031
1171
|
|
|
1032
1172
|
//# sourceMappingURL=index.js.map
|