@pie-element/number-line 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/author/arrows.d.ts +29 -0
- package/dist/author/arrows.d.ts.map +1 -0
- package/dist/author/arrows.js +69 -0
- package/dist/author/card-bar.d.ts +21 -0
- package/dist/author/card-bar.d.ts.map +1 -0
- package/dist/author/card-bar.js +41 -0
- package/dist/author/defaults.d.ts +179 -0
- package/dist/author/defaults.d.ts.map +1 -0
- package/dist/author/defaults.js +144 -0
- package/dist/author/domain.d.ts +16 -0
- package/dist/author/domain.d.ts.map +1 -0
- package/dist/author/domain.js +53 -0
- package/dist/author/index.d.ts +24 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +89 -0
- package/dist/author/main.d.ts +45 -0
- package/dist/author/main.d.ts.map +1 -0
- package/dist/author/main.js +482 -0
- package/dist/author/number-text-field.d.ts +14 -0
- package/dist/author/number-text-field.d.ts.map +1 -0
- package/dist/author/number-text-field.js +11 -0
- package/dist/author/point-config.d.ts +26 -0
- package/dist/author/point-config.d.ts.map +1 -0
- package/dist/author/point-config.js +69 -0
- package/dist/author/size.d.ts +25 -0
- package/dist/author/size.d.ts.map +1 -0
- package/dist/author/size.js +48 -0
- package/dist/author/ticks.d.ts +23 -0
- package/dist/author/ticks.d.ts.map +1 -0
- package/dist/author/ticks.js +115 -0
- package/dist/author/utils.d.ts +10 -0
- package/dist/author/utils.d.ts.map +1 -0
- package/dist/author/utils.js +4 -0
- package/dist/controller/defaults.d.ts +59 -0
- package/dist/controller/defaults.d.ts.map +1 -0
- package/dist/controller/defaults.js +50 -0
- package/dist/controller/index.d.ts +34 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +170 -0
- package/dist/controller/tickUtils.d.ts +21 -0
- package/dist/controller/tickUtils.d.ts.map +1 -0
- package/dist/controller/tickUtils.js +254 -0
- package/dist/controller/utils.d.ts +10 -0
- package/dist/controller/utils.d.ts.map +1 -0
- package/dist/controller/utils.js +68 -0
- package/dist/delivery/data-converter.d.ts +65 -0
- package/dist/delivery/data-converter.d.ts.map +1 -0
- package/dist/delivery/data-converter.js +70 -0
- package/dist/delivery/draggable/index.d.ts +34 -0
- package/dist/delivery/draggable/index.d.ts.map +1 -0
- package/dist/delivery/draggable/index.js +39 -0
- package/dist/delivery/index.d.ts +36 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +109 -0
- package/dist/delivery/number-line/colors.d.ts +12 -0
- package/dist/delivery/number-line/colors.d.ts.map +1 -0
- package/dist/delivery/number-line/colors.js +5 -0
- package/dist/delivery/number-line/feedback.d.ts +20 -0
- package/dist/delivery/number-line/feedback.d.ts.map +1 -0
- package/dist/delivery/number-line/feedback.js +57 -0
- package/dist/delivery/number-line/graph/arrow.d.ts +31 -0
- package/dist/delivery/number-line/graph/arrow.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/arrow.js +27 -0
- package/dist/delivery/number-line/graph/elements/base.d.ts +17 -0
- package/dist/delivery/number-line/graph/elements/base.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/elements/base.js +11 -0
- package/dist/delivery/number-line/graph/elements/builder.d.ts +34 -0
- package/dist/delivery/number-line/graph/elements/builder.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/elements/builder.js +30 -0
- package/dist/delivery/number-line/graph/elements/line.d.ts +52 -0
- package/dist/delivery/number-line/graph/elements/line.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/elements/line.js +189 -0
- package/dist/delivery/number-line/graph/elements/point.d.ts +44 -0
- package/dist/delivery/number-line/graph/elements/point.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/elements/point.js +127 -0
- package/dist/delivery/number-line/graph/elements/ray.d.ts +44 -0
- package/dist/delivery/number-line/graph/elements/ray.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/elements/ray.js +130 -0
- package/dist/delivery/number-line/graph/index.d.ts +60 -0
- package/dist/delivery/number-line/graph/index.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/index.js +196 -0
- package/dist/delivery/number-line/graph/line.d.ts +47 -0
- package/dist/delivery/number-line/graph/line.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/line.js +27 -0
- package/dist/delivery/number-line/graph/stacks.d.ts +11 -0
- package/dist/delivery/number-line/graph/stacks.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/stacks.js +40 -0
- package/dist/delivery/number-line/graph/tick-utils.d.ts +74 -0
- package/dist/delivery/number-line/graph/tick-utils.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/tick-utils.js +297 -0
- package/dist/delivery/number-line/graph/ticks.d.ts +47 -0
- package/dist/delivery/number-line/graph/ticks.d.ts.map +1 -0
- package/dist/delivery/number-line/graph/ticks.js +115 -0
- package/dist/delivery/number-line/index.d.ts +36 -0
- package/dist/delivery/number-line/index.d.ts.map +1 -0
- package/dist/delivery/number-line/index.js +218 -0
- package/dist/delivery/number-line/point-chooser/button.d.ts +32 -0
- package/dist/delivery/number-line/point-chooser/button.d.ts.map +1 -0
- package/dist/delivery/number-line/point-chooser/button.js +36 -0
- package/dist/delivery/number-line/point-chooser/img.d.ts +11 -0
- package/dist/delivery/number-line/point-chooser/img.d.ts.map +1 -0
- package/dist/delivery/number-line/point-chooser/img.js +4 -0
- package/dist/delivery/number-line/point-chooser/index.d.ts +38 -0
- package/dist/delivery/number-line/point-chooser/index.d.ts.map +1 -0
- package/dist/delivery/number-line/point-chooser/index.js +154 -0
- package/dist/delivery/number-line/point-chooser/styles.d.ts +193 -0
- package/dist/delivery/number-line/point-chooser/styles.d.ts.map +1 -0
- package/dist/delivery/number-line/transitions/fade.d.ts +35 -0
- package/dist/delivery/number-line/transitions/fade.d.ts.map +1 -0
- package/dist/delivery/number-line/transitions/fade.js +75 -0
- package/dist/delivery/number-line/transitions/index.d.ts +11 -0
- package/dist/delivery/number-line/transitions/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.iife.d.ts +9 -0
- package/dist/index.iife.d.ts.map +1 -0
- package/dist/index.iife.js +201 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludesWith.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFindIndex.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIndexOf.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js +26 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNaN.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMerge.js +19 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePickBy.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js +22 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUniq.js +27 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createFind.js +19 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js +18 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_safeGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_strictIndexOf.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/find.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/findIndex.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqualWith.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isNumber.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/negate.js +17 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/noop.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/omitBy.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/pickBy.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toFinite.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toInteger.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js +19 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniqWith.js +7 -0
- package/package.json +77 -0
- package/src/author/arrows.tsx +87 -0
- package/src/author/card-bar.tsx +70 -0
- package/src/author/defaults.ts +127 -0
- package/src/author/domain.tsx +79 -0
- package/src/author/index.ts +199 -0
- package/src/author/main.tsx +777 -0
- package/src/author/number-text-field.tsx +28 -0
- package/src/author/point-config.tsx +93 -0
- package/src/author/size.tsx +74 -0
- package/src/author/ticks.tsx +272 -0
- package/src/author/utils.ts +16 -0
- package/src/controller/defaults.ts +40 -0
- package/src/controller/index.ts +437 -0
- package/src/controller/tickUtils.ts +324 -0
- package/src/controller/utils.ts +159 -0
- package/src/delivery/data-converter.ts +88 -0
- package/src/delivery/draggable/index.ts +116 -0
- package/src/delivery/index.ts +225 -0
- package/src/delivery/number-line/colors.ts +15 -0
- package/src/delivery/number-line/feedback.tsx +85 -0
- package/src/delivery/number-line/graph/arrow.tsx +43 -0
- package/src/delivery/number-line/graph/elements/base.ts +20 -0
- package/src/delivery/number-line/graph/elements/builder.ts +37 -0
- package/src/delivery/number-line/graph/elements/line.tsx +259 -0
- package/src/delivery/number-line/graph/elements/point.tsx +219 -0
- package/src/delivery/number-line/graph/elements/ray.tsx +168 -0
- package/src/delivery/number-line/graph/index.tsx +258 -0
- package/src/delivery/number-line/graph/line.tsx +33 -0
- package/src/delivery/number-line/graph/stacks.ts +82 -0
- package/src/delivery/number-line/graph/tick-utils.ts +369 -0
- package/src/delivery/number-line/graph/ticks.tsx +189 -0
- package/src/delivery/number-line/index.tsx +385 -0
- package/src/delivery/number-line/point-chooser/button.tsx +54 -0
- package/src/delivery/number-line/point-chooser/img.ts +11 -0
- package/src/delivery/number-line/point-chooser/index.tsx +200 -0
- package/src/delivery/number-line/point-chooser/styles.ts +86 -0
- package/src/delivery/number-line/transitions/fade.tsx +100 -0
- package/src/delivery/number-line/transitions/index.ts +12 -0
- package/src/index.iife.ts +16 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/number-line/configure/src/arrows.jsx
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import { styled } from '@mui/material/styles';
|
|
14
|
+
import { InputCheckbox } from '@pie-lib/config-ui';
|
|
15
|
+
|
|
16
|
+
const FlexRow: any = styled('div')({
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
gap: '10px',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const ArrowsContainer: any = styled('div')(({ theme }) => ({
|
|
23
|
+
paddingTop: theme.spacing(2),
|
|
24
|
+
display: 'flex',
|
|
25
|
+
gap: theme.spacing(2),
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
'& > *': {
|
|
28
|
+
flexShrink: 0,
|
|
29
|
+
},
|
|
30
|
+
'& label': {
|
|
31
|
+
whiteSpace: 'nowrap',
|
|
32
|
+
overflow: 'visible',
|
|
33
|
+
textOverflow: 'clip',
|
|
34
|
+
},
|
|
35
|
+
'& .MuiFormControlLabel-root': {
|
|
36
|
+
margin: 0,
|
|
37
|
+
marginRight: 0,
|
|
38
|
+
},
|
|
39
|
+
'& .MuiFormControlLabel-label': {
|
|
40
|
+
whiteSpace: 'nowrap',
|
|
41
|
+
overflow: 'visible',
|
|
42
|
+
textOverflow: 'clip',
|
|
43
|
+
maxWidth: 'none',
|
|
44
|
+
width: 'auto',
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
export class Arrows extends React.Component {
|
|
50
|
+
static propTypes = {
|
|
51
|
+
arrows: PropTypes.shape({ left: PropTypes.bool, right: PropTypes.bool }).isRequired,
|
|
52
|
+
onChange: PropTypes.func,
|
|
53
|
+
};
|
|
54
|
+
static defaultProps = {
|
|
55
|
+
arrows: { left: true, right: true },
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
constructor(props) {
|
|
59
|
+
super(props);
|
|
60
|
+
|
|
61
|
+
this.change = (key, event, value) => {
|
|
62
|
+
const update = { ...this.props.arrows, [key]: value };
|
|
63
|
+
this.props.onChange(update);
|
|
64
|
+
};
|
|
65
|
+
this.changeLeft = this.change.bind(this, 'left');
|
|
66
|
+
this.changeRight = this.change.bind(this, 'right');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
render() {
|
|
70
|
+
const { arrows } = this.props;
|
|
71
|
+
return (
|
|
72
|
+
<FlexRow>
|
|
73
|
+
<label>Arrows</label>
|
|
74
|
+
<ArrowsContainer>
|
|
75
|
+
<InputCheckbox label={'Left'} checked={arrows.left} onChange={this.changeLeft} />
|
|
76
|
+
<InputCheckbox
|
|
77
|
+
label={'Right'}
|
|
78
|
+
checked={arrows.right}
|
|
79
|
+
onChange={this.changeRight}
|
|
80
|
+
/>
|
|
81
|
+
</ArrowsContainer>
|
|
82
|
+
</FlexRow>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default Arrows;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/number-line/configure/src/card-bar.jsx
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { styled } from '@mui/material/styles';
|
|
12
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
13
|
+
import HelpIcon from '@mui/icons-material/HelpOutline';
|
|
14
|
+
import IconButton from '@mui/material/IconButton';
|
|
15
|
+
import PropTypes from 'prop-types';
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import Typography from '@mui/material/Typography';
|
|
18
|
+
|
|
19
|
+
const CardBarContainer: any = styled('div')({
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'space-between',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const FlexContainer: any = styled('div')({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const StyledIconButton: any = styled(IconButton)({
|
|
30
|
+
margin: 0,
|
|
31
|
+
padding: 0,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const CardBar = (props) => {
|
|
35
|
+
const { header, children, mini, info } = props;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<CardBarContainer>
|
|
39
|
+
<FlexContainer>
|
|
40
|
+
<Typography variant={mini ? 'subheading' : 'h5'}>{header}</Typography>
|
|
41
|
+
{info}
|
|
42
|
+
</FlexContainer>
|
|
43
|
+
{children && (
|
|
44
|
+
<Tooltip
|
|
45
|
+
title={children}
|
|
46
|
+
slotProps={{
|
|
47
|
+
tooltip: {
|
|
48
|
+
sx: (theme) => ({
|
|
49
|
+
fontSize: theme.typography.fontSize - 2,
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<StyledIconButton aria-label="Delete" size="large">
|
|
55
|
+
<HelpIcon />
|
|
56
|
+
</StyledIconButton>
|
|
57
|
+
</Tooltip>
|
|
58
|
+
)}
|
|
59
|
+
</CardBarContainer>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
CardBar.propTypes = {
|
|
64
|
+
mini: PropTypes.bool,
|
|
65
|
+
header: PropTypes.string,
|
|
66
|
+
children: PropTypes.node,
|
|
67
|
+
info: PropTypes.any,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default CardBar;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/number-line/configure/src/defaults.js
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const model = {
|
|
12
|
+
correctResponse: [],
|
|
13
|
+
feedback: {
|
|
14
|
+
correct: { default: 'Correct', type: 'none' },
|
|
15
|
+
incorrect: { default: 'Incorrect', type: 'none' },
|
|
16
|
+
partial: { default: 'Nearly', type: 'none' },
|
|
17
|
+
},
|
|
18
|
+
graph: {
|
|
19
|
+
arrows: { left: true, right: true },
|
|
20
|
+
availableTypes: {
|
|
21
|
+
PF: true,
|
|
22
|
+
},
|
|
23
|
+
domain: { min: -1, max: 1 },
|
|
24
|
+
exhibitOnly: false,
|
|
25
|
+
initialElements: [],
|
|
26
|
+
initialType: 'PF',
|
|
27
|
+
maxNumberOfPoints: 1,
|
|
28
|
+
ticks: { minor: 0.125, major: 0.5, tickIntervalType: 'Decimal' },
|
|
29
|
+
title: '',
|
|
30
|
+
width: 500,
|
|
31
|
+
},
|
|
32
|
+
prompt: '',
|
|
33
|
+
promptEnabled: true,
|
|
34
|
+
rationale: '',
|
|
35
|
+
rationaleEnabled: true,
|
|
36
|
+
teacherInstructions: '',
|
|
37
|
+
teacherInstructionsEnabled: true,
|
|
38
|
+
toolbarEditorPosition: 'bottom',
|
|
39
|
+
widthEnabled: true,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const configuration = {
|
|
43
|
+
baseInputConfiguration: {
|
|
44
|
+
h3: { disabled: true },
|
|
45
|
+
audio: { disabled: false },
|
|
46
|
+
video: { disabled: false },
|
|
47
|
+
image: { disabled: false },
|
|
48
|
+
textAlign: { disabled: true },
|
|
49
|
+
showParagraphs: { disabled: false },
|
|
50
|
+
},
|
|
51
|
+
instruction: {
|
|
52
|
+
settings: false,
|
|
53
|
+
enabled: true,
|
|
54
|
+
label:
|
|
55
|
+
'Number line questions involve plotting points or other objects. To create one, first set up the number line, then select the plotting tools students will be offered and use them to define the correct answer.',
|
|
56
|
+
},
|
|
57
|
+
prompt: {
|
|
58
|
+
settings: true,
|
|
59
|
+
label: 'Item Stem',
|
|
60
|
+
required: false,
|
|
61
|
+
inputConfiguration: {
|
|
62
|
+
audio: { disabled: false },
|
|
63
|
+
video: { disabled: false },
|
|
64
|
+
image: { disabled: false },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
rationale: {
|
|
68
|
+
settings: true,
|
|
69
|
+
label: 'Rationale',
|
|
70
|
+
required: false,
|
|
71
|
+
inputConfiguration: {
|
|
72
|
+
audio: { disabled: false },
|
|
73
|
+
video: { disabled: false },
|
|
74
|
+
image: { disabled: false },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
teacherInstructions: {
|
|
78
|
+
settings: true,
|
|
79
|
+
label: 'Teacher Instructions',
|
|
80
|
+
required: false,
|
|
81
|
+
inputConfiguration: {
|
|
82
|
+
audio: { disabled: false },
|
|
83
|
+
video: { disabled: false },
|
|
84
|
+
image: { disabled: false },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
title: {
|
|
88
|
+
label: 'Title',
|
|
89
|
+
settings: true,
|
|
90
|
+
enabled: true,
|
|
91
|
+
inputConfiguration: {
|
|
92
|
+
audio: { disabled: false },
|
|
93
|
+
video: { disabled: false },
|
|
94
|
+
image: { disabled: false },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
numberLineDimensions: {
|
|
98
|
+
settings: true,
|
|
99
|
+
label: 'Width',
|
|
100
|
+
enabled: true,
|
|
101
|
+
min: 200,
|
|
102
|
+
max: 800,
|
|
103
|
+
step: 20,
|
|
104
|
+
},
|
|
105
|
+
mathMlOptions: {
|
|
106
|
+
mmlOutput: false,
|
|
107
|
+
mmlEditing: false,
|
|
108
|
+
},
|
|
109
|
+
language: {
|
|
110
|
+
settings: false,
|
|
111
|
+
label: 'Specify Language',
|
|
112
|
+
enabled: false,
|
|
113
|
+
},
|
|
114
|
+
languageChoices: {
|
|
115
|
+
label: 'Language Choices',
|
|
116
|
+
options: [],
|
|
117
|
+
},
|
|
118
|
+
spellCheck: {
|
|
119
|
+
label: 'Spellcheck',
|
|
120
|
+
settings: false,
|
|
121
|
+
enabled: true,
|
|
122
|
+
},
|
|
123
|
+
maxMaxElements: 20,
|
|
124
|
+
hidePointConfigButtons: false,
|
|
125
|
+
availableTools: ['PF', 'LFF', 'LEF', 'LFE', 'LEE', 'RFN', 'RFP', 'REN', 'REP'],
|
|
126
|
+
settingsPanelDisabled: false,
|
|
127
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/number-line/configure/src/domain.jsx
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { MiniField } from './number-text-field.js';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
|
|
16
|
+
const DOMAIN_BEGIN = 'domainBegin';
|
|
17
|
+
const DOMAIN_END = 'domainEnd';
|
|
18
|
+
|
|
19
|
+
const DisplayFlex: any = styled('div')({
|
|
20
|
+
display: 'flex',
|
|
21
|
+
gap: '20px',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const FlexRow: any = styled('div')({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
gap: '10px',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const sort = (domain) => {
|
|
31
|
+
if (domain.min <= domain.max) {
|
|
32
|
+
return domain;
|
|
33
|
+
}
|
|
34
|
+
return { min: domain.max, max: domain.min };
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export class Domain extends React.Component {
|
|
38
|
+
constructor(props) {
|
|
39
|
+
super(props);
|
|
40
|
+
|
|
41
|
+
this.changeMin = this.change.bind(this, 'min');
|
|
42
|
+
this.changeMax = this.change.bind(this, 'max');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
change(key, event, value) {
|
|
46
|
+
const { onChange } = this.props;
|
|
47
|
+
let update;
|
|
48
|
+
//Added condition when min and max is same, then it should not update the value
|
|
49
|
+
if ((key === 'min' && value === this.props.domain.max) || (key === 'max' && value === this.props.domain.min)) {
|
|
50
|
+
update = { ...this.props.domain };
|
|
51
|
+
} else {
|
|
52
|
+
update = { ...this.props.domain, [key]: value };
|
|
53
|
+
}
|
|
54
|
+
onChange(sort(update));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
const { domain } = this.props;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<DisplayFlex>
|
|
62
|
+
<FlexRow>
|
|
63
|
+
<label>Min Value</label>
|
|
64
|
+
<MiniField min={-100000} max={99999} value={domain.min} name={DOMAIN_BEGIN} onChange={this.changeMin} />
|
|
65
|
+
</FlexRow>
|
|
66
|
+
<FlexRow>
|
|
67
|
+
<label>Max Value</label>
|
|
68
|
+
<MiniField min={-99999} max={100000} value={domain.max} name={DOMAIN_END} onChange={this.changeMax} />
|
|
69
|
+
</FlexRow>
|
|
70
|
+
</DisplayFlex>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
Domain.propTypes = {
|
|
75
|
+
domain: PropTypes.shape({ min: PropTypes.number, max: PropTypes.number }),
|
|
76
|
+
onChange: PropTypes.func.isRequired,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default Domain;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/number-line/configure/src/index.js
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import Main from './main.js';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { createRoot } from 'react-dom/client';
|
|
14
|
+
import {
|
|
15
|
+
ModelUpdatedEvent,
|
|
16
|
+
InsertSoundEvent,
|
|
17
|
+
DeleteSoundEvent,
|
|
18
|
+
InsertImageEvent,
|
|
19
|
+
DeleteImageEvent,
|
|
20
|
+
} from '@pie-element/shared-configure-events';
|
|
21
|
+
import * as defaults from './defaults.js';
|
|
22
|
+
import * as math from 'mathjs';
|
|
23
|
+
import { cloneDeep } from 'lodash-es';
|
|
24
|
+
|
|
25
|
+
// this function is duplicated in controller; at some point, use the same shared function
|
|
26
|
+
const updateTicks = (model) => {
|
|
27
|
+
const { graph: { domain, labelStep, ticks = {} } = {} } = model;
|
|
28
|
+
const { minor, major } = ticks;
|
|
29
|
+
|
|
30
|
+
if (domain) {
|
|
31
|
+
domain.min = Number((domain.min || 0).toFixed(2));
|
|
32
|
+
domain.max = Number((domain.max || 0).toFixed(2));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (labelStep && typeof labelStep === 'string' && labelStep.match(/^[1-9][0-9]*\/[1-9][0-9]*$/g)) {
|
|
36
|
+
model.graph.fraction = true;
|
|
37
|
+
ticks.tickIntervalType = 'Fraction';
|
|
38
|
+
|
|
39
|
+
// update the ticks frequency and label value to match the label step if needed
|
|
40
|
+
const step = math.evaluate(labelStep);
|
|
41
|
+
|
|
42
|
+
if (step !== major) {
|
|
43
|
+
ticks.major = step;
|
|
44
|
+
ticks.minor = step / (major / minor);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return model;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default class NumberLine extends HTMLElement {
|
|
52
|
+
static createDefaultModel = (model = {}) => {
|
|
53
|
+
const c = defaults.configuration;
|
|
54
|
+
let language = model.language || '';
|
|
55
|
+
|
|
56
|
+
if (!language && c.language && c.language.enabled) {
|
|
57
|
+
if (c.languageChoices?.options?.length) {
|
|
58
|
+
language = c.languageChoices.options[0].value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const normalizedModel = {
|
|
63
|
+
...defaults.model,
|
|
64
|
+
...model,
|
|
65
|
+
language,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return updateTicks(normalizedModel);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
constructor() {
|
|
72
|
+
super();
|
|
73
|
+
this._root = null;
|
|
74
|
+
this._model = NumberLine.createDefaultModel();
|
|
75
|
+
this._configuration = defaults.configuration;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set model(m) {
|
|
79
|
+
this._model = NumberLine.createDefaultModel(m);
|
|
80
|
+
this._modelCopy = cloneDeep(this._model);
|
|
81
|
+
|
|
82
|
+
this._rerender();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
resetModelAfterConfigurationIsSet: any = () => {
|
|
86
|
+
// In environments that use pie-player-components, model is set before configuration.
|
|
87
|
+
// This is the reason why sometimes the model gets altered non-reversible
|
|
88
|
+
// (altered using default configuration instead of client configuration, because at that point client configuration was not set yet)
|
|
89
|
+
// Therefore, in such environments, we will make sure to keep a modelCopy (initialised in set model) and use it to reset
|
|
90
|
+
// the model in set configuration (resetModelAfterConfigurationIsSet) if set configuration is ever called
|
|
91
|
+
const pieAuthors = document.querySelectorAll('pie-author');
|
|
92
|
+
this.hasPlayerAsParent = Array.from(pieAuthors).some((author) => author.contains(this));
|
|
93
|
+
|
|
94
|
+
if (this.hasPlayerAsParent) {
|
|
95
|
+
if (this._modelCopy) {
|
|
96
|
+
this._model = this._modelCopy;
|
|
97
|
+
} else {
|
|
98
|
+
delete this._modelCopy;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
set configuration(c) {
|
|
104
|
+
const newConfiguration = {
|
|
105
|
+
...defaults.configuration,
|
|
106
|
+
...c,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
this._configuration = newConfiguration;
|
|
110
|
+
|
|
111
|
+
this.resetModelAfterConfigurationIsSet();
|
|
112
|
+
|
|
113
|
+
// if language:enabled is true, then the corresponding default item model should include a language value;
|
|
114
|
+
// if it is false, then the language field should be omitted from the item model.
|
|
115
|
+
// if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
|
|
116
|
+
// then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
|
|
117
|
+
if (newConfiguration?.language?.enabled) {
|
|
118
|
+
if (newConfiguration?.languageChoices?.options?.length) {
|
|
119
|
+
this._model.language = newConfiguration?.languageChoices.options[0].value;
|
|
120
|
+
}
|
|
121
|
+
} else if (newConfiguration.language.settings && this._model.language) {
|
|
122
|
+
this._configuration.language.enabled = true;
|
|
123
|
+
|
|
124
|
+
if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
|
|
125
|
+
this._configuration.languageChoices.options = [];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// check if the language is already included in the languageChoices.options array
|
|
129
|
+
// and if not, then add it.
|
|
130
|
+
if (!this._configuration.languageChoices.options.find((option) => option.value === this._model.language)) {
|
|
131
|
+
this._configuration.languageChoices.options.push({
|
|
132
|
+
value: this._model.language,
|
|
133
|
+
label: this._model.language,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
delete this._model.language;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this._rerender();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
onChange: any = (o) => {
|
|
144
|
+
this._model = { ...this._model, ...o };
|
|
145
|
+
|
|
146
|
+
this.dispatchEvent(new ModelUpdatedEvent(this._model));
|
|
147
|
+
|
|
148
|
+
this._rerender();
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
onConfigurationChanged: any = (config) => {
|
|
152
|
+
this._configuration = config;
|
|
153
|
+
this._render();
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
insertImage(handler) {
|
|
157
|
+
this.dispatchEvent(new InsertImageEvent(handler));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
onDeleteImage(src, done) {
|
|
161
|
+
this.dispatchEvent(new DeleteImageEvent(src, done));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
insertSound(handler) {
|
|
165
|
+
this.dispatchEvent(new InsertSoundEvent(handler));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
onDeleteSound(src, done) {
|
|
169
|
+
this.dispatchEvent(new DeleteSoundEvent(src, done));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
_rerender() {
|
|
173
|
+
let element = React.createElement(Main, {
|
|
174
|
+
model: this._model,
|
|
175
|
+
configuration: this._configuration,
|
|
176
|
+
onChange: this.onChange,
|
|
177
|
+
onConfigurationChanged: this.onConfigurationChanged,
|
|
178
|
+
imageSupport: {
|
|
179
|
+
add: this.insertImage.bind(this),
|
|
180
|
+
delete: this.onDeleteImage.bind(this),
|
|
181
|
+
},
|
|
182
|
+
uploadSoundSupport: {
|
|
183
|
+
add: this.insertSound.bind(this),
|
|
184
|
+
delete: this.onDeleteSound.bind(this),
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
if (!this._root) {
|
|
189
|
+
this._root = createRoot(this);
|
|
190
|
+
}
|
|
191
|
+
this._root.render(element);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
disconnectedCallback() {
|
|
195
|
+
if (this._root) {
|
|
196
|
+
this._root.unmount();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|