@pie-element/graphing-solution-set 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/author/configure.d.ts +27 -0
- package/dist/author/configure.d.ts.map +1 -0
- package/dist/author/configure.js +190 -0
- package/dist/author/correct-response.d.ts +34 -0
- package/dist/author/correct-response.d.ts.map +1 -0
- package/dist/author/correct-response.js +206 -0
- package/dist/author/defaults.d.ts +239 -0
- package/dist/author/defaults.d.ts.map +1 -0
- package/dist/author/defaults.js +339 -0
- package/dist/author/graphing-config.d.ts +34 -0
- package/dist/author/graphing-config.d.ts.map +1 -0
- package/dist/author/graphing-config.js +238 -0
- package/dist/author/index.d.ts +63 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +87 -0
- package/dist/author/utils.d.ts +47 -0
- package/dist/author/utils.d.ts.map +1 -0
- package/dist/author/utils.js +474 -0
- package/dist/controller/defaults.d.ts +65 -0
- package/dist/controller/defaults.d.ts.map +1 -0
- package/dist/controller/defaults.js +54 -0
- package/dist/controller/index.d.ts +25 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +112 -0
- package/dist/controller/utils.d.ts +21 -0
- package/dist/controller/utils.d.ts.map +1 -0
- package/dist/controller/utils.js +42 -0
- package/dist/delivery/index.d.ts +23 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +62 -0
- package/dist/delivery/main.d.ts +32 -0
- package/dist/delivery/main.d.ts.map +1 -0
- package/dist/delivery/main.js +198 -0
- package/dist/delivery/utils.d.ts +13 -0
- package/dist/delivery/utils.d.ts.map +1 -0
- package/dist/delivery/utils.js +220 -0
- package/dist/graphing-solution-set.css +2 -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 +373 -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/_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/_baseDifference.js +23 -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/_baseFlatten.js +13 -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/_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/_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/_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/_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/_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/_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/_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/_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/_isFlattenable.js +10 -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/_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/_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/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_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/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/differenceWith.js +12 -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/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/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/last.js +7 -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/noop.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/set.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniq.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniqWith.js +7 -0
- package/package.json +70 -0
- package/src/author/configure.tsx +266 -0
- package/src/author/correct-response.tsx +408 -0
- package/src/author/defaults.tsx +366 -0
- package/src/author/graphing-config.tsx +318 -0
- package/src/author/index.ts +176 -0
- package/src/author/utils.ts +577 -0
- package/src/controller/defaults.ts +72 -0
- package/src/controller/index.ts +313 -0
- package/src/controller/utils.ts +195 -0
- package/src/delivery/index.ts +159 -0
- package/src/delivery/main.tsx +361 -0
- package/src/delivery/utils.ts +465 -0
- package/src/index.iife.ts +16 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/graphing-solution-set/src/main.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 { GraphContainer } from '@pie-lib/graphing-solution-set';
|
|
15
|
+
import { color, Collapsible as CollapsibleImport, hasText, hasMedia, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';
|
|
16
|
+
|
|
17
|
+
function isRenderableReactInteropType(value: any) {
|
|
18
|
+
return (
|
|
19
|
+
typeof value === 'function' ||
|
|
20
|
+
(typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {
|
|
25
|
+
if (!maybeSymbol) return maybeSymbol;
|
|
26
|
+
if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;
|
|
27
|
+
if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;
|
|
28
|
+
if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {
|
|
29
|
+
return maybeSymbol[namedExport];
|
|
30
|
+
}
|
|
31
|
+
if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {
|
|
32
|
+
return maybeSymbol[namedExport].default;
|
|
33
|
+
}
|
|
34
|
+
return maybeSymbol;
|
|
35
|
+
}
|
|
36
|
+
const UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');
|
|
37
|
+
const PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');
|
|
38
|
+
const Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');
|
|
39
|
+
import * as RenderUiNamespace from '@pie-lib/render-ui';
|
|
40
|
+
const renderUiNamespaceAny = RenderUiNamespace as any;
|
|
41
|
+
const renderUiDefaultMaybe = renderUiNamespaceAny['default'];
|
|
42
|
+
const renderUi =
|
|
43
|
+
renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'
|
|
44
|
+
? renderUiDefaultMaybe
|
|
45
|
+
: renderUiNamespaceAny;
|
|
46
|
+
import CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';
|
|
47
|
+
import { findSectionsInSolutionSet, pointInsidePolygon, checkIfLinesAreAdded } from './utils.js';
|
|
48
|
+
import { AlertDialog } from '@pie-lib/config-ui';
|
|
49
|
+
|
|
50
|
+
const MainContainer: any = styled(UiLayout)({
|
|
51
|
+
color: color.text(),
|
|
52
|
+
backgroundColor: color.background(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const TeacherInstructions: any = styled(Collapsible)(({ theme }) => ({
|
|
56
|
+
marginBottom: theme.spacing(2),
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
const Graph: any = styled(GraphContainer)(({ theme }) => ({
|
|
60
|
+
marginTop: theme.spacing(2),
|
|
61
|
+
marginBottom: theme.spacing(2),
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
export class Main extends React.Component {
|
|
65
|
+
static propTypes = {
|
|
66
|
+
model: PropTypes.object.isRequired,
|
|
67
|
+
session: PropTypes.object.isRequired,
|
|
68
|
+
onAnswersChange: PropTypes.func,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
state = {
|
|
72
|
+
showingCorrect: false,
|
|
73
|
+
dialog: {
|
|
74
|
+
open: false,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Function to handle the AlertDialog
|
|
80
|
+
* @param {boolean} open - open state of the dialog
|
|
81
|
+
* @param {function} callback - callback function to be called after setting the state
|
|
82
|
+
* */
|
|
83
|
+
handleAlertDialog = (open, callback) =>
|
|
84
|
+
this.setState(
|
|
85
|
+
{
|
|
86
|
+
dialog: { open },
|
|
87
|
+
},
|
|
88
|
+
callback,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
* Function to toggle the correct answer
|
|
93
|
+
* @param {boolean} showingCorrect - state of the correct answer
|
|
94
|
+
* */
|
|
95
|
+
toggleCorrect = (showingCorrect) => this.setState({ showingCorrect });
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Reset the graph to original state
|
|
99
|
+
* */
|
|
100
|
+
onResetClick: any = () => {
|
|
101
|
+
const { model, session, setGssData } = this.props;
|
|
102
|
+
let { gssData } = model;
|
|
103
|
+
this.setState({
|
|
104
|
+
dialog: {
|
|
105
|
+
open: true,
|
|
106
|
+
title: 'Warning',
|
|
107
|
+
text: `This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?`,
|
|
108
|
+
onConfirm: () => {
|
|
109
|
+
// Reset the graph to original state
|
|
110
|
+
session.answer = [];
|
|
111
|
+
gssData.selectedTool = 'lineA';
|
|
112
|
+
gssData.lineA.lineType = 'Solid';
|
|
113
|
+
if (gssData.lineB) gssData.lineB.lineType = 'Solid';
|
|
114
|
+
// Set the gssData and session
|
|
115
|
+
setGssData(gssData, session);
|
|
116
|
+
this.handleAlertDialog(false);
|
|
117
|
+
},
|
|
118
|
+
onClose: () => this.handleAlertDialog(false),
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* Function to handle the event of solution set selected
|
|
125
|
+
* @param {object} point - point selected on the graph
|
|
126
|
+
* */
|
|
127
|
+
onSolutionSetSelected: any = (point) => {
|
|
128
|
+
const { model, session, setGssData } = this.props;
|
|
129
|
+
const { gssData, disabled } = model;
|
|
130
|
+
if (disabled) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
for (const section of gssData.sections) {
|
|
134
|
+
if (pointInsidePolygon(point, section)) {
|
|
135
|
+
let polygon = {
|
|
136
|
+
points: section,
|
|
137
|
+
building: false,
|
|
138
|
+
type: 'polygon',
|
|
139
|
+
closed: true,
|
|
140
|
+
isSolution: true,
|
|
141
|
+
};
|
|
142
|
+
session.answer = session.answer.filter((mark) => mark.type !== 'polygon');
|
|
143
|
+
session.answer.push(polygon);
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
setGssData(gssData, session);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/*
|
|
151
|
+
* Function to handle the event of change in GSS Line Data
|
|
152
|
+
* @param {object} gssData - GSS Line Data
|
|
153
|
+
* @param {string} oldSelectedTool - old selected tool
|
|
154
|
+
* */
|
|
155
|
+
onChangeGssLineData: any = (gssData, oldSelectedTool) => {
|
|
156
|
+
const { model, session } = this.props;
|
|
157
|
+
const { domain, range, disabled } = model;
|
|
158
|
+
if (disabled) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (gssData.selectedTool === 'solutionSet') {
|
|
162
|
+
let lines = session.answer.filter((mark) => mark.type !== 'polygon');
|
|
163
|
+
if (!checkIfLinesAreAdded(gssData, lines)) {
|
|
164
|
+
gssData.selectedTool = oldSelectedTool;
|
|
165
|
+
this.setState({
|
|
166
|
+
dialog: {
|
|
167
|
+
open: true,
|
|
168
|
+
title: 'Warning',
|
|
169
|
+
text: 'Please define the line(s) and then select a solution set for the item.',
|
|
170
|
+
onConfirm: () => this.handleAlertDialog(false),
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
} else {
|
|
174
|
+
let lines = session.answer.filter((mark) => mark.type !== 'polygon');
|
|
175
|
+
gssData = findSectionsInSolutionSet(gssData, lines, domain, range);
|
|
176
|
+
}
|
|
177
|
+
this.handleGssDataChange(gssData, session);
|
|
178
|
+
} else {
|
|
179
|
+
let polygons = session.answer.filter((mark) => mark.type === 'polygon');
|
|
180
|
+
if (oldSelectedTool === 'solutionSet' && polygons.length > 0) {
|
|
181
|
+
this.setState({
|
|
182
|
+
dialog: {
|
|
183
|
+
open: true,
|
|
184
|
+
title: 'Warning',
|
|
185
|
+
text: 'Changing a line after adding a solution set will clear your selected solution set. Click \'Clear Solution Set\' to change the line. Otherwise, click \'Cancel\'.',
|
|
186
|
+
onConfirm: () => {
|
|
187
|
+
session.answer = session.answer.filter((mark) => mark.type !== 'polygon');
|
|
188
|
+
this.handleGssDataChange(gssData, session);
|
|
189
|
+
this.handleAlertDialog(false);
|
|
190
|
+
},
|
|
191
|
+
onConfirmText: 'CLEAR SOLUTION SET',
|
|
192
|
+
onClose: () => {
|
|
193
|
+
gssData.selectedTool = oldSelectedTool;
|
|
194
|
+
this.handleGssDataChange(gssData, session);
|
|
195
|
+
this.handleAlertDialog(false);
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
this.handleGssDataChange(gssData, session);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/*
|
|
206
|
+
* Function to handle the event of change in GSS Data
|
|
207
|
+
* @param {object} gssData - GSS Data
|
|
208
|
+
* @param {object} session - session data
|
|
209
|
+
* */
|
|
210
|
+
handleGssDataChange: any = (gssData, session) => {
|
|
211
|
+
const { setGssData } = this.props;
|
|
212
|
+
if (session.answer && session.answer.length > 0 && session.answer[0] && gssData.lineA) {
|
|
213
|
+
session.answer[0].fill = gssData.lineA.lineType;
|
|
214
|
+
}
|
|
215
|
+
if (session.answer && session.answer.length > 1 && session.answer[1] && gssData.lineB) {
|
|
216
|
+
session.answer[1].fill = gssData.lineB.lineType;
|
|
217
|
+
}
|
|
218
|
+
if (
|
|
219
|
+
(gssData.selectedTool === 'lineB' && session.answer.length === 0) ||
|
|
220
|
+
(gssData.selectedTool === 'lineB' && session.answer[0].building)
|
|
221
|
+
) {
|
|
222
|
+
this.setState({
|
|
223
|
+
dialog: {
|
|
224
|
+
open: true,
|
|
225
|
+
title: 'Warning',
|
|
226
|
+
text: 'Please add Line A to the graph before adding Line B',
|
|
227
|
+
onConfirm: () => this.handleAlertDialog(false),
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
gssData.selectedTool = 'lineA';
|
|
231
|
+
}
|
|
232
|
+
if (gssData.selectedTool === 'lineA' && session.answer.length > 1 && session.answer[1].building) {
|
|
233
|
+
this.setState({
|
|
234
|
+
dialog: {
|
|
235
|
+
open: true,
|
|
236
|
+
title: 'Warning',
|
|
237
|
+
text: 'Please add Line B to the graph before switching to Line A',
|
|
238
|
+
onConfirm: () => this.handleAlertDialog(false),
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
gssData.selectedTool = 'lineB';
|
|
242
|
+
}
|
|
243
|
+
setGssData(gssData, session);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/*
|
|
247
|
+
* Render the component
|
|
248
|
+
* */
|
|
249
|
+
render() {
|
|
250
|
+
const { model, onAnswersChange, session } = this.props;
|
|
251
|
+
const { showingCorrect, dialog } = this.state;
|
|
252
|
+
const { answer } = session || {};
|
|
253
|
+
const {
|
|
254
|
+
answersCorrected,
|
|
255
|
+
arrows,
|
|
256
|
+
coordinatesOnHover,
|
|
257
|
+
correctResponse,
|
|
258
|
+
defaultTool,
|
|
259
|
+
disabled,
|
|
260
|
+
domain,
|
|
261
|
+
extraCSSRules,
|
|
262
|
+
labels,
|
|
263
|
+
labelsEnabled,
|
|
264
|
+
prompt,
|
|
265
|
+
range,
|
|
266
|
+
rationale,
|
|
267
|
+
size,
|
|
268
|
+
showToggle,
|
|
269
|
+
title,
|
|
270
|
+
titleEnabled,
|
|
271
|
+
teacherInstructions,
|
|
272
|
+
language,
|
|
273
|
+
gssLineData,
|
|
274
|
+
gssData,
|
|
275
|
+
} = model || {};
|
|
276
|
+
const marks = answersCorrected || answer || [];
|
|
277
|
+
const showRationale = model.rationale && (hasText(model.rationale) || hasMedia(model.rationale));
|
|
278
|
+
const showTeacherInstructions =
|
|
279
|
+
model.teacherInstructions && (hasText(model.teacherInstructions) || hasMedia(model.teacherInstructions));
|
|
280
|
+
return (
|
|
281
|
+
<MainContainer extraCSSRules={extraCSSRules}>
|
|
282
|
+
{showTeacherInstructions && (
|
|
283
|
+
<TeacherInstructions
|
|
284
|
+
labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}
|
|
285
|
+
>
|
|
286
|
+
<PreviewPrompt prompt={teacherInstructions} />
|
|
287
|
+
</TeacherInstructions>
|
|
288
|
+
)}
|
|
289
|
+
{prompt && <PreviewPrompt className="prompt" prompt={prompt} />}
|
|
290
|
+
<CorrectAnswerToggle
|
|
291
|
+
show={showToggle}
|
|
292
|
+
toggled={showingCorrect}
|
|
293
|
+
onToggle={this.toggleCorrect}
|
|
294
|
+
language={language}
|
|
295
|
+
/>
|
|
296
|
+
{showingCorrect && showToggle ? (
|
|
297
|
+
<Graph
|
|
298
|
+
axesSettings={{ includeArrows: arrows }}
|
|
299
|
+
coordinatesOnHover={coordinatesOnHover}
|
|
300
|
+
disabled={true}
|
|
301
|
+
disabledLabels={true}
|
|
302
|
+
disabledTitle={true}
|
|
303
|
+
domain={domain}
|
|
304
|
+
labels={labels}
|
|
305
|
+
marks={correctResponse.map((i) => ({ ...i, correctness: 'correct' }))}
|
|
306
|
+
onChangeMarks={onAnswersChange}
|
|
307
|
+
range={range}
|
|
308
|
+
showLabels={labelsEnabled}
|
|
309
|
+
showTitle={titleEnabled}
|
|
310
|
+
size={size}
|
|
311
|
+
title={title}
|
|
312
|
+
language={language}
|
|
313
|
+
gssLineData={gssLineData}
|
|
314
|
+
onChangeGssLineData={this.onChangeGssLineData}
|
|
315
|
+
onSolutionSetSelected={this.onSolutionSetSelected}
|
|
316
|
+
toolbarTools={['line', 'polygon']}
|
|
317
|
+
/>
|
|
318
|
+
) : (
|
|
319
|
+
<Graph
|
|
320
|
+
axesSettings={{ includeArrows: arrows }}
|
|
321
|
+
coordinatesOnHover={coordinatesOnHover}
|
|
322
|
+
defaultTool={defaultTool}
|
|
323
|
+
disabled={disabled}
|
|
324
|
+
disabledLabels={true}
|
|
325
|
+
disabledTitle={true}
|
|
326
|
+
domain={domain}
|
|
327
|
+
labels={labels}
|
|
328
|
+
marks={marks}
|
|
329
|
+
onChangeMarks={onAnswersChange}
|
|
330
|
+
onCustomReset={this.onResetClick}
|
|
331
|
+
range={range}
|
|
332
|
+
showLabels={labelsEnabled}
|
|
333
|
+
showTitle={titleEnabled}
|
|
334
|
+
size={size}
|
|
335
|
+
title={title}
|
|
336
|
+
language={language}
|
|
337
|
+
gssLineData={gssData}
|
|
338
|
+
onChangeGssLineData={this.onChangeGssLineData}
|
|
339
|
+
onSolutionSetSelected={this.onSolutionSetSelected}
|
|
340
|
+
toolbarTools={['line', 'polygon']}
|
|
341
|
+
/>
|
|
342
|
+
)}
|
|
343
|
+
{showRationale && (
|
|
344
|
+
<Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>
|
|
345
|
+
<PreviewPrompt prompt={rationale} />
|
|
346
|
+
</Collapsible>
|
|
347
|
+
)}
|
|
348
|
+
<AlertDialog
|
|
349
|
+
open={dialog.open}
|
|
350
|
+
title={dialog.title}
|
|
351
|
+
text={dialog.text}
|
|
352
|
+
onClose={dialog.onClose}
|
|
353
|
+
onConfirm={dialog.onConfirm}
|
|
354
|
+
onConfirmText={dialog.onConfirmText ? dialog.onConfirmText : 'OK'}
|
|
355
|
+
/>
|
|
356
|
+
</MainContainer>
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export default Main;
|