@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,84 +1,108 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import * as
|
|
15
|
-
import { Collapsible as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { DragProvider as
|
|
1
|
+
import { HorizontalTiler as e, VerticalTiler as t } from "./tiler.js";
|
|
2
|
+
import { buildState as n, reducer as r } from "./ordering.js";
|
|
3
|
+
import { haveSameValuesButDifferentOrder as i } from "./utils.js";
|
|
4
|
+
import { closestDroppableKeyboardCoordinates as a } from "./keyboard-coordinates.js";
|
|
5
|
+
import o from "react";
|
|
6
|
+
import { difference as s, isEqual as c, uniqueId as l } from "@pie-element/shared-lodash";
|
|
7
|
+
import u from "debug";
|
|
8
|
+
import { renderMath as d } from "@pie-element/shared-math-rendering-mathjax";
|
|
9
|
+
import f from "prop-types";
|
|
10
|
+
import p from "react-dom";
|
|
11
|
+
import { styled as m } from "@mui/material/styles";
|
|
12
|
+
import { rectIntersection as h } from "@dnd-kit/core";
|
|
13
|
+
import { restrictToParentElement as g } from "@dnd-kit/modifiers";
|
|
14
|
+
import * as _ from "@pie-lib/render-ui";
|
|
15
|
+
import { Collapsible as v, Feedback as y, PreviewPrompt as b, UiLayout as x, color as S, hasMedia as C, hasText as w } from "@pie-lib/render-ui";
|
|
16
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
17
|
+
import D from "@pie-lib/translator";
|
|
18
|
+
import O from "@pie-lib/correct-answer-toggle";
|
|
19
|
+
import { DragProvider as k } from "@pie-lib/drag";
|
|
20
20
|
//#region src/delivery/placement-ordering.tsx
|
|
21
|
-
function
|
|
21
|
+
function A(e) {
|
|
22
22
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return !e ||
|
|
24
|
+
function j(e, t) {
|
|
25
|
+
return !e || A(e) ? e : A(e.default) ? e.default : t && A(e[t]) ? e[t] : t && A(e[t]?.default) ? e[t].default : e;
|
|
26
26
|
}
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
var M = j(x, "UiLayout") || j(R.UiLayout, "UiLayout"), N = j(b, "PreviewPrompt") || j(R.PreviewPrompt, "PreviewPrompt"), P = j(y, "Feedback") || j(R.Feedback, "Feedback"), F = j(v, "Collapsible") || j(R.Collapsible, "Collapsible"), I = _, L = I.default, R = L && typeof L == "object" ? L : I, z = 250, B = (e, t) => {
|
|
28
|
+
if (!e || !t) return !1;
|
|
29
|
+
let n = t.left + t.width / 2, r = t.top + t.height / 2;
|
|
30
|
+
return n >= e.left && n <= e.right && r >= e.top && r <= e.bottom;
|
|
31
|
+
}, V = (e) => e ? {
|
|
32
|
+
keyboardCoordinateGetter: a,
|
|
33
|
+
keyboardCodes: {
|
|
34
|
+
start: ["Space", "Enter"],
|
|
35
|
+
cancel: ["Escape"],
|
|
36
|
+
end: ["Space", "Enter"]
|
|
37
|
+
},
|
|
38
|
+
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." } }
|
|
39
|
+
} : {}, { translator: H } = D, U = u("pie-elements:placement-ordering"), W = m("div")({
|
|
40
|
+
color: S.text(),
|
|
41
|
+
backgroundColor: S.background(),
|
|
30
42
|
display: "flex",
|
|
31
43
|
flexDirection: "column",
|
|
32
44
|
alignItems: "center",
|
|
33
45
|
boxSizing: "border-box"
|
|
34
|
-
}),
|
|
46
|
+
}), G = m("div")({
|
|
47
|
+
alignSelf: "stretch",
|
|
48
|
+
maxWidth: "100%",
|
|
49
|
+
overflowX: "auto",
|
|
50
|
+
overflowY: "hidden"
|
|
51
|
+
}), K = m("div")({
|
|
52
|
+
display: "flex",
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
minWidth: "min-content"
|
|
55
|
+
}), q = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), J = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), Y = m(O)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), X = m(F)(({ theme: e }) => ({
|
|
35
56
|
marginBottom: e.spacing(2),
|
|
36
57
|
alignSelf: "flex-start"
|
|
37
|
-
})),
|
|
58
|
+
})), Z = (e) => {
|
|
38
59
|
let { tiler: t, ordering: n, onDropChoice: r, onRemoveChoice: i, ...a } = e;
|
|
39
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ T(t, {
|
|
40
61
|
...a,
|
|
41
62
|
tiles: n.tiles,
|
|
42
63
|
onDropChoice: (e, t) => r(e, t, n),
|
|
43
64
|
onRemoveChoice: (e) => i(e, n)
|
|
44
65
|
});
|
|
45
66
|
};
|
|
46
|
-
|
|
47
|
-
tiler:
|
|
48
|
-
ordering:
|
|
49
|
-
onDropChoice:
|
|
50
|
-
onRemoveChoice:
|
|
67
|
+
Z.propTypes = {
|
|
68
|
+
tiler: f.func,
|
|
69
|
+
ordering: f.any,
|
|
70
|
+
onDropChoice: f.func,
|
|
71
|
+
onRemoveChoice: f.func
|
|
51
72
|
};
|
|
52
|
-
var
|
|
73
|
+
var Q = class extends o.Component {
|
|
53
74
|
static propTypes = {
|
|
54
|
-
onSessionChange:
|
|
55
|
-
model:
|
|
56
|
-
session:
|
|
75
|
+
onSessionChange: f.func.isRequired,
|
|
76
|
+
model: f.object.isRequired,
|
|
77
|
+
session: f.oneOfType([f.array.isRequired, f.object.isRequired])
|
|
57
78
|
};
|
|
58
79
|
constructor(e) {
|
|
59
|
-
super(e), this.instanceId =
|
|
60
|
-
let { value: t, needsReset:
|
|
61
|
-
this.state = {
|
|
62
|
-
|
|
63
|
-
|
|
80
|
+
super(e), this.instanceId = l();
|
|
81
|
+
let { value: t, needsReset: n } = this.validateSession(e);
|
|
82
|
+
this.state = {
|
|
83
|
+
showingCorrect: !1,
|
|
84
|
+
selectedChoice: null
|
|
85
|
+
}, this.lastDragEndAt = 0;
|
|
86
|
+
let { model: r } = e || {}, { env: i } = r || {}, { mode: a } = i || {};
|
|
87
|
+
n && a === "gather" && this.props.onSessionChange({
|
|
64
88
|
...e.session,
|
|
65
89
|
value: t
|
|
66
90
|
});
|
|
67
91
|
}
|
|
68
92
|
toggleCorrect = (e) => this.setState({ showingCorrect: e });
|
|
69
93
|
componentDidUpdate() {
|
|
70
|
-
|
|
94
|
+
d(p.findDOMNode(this));
|
|
71
95
|
}
|
|
72
|
-
validateSession = ({ model:
|
|
73
|
-
let { config:
|
|
74
|
-
if (
|
|
96
|
+
validateSession = ({ model: e, session: t }, n = !1) => {
|
|
97
|
+
let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, o = i.map((e) => e.id), { value: l } = t || {}, u;
|
|
98
|
+
if (a) l && l.length !== o.length && (u = !0, l = l.length < o.length ? l.concat(Array(o.length - l.length)) : l.filter((e) => o.includes(e)));
|
|
75
99
|
else {
|
|
76
|
-
if (!l || !l.length ||
|
|
100
|
+
if (!l || !l.length || n) l = o;
|
|
77
101
|
else {
|
|
78
|
-
let
|
|
79
|
-
(
|
|
102
|
+
let e = s(o, l), t = s(l, o);
|
|
103
|
+
(e.length || t.length) && (l = o);
|
|
80
104
|
}
|
|
81
|
-
u = !t
|
|
105
|
+
u = !c(t.value, l);
|
|
82
106
|
}
|
|
83
107
|
return u && console.warn("This session is not valid anymore. It will be reset."), {
|
|
84
108
|
value: l,
|
|
@@ -86,55 +110,55 @@ var G = class extends c.Component {
|
|
|
86
110
|
};
|
|
87
111
|
};
|
|
88
112
|
UNSAFE_componentWillReceiveProps(e) {
|
|
89
|
-
let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config:
|
|
90
|
-
u && d && (n.note =
|
|
91
|
-
let f =
|
|
113
|
+
let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: a, choices: o = [], env: s } = t, { includeTargets: c } = a || {}, l = {}, u = n.language && n.language !== t.language, d = n.note && n.note === H.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
|
|
114
|
+
u && d && (n.note = H.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (l.showingCorrect = !1);
|
|
115
|
+
let f = i(o, n.choices), { value: p, needsReset: m } = this.validateSession(e, f), h = {
|
|
92
116
|
...e.session,
|
|
93
117
|
value: p
|
|
94
118
|
}, g = n.config?.includeTargets !== c;
|
|
95
119
|
c && g && (m = !0, delete h.value), this.setState(l, () => {
|
|
96
|
-
let { mode: e } =
|
|
120
|
+
let { mode: e } = s || {};
|
|
97
121
|
m && e === "gather" && this.props.onSessionChange(h);
|
|
98
122
|
});
|
|
99
123
|
}
|
|
100
124
|
onDropChoice = (e, t, n) => {
|
|
101
|
-
let { onSessionChange:
|
|
102
|
-
|
|
103
|
-
let c =
|
|
125
|
+
let { onSessionChange: i, session: a } = this.props, o = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), s = e;
|
|
126
|
+
U("[onDropChoice] ", o, s);
|
|
127
|
+
let c = r({
|
|
104
128
|
type: "move",
|
|
105
|
-
from:
|
|
129
|
+
from: o,
|
|
106
130
|
to: s
|
|
107
131
|
}, n);
|
|
108
|
-
|
|
132
|
+
i(Object.assign({}, a, { value: c.response }));
|
|
109
133
|
};
|
|
110
134
|
onRemoveChoice = (e, t) => {
|
|
111
|
-
let { onSessionChange: n, session:
|
|
112
|
-
|
|
113
|
-
let
|
|
135
|
+
let { onSessionChange: n, session: i } = this.props;
|
|
136
|
+
U("[onRemoveChoice]", e);
|
|
137
|
+
let a = r({
|
|
114
138
|
type: "remove",
|
|
115
139
|
target: e
|
|
116
140
|
}, t);
|
|
117
|
-
n(Object.assign({},
|
|
141
|
+
n(Object.assign({}, i, { value: a.response }));
|
|
118
142
|
};
|
|
119
143
|
createOrdering = () => {
|
|
120
|
-
let { model: e, session: t } = this.props, { showingCorrect:
|
|
144
|
+
let { model: e, session: t } = this.props, { showingCorrect: r } = this.state, { includeTargets: i } = e.config || {
|
|
121
145
|
orientation: "vertical",
|
|
122
146
|
includeTargets: !0
|
|
123
147
|
};
|
|
124
|
-
return
|
|
148
|
+
return r ? n(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
|
|
125
149
|
id: e,
|
|
126
150
|
outcome: "correct"
|
|
127
151
|
})), {
|
|
128
|
-
includeTargets:
|
|
152
|
+
includeTargets: i,
|
|
129
153
|
allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
|
|
130
|
-
}) :
|
|
131
|
-
includeTargets:
|
|
154
|
+
}) : n(e.choices, t.value, e.outcomes, {
|
|
155
|
+
includeTargets: i,
|
|
132
156
|
allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
|
|
133
157
|
});
|
|
134
158
|
};
|
|
135
159
|
onDragEnd = (e) => {
|
|
136
160
|
let { over: t, active: n } = e, r = this.createOrdering();
|
|
137
|
-
if (t && n) {
|
|
161
|
+
if (this.cancelSelection(), this.lastDragEndAt = Date.now(), t && n) {
|
|
138
162
|
let e = n.data.current, i = t.data.current;
|
|
139
163
|
if (e && i && i.type === "target") {
|
|
140
164
|
this.onDropChoice(i, e, r);
|
|
@@ -142,68 +166,114 @@ var G = class extends c.Component {
|
|
|
142
166
|
}
|
|
143
167
|
e && i && this.onDropChoice(i, e, r);
|
|
144
168
|
} else if (!t && n) {
|
|
145
|
-
let e = n.data.current;
|
|
146
|
-
e && e.type === "target" && this.onRemoveChoice(e, r);
|
|
169
|
+
let e = n.data.current, t = B(n.rect?.current?.initial, n.rect?.current?.translated);
|
|
170
|
+
e && e.type === "target" && !t && this.onRemoveChoice(e, r);
|
|
147
171
|
}
|
|
148
172
|
};
|
|
173
|
+
onDragStart = (e) => {
|
|
174
|
+
let { active: t } = e;
|
|
175
|
+
t?.data?.current && this.selectChoice(t.data.current);
|
|
176
|
+
};
|
|
177
|
+
onDragCancel = () => {
|
|
178
|
+
this.cancelSelection(), this.lastDragEndAt = Date.now();
|
|
179
|
+
};
|
|
180
|
+
isSameChoice = (e, t) => !!e && !!t && e.type === t.type && e.id === t.id && e.index === t.index;
|
|
181
|
+
selectChoice = (e) => {
|
|
182
|
+
this.setState({ selectedChoice: e });
|
|
183
|
+
};
|
|
184
|
+
toggleChoiceSelection = (e) => {
|
|
185
|
+
this.setState((t) => ({ selectedChoice: this.isSameChoice(t.selectedChoice, e) ? null : e }));
|
|
186
|
+
};
|
|
187
|
+
cancelSelection = () => {
|
|
188
|
+
this.setState({ selectedChoice: null });
|
|
189
|
+
};
|
|
190
|
+
endAnyLiveKeyboardDrag = () => {
|
|
191
|
+
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
192
|
+
code: "Escape",
|
|
193
|
+
bubbles: !0,
|
|
194
|
+
cancelable: !0
|
|
195
|
+
}));
|
|
196
|
+
};
|
|
197
|
+
placeSelectedChoice = (e) => {
|
|
198
|
+
let { selectedChoice: t } = this.state;
|
|
199
|
+
if (!t) return;
|
|
200
|
+
let n = this.createOrdering();
|
|
201
|
+
this.onDropChoice(e, t, n), this.cancelSelection(), this.endAnyLiveKeyboardDrag(), this.lastDragEndAt = Date.now();
|
|
202
|
+
};
|
|
203
|
+
isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < z;
|
|
204
|
+
onChoiceClick = (e) => {
|
|
205
|
+
this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
|
|
206
|
+
};
|
|
207
|
+
onPlacementClick = (e) => {
|
|
208
|
+
this.isClickSoonAfterDragEnd() || this.placeSelectedChoice(e);
|
|
209
|
+
};
|
|
149
210
|
render() {
|
|
150
|
-
let { model:
|
|
211
|
+
let { model: n } = this.props, { correctResponse: r, correctness: i, extraCSSRules: a, prompt: o, rationale: s, feedback: c, config: l, note: u, showNote: d, env: f, disabled: p, teacherInstructions: m, language: _ } = n, v = r && r.length > 0, { showingCorrect: y } = this.state, b = l || {
|
|
151
212
|
orientation: "vertical",
|
|
152
213
|
includeTargets: !0
|
|
153
|
-
}, { orientation:
|
|
154
|
-
color:
|
|
155
|
-
backgroundColor:
|
|
214
|
+
}, { orientation: x, includeTargets: D } = b, O = x === "vertical", A = this.createOrdering(), { mode: j, role: F } = f || {}, I = O ? t : e, L = (y || j === "view" && F === "instructor") && d && u, R = s && (w(s) || C(s)), z = m && (w(m) || C(m)), B = {
|
|
215
|
+
color: S.text(),
|
|
216
|
+
backgroundColor: S.background(),
|
|
156
217
|
display: "flex",
|
|
157
218
|
flexDirection: "column",
|
|
158
219
|
alignItems: "center",
|
|
159
|
-
boxSizing: "border-box"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
220
|
+
boxSizing: "border-box",
|
|
221
|
+
width: "100%"
|
|
222
|
+
}, H = D ? {
|
|
223
|
+
selectedChoice: this.state.selectedChoice,
|
|
224
|
+
onChoiceClick: this.onChoiceClick,
|
|
225
|
+
onPlacementClick: this.onPlacementClick
|
|
226
|
+
} : {};
|
|
227
|
+
return /* @__PURE__ */ T(k, {
|
|
228
|
+
onDragStart: this.onDragStart,
|
|
163
229
|
onDragEnd: this.onDragEnd,
|
|
164
|
-
|
|
165
|
-
|
|
230
|
+
onDragCancel: this.onDragCancel,
|
|
231
|
+
collisionDetection: h,
|
|
232
|
+
modifiers: [g],
|
|
233
|
+
...V(D),
|
|
234
|
+
children: /* @__PURE__ */ T(W, { children: /* @__PURE__ */ E(M, {
|
|
166
235
|
extraCSSRules: a,
|
|
167
|
-
style:
|
|
236
|
+
style: B,
|
|
168
237
|
children: [
|
|
169
|
-
|
|
238
|
+
z && /* @__PURE__ */ T(X, {
|
|
170
239
|
labels: {
|
|
171
240
|
hidden: "Show Teacher Instructions",
|
|
172
241
|
visible: "Hide Teacher Instructions"
|
|
173
242
|
},
|
|
174
243
|
className: "collapsible",
|
|
175
|
-
children: /* @__PURE__ */
|
|
244
|
+
children: /* @__PURE__ */ T(N, { prompt: m })
|
|
176
245
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
show:
|
|
180
|
-
toggled:
|
|
246
|
+
/* @__PURE__ */ T(q, { children: /* @__PURE__ */ T(N, { prompt: o }) }),
|
|
247
|
+
/* @__PURE__ */ T(Y, {
|
|
248
|
+
show: v,
|
|
249
|
+
toggled: y,
|
|
181
250
|
onToggle: this.toggleCorrect,
|
|
182
|
-
language:
|
|
251
|
+
language: _
|
|
183
252
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ T(G, { children: /* @__PURE__ */ T(K, { children: /* @__PURE__ */ T(Z, {
|
|
185
254
|
instanceId: this.instanceId,
|
|
186
|
-
choiceLabel:
|
|
187
|
-
targetLabel:
|
|
188
|
-
ordering:
|
|
189
|
-
tiler:
|
|
255
|
+
choiceLabel: b.choiceLabel,
|
|
256
|
+
targetLabel: b.targetLabel,
|
|
257
|
+
ordering: A,
|
|
258
|
+
tiler: I,
|
|
190
259
|
disabled: p,
|
|
191
|
-
addGuide:
|
|
192
|
-
tileSize:
|
|
193
|
-
includeTargets:
|
|
194
|
-
choiceLabelEnabled:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
L && /* @__PURE__ */
|
|
260
|
+
addGuide: b.showOrdering,
|
|
261
|
+
tileSize: b.tileSize,
|
|
262
|
+
includeTargets: D,
|
|
263
|
+
choiceLabelEnabled: n.config && n.config.choiceLabelEnabled,
|
|
264
|
+
...H
|
|
265
|
+
}) }) }),
|
|
266
|
+
L && /* @__PURE__ */ T(J, { dangerouslySetInnerHTML: { __html: u } }),
|
|
267
|
+
R && /* @__PURE__ */ T(X, {
|
|
198
268
|
labels: {
|
|
199
269
|
hidden: "Show Rationale",
|
|
200
270
|
visible: "Hide Rationale"
|
|
201
271
|
},
|
|
202
272
|
className: "collapsible",
|
|
203
|
-
children: /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */ T(N, { prompt: s })
|
|
204
274
|
}),
|
|
205
|
-
!
|
|
206
|
-
correctness:
|
|
275
|
+
!y && /* @__PURE__ */ T(P, {
|
|
276
|
+
correctness: i,
|
|
207
277
|
feedback: c
|
|
208
278
|
})
|
|
209
279
|
]
|
|
@@ -212,4 +282,4 @@ var G = class extends c.Component {
|
|
|
212
282
|
}
|
|
213
283
|
};
|
|
214
284
|
//#endregion
|
|
215
|
-
export {
|
|
285
|
+
export { Q as PlacementOrdering, Q as default };
|
package/dist/delivery/tile.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export declare const Tile: {
|
|
|
23
23
|
instanceId: PropTypes.Requireable<any>;
|
|
24
24
|
draggable: PropTypes.Requireable<boolean>;
|
|
25
25
|
tileIndex: PropTypes.Requireable<number>;
|
|
26
|
+
selectedChoice: PropTypes.Requireable<object>;
|
|
27
|
+
onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
31
|
export default Tile;
|
package/dist/delivery/tile.js
CHANGED
|
@@ -24,90 +24,89 @@ d.propTypes = {
|
|
|
24
24
|
isOver: n.bool,
|
|
25
25
|
disabled: n.bool
|
|
26
26
|
};
|
|
27
|
-
var f = r("div")(({ theme: e, isDragging: t,
|
|
28
|
-
cursor:
|
|
27
|
+
var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: i, outcome: a, label: s, type: c }) => ({
|
|
28
|
+
cursor: i ? "not-allowed" : "grab",
|
|
29
29
|
width: "100%",
|
|
30
30
|
height: "100%",
|
|
31
31
|
padding: "10px",
|
|
32
32
|
boxSizing: "border-box",
|
|
33
33
|
overflow: "hidden",
|
|
34
|
-
border:
|
|
35
|
-
backgroundColor:
|
|
36
|
-
transition:
|
|
34
|
+
border: c === "choice" || c === "target" ? `1px solid ${o.border()}` : "1px solid transparent",
|
|
35
|
+
backgroundColor: c === "choice" || c === "target" ? o.background() : "transparent",
|
|
36
|
+
transition: c === "choice" || c === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
|
|
37
37
|
pointerEvents: "none",
|
|
38
38
|
userSelect: "none",
|
|
39
|
-
...(
|
|
40
|
-
backgroundColor:
|
|
41
|
-
borderColor:
|
|
42
|
-
transform:
|
|
39
|
+
...(c === "choice" || c === "target") && { "&:hover": {
|
|
40
|
+
backgroundColor: i ? o.background() : o.secondary(),
|
|
41
|
+
borderColor: i ? o.disabled() : e.palette.primary.main,
|
|
42
|
+
transform: i ? "none" : "scale(1.02)"
|
|
43
43
|
} },
|
|
44
|
-
...(
|
|
44
|
+
...(c === "choice" || c === "target") && r && !i && {
|
|
45
45
|
opacity: .4,
|
|
46
46
|
backgroundColor: o.primaryLight(),
|
|
47
47
|
borderColor: e.palette.primary.main,
|
|
48
48
|
borderStyle: "dashed",
|
|
49
49
|
transform: "scale(1.05)"
|
|
50
50
|
},
|
|
51
|
-
...(
|
|
51
|
+
...(c === "choice" || c === "target") && (t || n) && !i && {
|
|
52
52
|
opacity: .6,
|
|
53
53
|
backgroundColor: o.secondaryLight(),
|
|
54
54
|
transform: "scale(1.05) rotate(2deg)",
|
|
55
55
|
boxShadow: "0 8px 16px rgba(0,0,0,0.2)",
|
|
56
56
|
cursor: "grabbing"
|
|
57
57
|
},
|
|
58
|
-
...(
|
|
58
|
+
...(c === "choice" || c === "target") && i && {
|
|
59
59
|
cursor: "not-allowed",
|
|
60
60
|
"&:hover": {
|
|
61
61
|
backgroundColor: o.background(),
|
|
62
62
|
transform: "none"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
...(
|
|
66
|
-
...(
|
|
67
|
-
...!
|
|
65
|
+
...(c === "choice" || c === "target") && a === "incorrect" && { border: `1px solid ${o.incorrect()}` },
|
|
66
|
+
...(c === "choice" || c === "target") && a === "correct" && { border: `1px solid ${o.correct()}` },
|
|
67
|
+
...!s && {
|
|
68
68
|
border: "none",
|
|
69
69
|
"&:hover": { backgroundColor: "unset" }
|
|
70
70
|
}
|
|
71
71
|
})), p = (e) => {
|
|
72
|
-
let { type: t, isDragging: n,
|
|
73
|
-
return
|
|
72
|
+
let { type: t, isDragging: n, isSelected: r, empty: i, isOver: a, label: o, disabled: c, outcome: l, guideIndex: u } = e;
|
|
73
|
+
return i ? /* @__PURE__ */ s(d, {
|
|
74
74
|
type: t,
|
|
75
|
-
index:
|
|
76
|
-
isOver:
|
|
77
|
-
disabled:
|
|
75
|
+
index: u,
|
|
76
|
+
isOver: a,
|
|
77
|
+
disabled: c
|
|
78
78
|
}) : /* @__PURE__ */ s(f, {
|
|
79
79
|
type: t,
|
|
80
80
|
isDragging: n,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
isSelected: r,
|
|
82
|
+
isOver: a,
|
|
83
|
+
disabled: c,
|
|
84
|
+
outcome: l,
|
|
85
|
+
label: o,
|
|
86
|
+
dangerouslySetInnerHTML: { __html: o }
|
|
86
87
|
});
|
|
87
88
|
}, m = (t) => {
|
|
88
|
-
let { label: n, type: r, id: o, empty: c, disabled: u, outcome: d, index: f, guideIndex: m, instanceId: h, draggable: g, tileIndex: _ } = t,
|
|
89
|
-
id:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
let { label: n, type: r, id: o, empty: c, disabled: u, outcome: d, index: f, guideIndex: m, instanceId: h, draggable: g, tileIndex: _, selectedChoice: v, onChoiceClick: y, onPlacementClick: b } = t, x = `tile-${r}-${o ?? "empty"}-${_}-${h}`, S = `drop-${r}-${o ?? "empty"}-${_}-${h}`, C = {
|
|
90
|
+
id: o,
|
|
91
|
+
type: r,
|
|
92
|
+
instanceId: h,
|
|
93
|
+
value: n,
|
|
94
|
+
index: f
|
|
95
|
+
}, { attributes: w, listeners: T, setNodeRef: E, transform: D, isDragging: O } = i({
|
|
96
|
+
id: x,
|
|
97
|
+
data: C,
|
|
97
98
|
disabled: !g || u
|
|
98
|
-
}), { setNodeRef:
|
|
99
|
-
id:
|
|
100
|
-
data:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
disabled: w
|
|
108
|
-
}), D = e.useRef(null);
|
|
99
|
+
}), { setNodeRef: k, isOver: A } = a({
|
|
100
|
+
id: S,
|
|
101
|
+
data: C,
|
|
102
|
+
disabled: O
|
|
103
|
+
}), j = !!v && v.type === C.type && v.id === C.id && v.index === C.index, [M, N] = e.useState(!1), P = !!v && !u, F = A || r === "target" && P && M, I = () => {
|
|
104
|
+
u || (r === "choice" ? v?.type === "target" ? b?.(C) : g && y?.(C) : r === "target" && (j ? y?.(C) : v ? b?.(C) : g && y?.(C)));
|
|
105
|
+
}, L = !(g && !u) && !u, R = (e) => {
|
|
106
|
+
(e.code === "Space" || e.code === "Enter") && (e.preventDefault(), I());
|
|
107
|
+
}, z = e.useRef(null);
|
|
109
108
|
return e.useEffect(() => {
|
|
110
|
-
let e =
|
|
109
|
+
let e = z.current, t = (e) => {
|
|
111
110
|
e.preventDefault();
|
|
112
111
|
};
|
|
113
112
|
return e && e.addEventListener("touchstart", t, { passive: !1 }), () => {
|
|
@@ -115,23 +114,29 @@ var f = r("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i,
|
|
|
115
114
|
};
|
|
116
115
|
}, []), l("[render], props: ", t), /* @__PURE__ */ s("div", {
|
|
117
116
|
ref: (e) => {
|
|
118
|
-
|
|
117
|
+
z.current = e, E(e), k(e);
|
|
119
118
|
},
|
|
120
119
|
style: {
|
|
121
|
-
transform:
|
|
120
|
+
transform: D ? `translate3d(${D.x}px, ${D.y}px, 0)` : void 0,
|
|
122
121
|
boxSizing: "border-box",
|
|
123
122
|
overflow: "visible",
|
|
124
123
|
padding: 0,
|
|
125
124
|
margin: 0,
|
|
126
125
|
textAlign: "center",
|
|
127
126
|
pointerEvents: "auto",
|
|
128
|
-
cursor: u ? "not-allowed" :
|
|
129
|
-
zIndex:
|
|
130
|
-
willChange:
|
|
127
|
+
cursor: u ? "not-allowed" : r === "target" && P ? "pointer" : O ? "grabbing" : "grab",
|
|
128
|
+
zIndex: O ? 1e3 : "auto",
|
|
129
|
+
willChange: O ? "transform" : "auto"
|
|
131
130
|
},
|
|
131
|
+
role: L ? "button" : void 0,
|
|
132
|
+
tabIndex: L ? 0 : void 0,
|
|
133
|
+
onKeyDown: L ? R : void 0,
|
|
134
|
+
onClick: I,
|
|
135
|
+
onMouseEnter: () => N(!0),
|
|
136
|
+
onMouseLeave: () => N(!1),
|
|
132
137
|
...g && !u ? {
|
|
133
|
-
...
|
|
134
|
-
...
|
|
138
|
+
...T,
|
|
139
|
+
...w
|
|
135
140
|
} : {},
|
|
136
141
|
children: /* @__PURE__ */ s(p, {
|
|
137
142
|
label: n,
|
|
@@ -139,8 +144,9 @@ var f = r("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i,
|
|
|
139
144
|
empty: c,
|
|
140
145
|
index: f,
|
|
141
146
|
guideIndex: m,
|
|
142
|
-
isOver:
|
|
143
|
-
isDragging:
|
|
147
|
+
isOver: F,
|
|
148
|
+
isDragging: O,
|
|
149
|
+
isSelected: j,
|
|
144
150
|
disabled: u,
|
|
145
151
|
outcome: d,
|
|
146
152
|
type: r
|
|
@@ -159,7 +165,10 @@ m.propTypes = {
|
|
|
159
165
|
guideIndex: n.number,
|
|
160
166
|
instanceId: n.any,
|
|
161
167
|
draggable: n.bool,
|
|
162
|
-
tileIndex: n.number
|
|
168
|
+
tileIndex: n.number,
|
|
169
|
+
selectedChoice: n.object,
|
|
170
|
+
onChoiceClick: n.func,
|
|
171
|
+
onPlacementClick: n.func
|
|
163
172
|
};
|
|
164
173
|
//#endregion
|
|
165
|
-
export { m as default };
|
|
174
|
+
export { m as Tile, m as default };
|
package/dist/delivery/tiler.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ export declare class HorizontalTiler extends React.Component {
|
|
|
16
16
|
tiles: PropTypes.Validator<any[]>;
|
|
17
17
|
tileSize: PropTypes.Requireable<string>;
|
|
18
18
|
addGuide: PropTypes.Requireable<boolean>;
|
|
19
|
+
selectedChoice: PropTypes.Requireable<object>;
|
|
20
|
+
onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
+
onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
22
|
};
|
|
20
23
|
static defaultProps: {
|
|
21
24
|
tileSize: string;
|
|
@@ -32,6 +35,9 @@ export declare class VerticalTiler extends React.Component {
|
|
|
32
35
|
tiles: PropTypes.Validator<any[]>;
|
|
33
36
|
tileSize: PropTypes.Requireable<string>;
|
|
34
37
|
addGuide: PropTypes.Requireable<boolean>;
|
|
38
|
+
selectedChoice: PropTypes.Requireable<object>;
|
|
39
|
+
onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
+
onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
41
|
};
|
|
36
42
|
static defaultProps: {
|
|
37
43
|
tileSize: string;
|
package/dist/delivery/tiler.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./tile.js";
|
|
1
|
+
import { Tile as e } from "./tile.js";
|
|
2
2
|
import t, { createElement as n } from "react";
|
|
3
3
|
import r from "prop-types";
|
|
4
4
|
import { styled as i } from "@mui/material/styles";
|
|
@@ -10,13 +10,16 @@ var s = {
|
|
|
10
10
|
disabled: r.bool,
|
|
11
11
|
tiles: r.array.isRequired,
|
|
12
12
|
tileSize: r.string,
|
|
13
|
-
addGuide: r.bool
|
|
13
|
+
addGuide: r.bool,
|
|
14
|
+
selectedChoice: r.object,
|
|
15
|
+
onChoiceClick: r.func,
|
|
16
|
+
onPlacementClick: r.func
|
|
14
17
|
}, c = {
|
|
15
18
|
tileSize: "1fr",
|
|
16
19
|
disabled: !1,
|
|
17
20
|
addGuide: !1
|
|
18
21
|
}, l = (t) => {
|
|
19
|
-
let r = (r, i) => (r.instanceId = t.instanceId, r.disabled = t.disabled, r.guideIndex = t.addGuide ? r.index + 1 : void 0, r.tileIndex = i, t.includeTargets || r.type === "choice" ? /* @__PURE__ */ n(e, {
|
|
22
|
+
let r = (r, i) => (r.instanceId = t.instanceId, r.disabled = t.disabled, r.guideIndex = t.addGuide ? r.index + 1 : void 0, r.tileIndex = i, r.selectedChoice = t.selectedChoice, r.onChoiceClick = t.onChoiceClick, r.onPlacementClick = t.onPlacementClick, t.includeTargets || r.type === "choice" ? /* @__PURE__ */ n(e, {
|
|
20
23
|
...r,
|
|
21
24
|
key: i
|
|
22
25
|
}) : /* @__PURE__ */ n(e, {
|