@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
package/dist/controller/index.js
CHANGED
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import r from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
5
|
-
import i from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
|
|
6
|
-
import a from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js";
|
|
7
|
-
import { flattenCorrect as o, getAllCorrectResponses as s, score as c } from "./scoring.js";
|
|
8
|
-
import l from "./defaults.js";
|
|
1
|
+
import { flattenCorrect as e, getAllCorrectResponses as t, score as n } from "./scoring.js";
|
|
2
|
+
import r from "./defaults.js";
|
|
3
|
+
import { every as i, isArray as a, isEmpty as o, isEqual as s, map as c, reduce as l } from "@pie-element/shared-lodash";
|
|
9
4
|
import u from "debug";
|
|
10
5
|
import d from "@pie-lib/translator";
|
|
11
6
|
import { getFeedbackForCorrectness as f } from "@pie-element/shared-feedback";
|
|
12
7
|
import { partialScoring as p } from "@pie-element/shared-controller-utils";
|
|
13
8
|
//#region src/controller/index.ts
|
|
14
|
-
var m = u("@pie-element:placement-ordering:controller"), { translator: h } = d, g = () => /* @__PURE__ */ Error("Question is missing required array: correctResponse"), _ = (e,
|
|
15
|
-
let
|
|
9
|
+
var m = u("@pie-element:placement-ordering:controller"), { translator: h } = d, g = () => /* @__PURE__ */ Error("Question is missing required array: correctResponse"), _ = (e, r, i) => {
|
|
10
|
+
let a = [], o = r?.value || [];
|
|
16
11
|
e?.correctResponse;
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
19
|
-
let l =
|
|
12
|
+
let c = e?.placementArea === !0;
|
|
13
|
+
if (!o.length) return c ? a.push("Student did not place any tiles in the target area.") : a.push("Student did not reorder any tiles."), a.push("Final score: 0."), a;
|
|
14
|
+
let l = t(e), u = {
|
|
20
15
|
score: 0,
|
|
21
16
|
response: []
|
|
22
17
|
};
|
|
23
18
|
l.forEach((e) => {
|
|
24
19
|
let t = 0;
|
|
25
|
-
|
|
20
|
+
o.forEach((n, r) => {
|
|
26
21
|
e[r] === n && t++;
|
|
27
22
|
}), t > u.score && (u = {
|
|
28
23
|
score: t,
|
|
29
24
|
response: e
|
|
30
25
|
});
|
|
31
26
|
});
|
|
32
|
-
let d = u.score, f =
|
|
33
|
-
d > 0 &&
|
|
34
|
-
let m = p.enabled(e,
|
|
35
|
-
m ? (
|
|
36
|
-
let h =
|
|
37
|
-
return
|
|
27
|
+
let d = u.score, f = o.length - d;
|
|
28
|
+
d > 0 && a.push(`${d} tile(s) placed in the correct order.`), f > 0 && a.push(`${f} tile(s) placed in an incorrect order.`), l.some((e) => s(e, o));
|
|
29
|
+
let m = p.enabled(e, i || {});
|
|
30
|
+
m ? (a.push("Score calculated using partial scoring."), a.push("Each tile placed in the correct position contributes to the score.")) : (a.push("Score calculated using all-or-nothing scoring."), c ? a.push("Student must place all tiles in the correct positions within the target area to receive full credit.") : a.push("Student must arrange all tiles in the correct order to receive full credit."));
|
|
31
|
+
let h = n(e, r), g = m ? h : +(h === 1);
|
|
32
|
+
return a.push(`Final score: ${g}.`), a;
|
|
38
33
|
};
|
|
39
|
-
function v(e, t,
|
|
34
|
+
function v(e, t, r) {
|
|
40
35
|
return new Promise((i, a) => {
|
|
41
|
-
if (!t ||
|
|
36
|
+
if (!t || o(t)) {
|
|
42
37
|
i({
|
|
43
38
|
score: 0,
|
|
44
39
|
empty: !0,
|
|
@@ -46,12 +41,12 @@ function v(e, t, n) {
|
|
|
46
41
|
});
|
|
47
42
|
return;
|
|
48
43
|
}
|
|
49
|
-
if (!e || !e.correctResponse ||
|
|
44
|
+
if (!e || !e.correctResponse || o(e.correctResponse)) a(g());
|
|
50
45
|
else try {
|
|
51
|
-
let
|
|
46
|
+
let a = n(e, t);
|
|
52
47
|
i({
|
|
53
|
-
score: p.enabled(e,
|
|
54
|
-
logTrace: _(e, t,
|
|
48
|
+
score: p.enabled(e, r || {}) ? a : +(a === 1),
|
|
49
|
+
logTrace: _(e, t, r)
|
|
55
50
|
});
|
|
56
51
|
} catch (e) {
|
|
57
52
|
a(e);
|
|
@@ -61,13 +56,13 @@ function v(e, t, n) {
|
|
|
61
56
|
function y(e = {}) {
|
|
62
57
|
return new Promise((t) => {
|
|
63
58
|
t({
|
|
64
|
-
...
|
|
59
|
+
...r,
|
|
65
60
|
...e
|
|
66
61
|
});
|
|
67
62
|
});
|
|
68
63
|
}
|
|
69
64
|
var b = (e) => ({
|
|
70
|
-
...
|
|
65
|
+
...r,
|
|
71
66
|
rationaleEnabled: !0,
|
|
72
67
|
feedbackEnabled: !1,
|
|
73
68
|
promptEnabled: !0,
|
|
@@ -75,9 +70,9 @@ var b = (e) => ({
|
|
|
75
70
|
studentInstructionsEnabled: !0,
|
|
76
71
|
...e
|
|
77
72
|
});
|
|
78
|
-
async function x(r,
|
|
73
|
+
async function x(r, o, u) {
|
|
79
74
|
let d = b(r), g = {};
|
|
80
|
-
if (r.alternateResponses &&
|
|
75
|
+
if (r.alternateResponses && i(r.alternateResponses, a) && (m("Deprecated structure of alternateResponses is in use"), console.error("Deprecated structure of alternateResponses is in use")), g.env = u, g.extraCSSRules = d.extraCSSRules, g.outcomes = [], g.completeLength = (d.correctResponse || []).length, g.choices = (d.choices || []).filter((e) => e.label), g.note = d.note, g.showNote = d.alternateResponses && d.alternateResponses.length > 0, g.language = d.language, m("[model] removing tileSize for the moment."), g.prompt = d.promptEnabled ? d.prompt : null, g.config = {
|
|
81
76
|
orientation: d.orientation || "vertical",
|
|
82
77
|
includeTargets: d.placementArea,
|
|
83
78
|
choiceLabelEnabled: d.choiceLabelEnabled,
|
|
@@ -86,43 +81,43 @@ async function x(r, l, u) {
|
|
|
86
81
|
showOrdering: d.numberedGuides,
|
|
87
82
|
allowSameChoiceInTargets: !d.removeTilesAfterPlacing
|
|
88
83
|
}, g.disabled = u.mode !== "gather", g.note ||= h.t("common:commonCorrectAnswerWithAlternates", { lng: d.language }), u.role === "instructor" && (u.mode === "view" || u.mode === "evaluate") ? (g.rationale = d.rationaleEnabled ? d.rationale : null, g.teacherInstructions = d.teacherInstructionsEnabled ? d.teacherInstructions : null) : (g.rationale = null, g.teacherInstructions = null), u.mode === "evaluate") {
|
|
89
|
-
let
|
|
90
|
-
let
|
|
91
|
-
return
|
|
92
|
-
arr:
|
|
93
|
-
score:
|
|
94
|
-
} :
|
|
84
|
+
let i = o && o.value || [], a = t(d), m = a.reduce((e, t) => {
|
|
85
|
+
let n = l(i, (e, n, r) => e + (Array.isArray(t) && t[r] === n ? 1 : 0), 0);
|
|
86
|
+
return n > e.score ? {
|
|
87
|
+
arr: t,
|
|
88
|
+
score: n
|
|
89
|
+
} : e;
|
|
95
90
|
}, {
|
|
96
91
|
arr: [],
|
|
97
92
|
score: 0
|
|
98
93
|
});
|
|
99
|
-
g.outcomes =
|
|
94
|
+
g.outcomes = c(i, (e, t) => ({
|
|
100
95
|
id: e,
|
|
101
96
|
outcome: m.arr[t] === e ? "correct" : "incorrect"
|
|
102
97
|
}));
|
|
103
|
-
let h =
|
|
104
|
-
return g.correctness = v ? "correct" : y ? "partial" : "incorrect", h || (g.correctResponse =
|
|
98
|
+
let h = a.some((e) => s(e, i)), _ = n(r, o), v = _ === 1, y = !v && p.enabled(d, u || {}) && _ !== 0;
|
|
99
|
+
return g.correctness = v ? "correct" : y ? "partial" : "incorrect", h || (g.correctResponse = e(d)), d.feedback || (d.feedbackEnabled = !1), g.feedback = d.feedbackEnabled ? await f(g.correctness, d.feedback) : void 0, g;
|
|
105
100
|
} else return g;
|
|
106
101
|
}
|
|
107
|
-
var S = (
|
|
108
|
-
|
|
102
|
+
var S = (t, n) => new Promise((r) => {
|
|
103
|
+
n.mode !== "evaluate" && n.role === "instructor" ? r({
|
|
109
104
|
id: "1",
|
|
110
|
-
value:
|
|
111
|
-
}) :
|
|
105
|
+
value: e(t)
|
|
106
|
+
}) : r(null);
|
|
112
107
|
}), C = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), w = (e = {}, t = {}) => {
|
|
113
|
-
let { choices: n, correctResponse:
|
|
108
|
+
let { choices: n, correctResponse: r } = e, i = {};
|
|
114
109
|
[
|
|
115
110
|
"teacherInstructions",
|
|
116
111
|
"prompt",
|
|
117
112
|
"rationale"
|
|
118
113
|
].forEach((n) => {
|
|
119
|
-
t[n]?.required && !C(e[n]) && (
|
|
114
|
+
t[n]?.required && !C(e[n]) && (i[n] = "This field is required.");
|
|
120
115
|
});
|
|
121
|
-
let
|
|
122
|
-
return
|
|
116
|
+
let a = [...n || []].reverse(), c = {};
|
|
117
|
+
return a.forEach((e, t) => {
|
|
123
118
|
let { id: n, label: r } = e;
|
|
124
|
-
C(r) ?
|
|
125
|
-
}),
|
|
119
|
+
C(r) ? a.slice(t + 1).some((e) => e.label === r) && (c[n] = "Content should be unique.") : c[n] = "Content should not be empty.";
|
|
120
|
+
}), s((n || []).map((e) => e.id), (r || []).map((e) => e.id || e)) && (i.orderError = "The correct ordering should not be identical to the initial ordering."), o(c) || (i.choicesErrors = c), i;
|
|
126
121
|
};
|
|
127
122
|
//#endregion
|
|
128
123
|
export { S as createCorrectResponseSession, y as createDefaultModel, _ as getLogTrace, x as model, b as normalize, v as outcome, g as questionError, w as validate };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
|
|
3
|
-
import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js";
|
|
1
|
+
import { differenceWith as e, isEqual as t, uniq as n } from "@pie-element/shared-lodash";
|
|
4
2
|
import r from "debug";
|
|
5
3
|
import { combination as i } from "js-combinatorics";
|
|
6
4
|
//#region src/controller/scoring.ts
|
|
@@ -29,4 +27,4 @@ var a = r("pie-elements:placement-ordering:controller"), o = (e) => /* @__PURE__
|
|
|
29
27
|
}), a;
|
|
30
28
|
};
|
|
31
29
|
//#endregion
|
|
32
|
-
export { c as flattenCorrect, l as getAllCorrectResponses, u as score };
|
|
30
|
+
export { c as flattenCorrect, l as getAllCorrectResponses, o as illegalArgumentError, s as pairwiseCombinationScore, u as score };
|
package/dist/delivery/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "react";
|
|
4
|
-
import {
|
|
1
|
+
import e from "./main.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { createRoot as n } from "react-dom/client";
|
|
4
|
+
import { compact as r } from "@pie-element/shared-lodash";
|
|
5
5
|
import i from "debug";
|
|
6
6
|
import { renderMath as a } from "@pie-element/shared-math-rendering-mathjax";
|
|
7
7
|
import { SessionChangedEvent as o } from "@pie-element/shared-player-events";
|
|
8
8
|
//#region src/delivery/index.ts
|
|
9
|
-
var s = i("pie-elements:placement-ordering"), c = ({ model:
|
|
10
|
-
let { config:
|
|
11
|
-
return
|
|
9
|
+
var s = i("pie-elements:placement-ordering"), c = ({ model: e, session: t }) => {
|
|
10
|
+
let { config: n } = e, i = (t && r(t.value) || []).length === e.choices.length;
|
|
11
|
+
return n.includeTargets || i;
|
|
12
12
|
}, l = class extends HTMLElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(), this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
|
|
@@ -32,7 +32,7 @@ var s = i("pie-elements:placement-ordering"), c = ({ model: t, session: n }) =>
|
|
|
32
32
|
_disconnectMathObserver() {
|
|
33
33
|
this._mathObserver &&= (this._mathObserver.disconnect(), null);
|
|
34
34
|
}
|
|
35
|
-
isComplete = (
|
|
35
|
+
isComplete = (e) => e && r(e).length === this._model.completeLength;
|
|
36
36
|
sessionChange = (e) => {
|
|
37
37
|
this._session.value = e.value, this.render(), this.dispatchEvent(new o(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)));
|
|
38
38
|
};
|
|
@@ -51,19 +51,19 @@ var s = i("pie-elements:placement-ordering"), c = ({ model: t, session: n }) =>
|
|
|
51
51
|
render() {
|
|
52
52
|
if (this._model && this._session) {
|
|
53
53
|
s("[render] session: ", this._session.value), s("[render] model: ", this._model), this._initMathObserver();
|
|
54
|
-
let
|
|
54
|
+
let r = t.createElement(e, {
|
|
55
55
|
model: this._model,
|
|
56
56
|
session: this._session,
|
|
57
57
|
onSessionChange: this.sessionChange
|
|
58
58
|
});
|
|
59
|
-
this._root ||=
|
|
59
|
+
this._root ||= n(this), this._root.render(r);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
connectedCallback() {
|
|
63
|
-
this._initMathObserver();
|
|
63
|
+
this._initMathObserver(), this.render();
|
|
64
64
|
}
|
|
65
65
|
disconnectedCallback() {
|
|
66
|
-
this._disconnectMathObserver(), this._root
|
|
66
|
+
this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
//#endregion
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/placement-ordering/src/keyboard-coordinates.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Custom keyboard coordinate getter for placement-ordering's Tab-based placement mode
|
|
11
|
+
* (enabled only when the item is configured with `placementArea` / `includeTargets`).
|
|
12
|
+
*
|
|
13
|
+
* Tab/Shift+Tab cycle the dragged choice through the target column's response areas
|
|
14
|
+
* in on-screen order (first target, then the rest in sequence), followed by exactly
|
|
15
|
+
* one source-column stop as a fixed last step before the cycle wraps back to the first
|
|
16
|
+
* target — so picking up a choice always starts the cycle at the first target,
|
|
17
|
+
* regardless of where that choice's own source-column slot happens to sit on screen.
|
|
18
|
+
*
|
|
19
|
+
* Arrow keys are delegated to dnd-kit's own `defaultKeyboardCoordinateGetter` so the
|
|
20
|
+
* pre-existing free-form arrow-key dragging behavior is left completely unchanged.
|
|
21
|
+
*
|
|
22
|
+
* Whichever slot a drag started from — a target the choice was already placed in, or
|
|
23
|
+
* (see below) the choice's own pool slot — stays reachable by Tab as a no-op "drop it
|
|
24
|
+
* back where it came from": tile.tsx disables a droppable for the whole duration of
|
|
25
|
+
* its own drag (a self-collision guard for pointer drags), which would otherwise make
|
|
26
|
+
* that exact slot unreachable; that guard is bypassed here specifically for the one
|
|
27
|
+
* droppable matching the active drag's own id. A target slot picked up this way stays
|
|
28
|
+
* in its normal position in the target sequence (it's just another target); nothing
|
|
29
|
+
* special is needed there beyond the bypass itself.
|
|
30
|
+
*
|
|
31
|
+
* The choices column isn't a place a student can choose to relocate an answer within —
|
|
32
|
+
* there's exactly one meaningful "source" stop for whichever choice is currently being
|
|
33
|
+
* dragged: its own fixed slot, whether that's the vacated gap left behind (if the
|
|
34
|
+
* choice is already placed in a target — landing back on it returns the choice to the
|
|
35
|
+
* pool, undoing the placement) or the very tile being dragged (if the choice is still
|
|
36
|
+
* sitting there, unplaced — landing back on it is a no-op that effectively cancels the
|
|
37
|
+
* pick-up; the same disabled-droppable bypass applies here too). Every *other*
|
|
38
|
+
* choice-column tile — filled or an empty gap — is excluded from the cycle:
|
|
39
|
+
* `ordering.ts`'s `updateResponse` has no `choice -> choice` case, so they'd be no-op
|
|
40
|
+
* drop targets anyway. Matching is by id (the vacated gap carries its original choice's
|
|
41
|
+
* id specifically so this comparison works), not by type alone.
|
|
42
|
+
*/
|
|
43
|
+
export declare const closestDroppableKeyboardCoordinates: (event: any, { active, context, currentCoordinates }: {
|
|
44
|
+
active: any;
|
|
45
|
+
context: any;
|
|
46
|
+
currentCoordinates: any;
|
|
47
|
+
}) => any;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { KeyboardCode as e, defaultKeyboardCoordinateGetter as t } from "@dnd-kit/core";
|
|
2
|
+
//#region src/delivery/keyboard-coordinates.ts
|
|
3
|
+
var n = (n, { active: i, context: a, currentCoordinates: o }) => {
|
|
4
|
+
let { code: s } = n, c = s === "Tab", l = s === e.Down || s === e.Up || s === e.Left || s === e.Right;
|
|
5
|
+
if (!c && !l) return;
|
|
6
|
+
if (l) return t(n, {
|
|
7
|
+
context: a,
|
|
8
|
+
currentCoordinates: o
|
|
9
|
+
});
|
|
10
|
+
n.preventDefault();
|
|
11
|
+
let { droppableRects: u, droppableContainers: d, collisionRect: f, draggableNodes: p, active: m } = a;
|
|
12
|
+
if (!u || u.size === 0) return o;
|
|
13
|
+
let h = {
|
|
14
|
+
x: (f?.width || 0) / 2,
|
|
15
|
+
y: (f?.height || 0) / 2
|
|
16
|
+
}, g = {
|
|
17
|
+
x: o.x + h.x,
|
|
18
|
+
y: o.y + h.y
|
|
19
|
+
}, _ = p?.get(i)?.data?.current?.id, v = m?.rect?.current?.initial, y = typeof i == "string" ? i.replace(/^tile-/, "drop-") : void 0, b = [], x;
|
|
20
|
+
for (let [e, t] of d) {
|
|
21
|
+
let n = t?.data?.current, r = e === y;
|
|
22
|
+
if (t?.disabled && !r) continue;
|
|
23
|
+
let i = n?.type === "choice" && n?.id === _;
|
|
24
|
+
if (n?.type === "choice" && !i) continue;
|
|
25
|
+
let a = (r ? v : null) || u.get(e);
|
|
26
|
+
if (!a) continue;
|
|
27
|
+
let o = {
|
|
28
|
+
x: a.left + a.width / 2,
|
|
29
|
+
y: a.top + a.height / 2
|
|
30
|
+
}, s = {
|
|
31
|
+
id: e,
|
|
32
|
+
dropPosition: {
|
|
33
|
+
x: a.left,
|
|
34
|
+
y: a.top + a.height / 2 - h.y
|
|
35
|
+
},
|
|
36
|
+
center: o
|
|
37
|
+
};
|
|
38
|
+
i ? x = s : b.push(s);
|
|
39
|
+
}
|
|
40
|
+
if (b.length === 0 && !x) return o;
|
|
41
|
+
let S = n.shiftKey;
|
|
42
|
+
b.sort((e, t) => Math.abs(e.center.y - t.center.y) > 10 ? e.center.y - t.center.y : e.center.x - t.center.x), x && b.push(x);
|
|
43
|
+
let C = 0, w = Infinity;
|
|
44
|
+
for (let e = 0; e < b.length; e++) {
|
|
45
|
+
let t = r(g, b[e].center);
|
|
46
|
+
t < w && (w = t, C = e);
|
|
47
|
+
}
|
|
48
|
+
return b[S ? (C - 1 + b.length) % b.length : (C + 1) % b.length].dropPosition;
|
|
49
|
+
}, r = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
50
|
+
//#endregion
|
|
51
|
+
export { n as closestDroppableKeyboardCoordinates };
|
package/dist/delivery/main.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js";
|
|
3
|
-
import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js";
|
|
4
|
-
import r from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
1
|
+
import { assign as e, cloneDeep as t, isEmpty as n, map as r } from "@pie-element/shared-lodash";
|
|
5
2
|
import i from "debug";
|
|
6
3
|
//#region src/delivery/ordering.ts
|
|
7
4
|
var a = i("pie-elements:placement-ordering:ordering"), o = (e, t, n) => {
|
|
@@ -43,6 +40,7 @@ function u(e, t, n, r) {
|
|
|
43
40
|
}
|
|
44
41
|
return e.map((e) => t.indexOf(e.id) !== -1 && !r.allowSameChoiceInTargets ? {
|
|
45
42
|
type: "choice",
|
|
43
|
+
id: e.id,
|
|
46
44
|
empty: !0,
|
|
47
45
|
droppable: !0,
|
|
48
46
|
draggable: !1
|
|
@@ -65,7 +63,7 @@ function u(e, t, n, r) {
|
|
|
65
63
|
}, []);
|
|
66
64
|
}
|
|
67
65
|
function d(t, i, a, o) {
|
|
68
|
-
return o = e({ includeTargets: !0 }, o), a ||= [], i = !i ||
|
|
66
|
+
return o = e({ includeTargets: !0 }, o), a ||= [], i = !i || n(i) ? o.includeTargets ? Array(t.length) : r(t, (e) => e.id) : i, {
|
|
69
67
|
choices: t,
|
|
70
68
|
response: i,
|
|
71
69
|
opts: o,
|
|
@@ -93,4 +91,4 @@ function f(e, t) {
|
|
|
93
91
|
return t;
|
|
94
92
|
}
|
|
95
93
|
//#endregion
|
|
96
|
-
export { d as buildState, f as reducer };
|
|
94
|
+
export { d as buildState, o as push, f as reducer, s as swap };
|
|
@@ -23,6 +23,17 @@ export declare class PlacementOrdering extends React.Component {
|
|
|
23
23
|
onRemoveChoice: any;
|
|
24
24
|
createOrdering: any;
|
|
25
25
|
onDragEnd: any;
|
|
26
|
+
onDragStart: any;
|
|
27
|
+
onDragCancel: any;
|
|
28
|
+
isSameChoice: (a: any, b: any) => boolean;
|
|
29
|
+
selectChoice: any;
|
|
30
|
+
toggleChoiceSelection: any;
|
|
31
|
+
cancelSelection: any;
|
|
32
|
+
endAnyLiveKeyboardDrag: any;
|
|
33
|
+
placeSelectedChoice: any;
|
|
34
|
+
isClickSoonAfterDragEnd: () => boolean;
|
|
35
|
+
onChoiceClick: any;
|
|
36
|
+
onPlacementClick: any;
|
|
26
37
|
render(): React.JSX.Element;
|
|
27
38
|
}
|
|
28
39
|
export default PlacementOrdering;
|