@pie-element/drawing-response 12.1.1-next.0 → 12.1.1-next.29
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/CHANGELOG.json +547 -0
- package/CHANGELOG.md +1956 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/configure/CHANGELOG.json +367 -0
- package/configure/CHANGELOG.md +1756 -0
- package/configure/lib/button.js +37 -0
- package/configure/lib/button.js.map +1 -0
- package/configure/lib/defaults.js +116 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/image-container.js +307 -0
- package/configure/lib/image-container.js.map +1 -0
- package/configure/lib/index.js +147 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/root.js +219 -0
- package/configure/lib/root.js.map +1 -0
- package/configure/package.json +24 -0
- package/configure/src/__tests__/image-container.test.jsx +231 -0
- package/configure/src/__tests__/index.test.js +72 -0
- package/configure/src/__tests__/root.test.jsx +110 -0
- package/configure/src/button.jsx +33 -0
- package/configure/src/defaults.js +80 -0
- package/configure/src/image-container.jsx +316 -0
- package/configure/src/index.js +167 -0
- package/configure/src/root.jsx +198 -0
- package/controller/CHANGELOG.json +52 -0
- package/controller/CHANGELOG.md +257 -0
- package/controller/lib/defaults.js +22 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +84 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +16 -0
- package/controller/src/__tests__/index.test.js +172 -0
- package/controller/src/defaults.js +12 -0
- package/controller/src/index.js +71 -0
- package/docs/config-schema.json +1766 -0
- package/docs/config-schema.json.md +1313 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +14 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +37 -0
- package/docs/pie-schema.json +823 -0
- package/docs/pie-schema.json.md +606 -0
- package/lib/drawing-response/button.js +49 -0
- package/lib/drawing-response/button.js.map +1 -0
- package/lib/drawing-response/constants.js +43 -0
- package/lib/drawing-response/constants.js.map +1 -0
- package/lib/drawing-response/container.js +327 -0
- package/lib/drawing-response/container.js.map +1 -0
- package/lib/drawing-response/drawable-circle.js +80 -0
- package/lib/drawing-response/drawable-circle.js.map +1 -0
- package/lib/drawing-response/drawable-eraser.js +64 -0
- package/lib/drawing-response/drawable-eraser.js.map +1 -0
- package/lib/drawing-response/drawable-free-path.js +71 -0
- package/lib/drawing-response/drawable-free-path.js.map +1 -0
- package/lib/drawing-response/drawable-helper.js +34 -0
- package/lib/drawing-response/drawable-helper.js.map +1 -0
- package/lib/drawing-response/drawable-image.js +41 -0
- package/lib/drawing-response/drawable-image.js.map +1 -0
- package/lib/drawing-response/drawable-line.js +75 -0
- package/lib/drawing-response/drawable-line.js.map +1 -0
- package/lib/drawing-response/drawable-main.js +345 -0
- package/lib/drawing-response/drawable-main.js.map +1 -0
- package/lib/drawing-response/drawable-palette.js +140 -0
- package/lib/drawing-response/drawable-palette.js.map +1 -0
- package/lib/drawing-response/drawable-rectangle.js +80 -0
- package/lib/drawing-response/drawable-rectangle.js.map +1 -0
- package/lib/drawing-response/drawable-text.js +295 -0
- package/lib/drawing-response/drawable-text.js.map +1 -0
- package/lib/drawing-response/drawable-transformer.js +52 -0
- package/lib/drawing-response/drawable-transformer.js.map +1 -0
- package/lib/drawing-response/factory.js +22 -0
- package/lib/drawing-response/factory.js.map +1 -0
- package/lib/drawing-response/icon.js +55 -0
- package/lib/drawing-response/icon.js.map +1 -0
- package/lib/drawing-response/index.js +91 -0
- package/lib/drawing-response/index.js.map +1 -0
- package/lib/index.js +68 -0
- package/lib/index.js.map +1 -0
- package/package.json +19 -55
- package/src/__tests__/drawing-index-test.jsx +103 -0
- package/src/drawing-response/__tests__/container.test.jsx +82 -0
- package/src/drawing-response/__tests__/drawable-helper.test.jsx +24 -0
- package/src/drawing-response/__tests__/drawing-main.test.jsx +855 -0
- package/src/drawing-response/__tests__/factory.test.js +13 -0
- package/src/drawing-response/button.jsx +45 -0
- package/src/drawing-response/constants.js +44 -0
- package/src/drawing-response/container.jsx +301 -0
- package/src/drawing-response/drawable-circle.jsx +74 -0
- package/src/drawing-response/drawable-eraser.jsx +53 -0
- package/src/drawing-response/drawable-free-path.jsx +59 -0
- package/src/drawing-response/drawable-helper.jsx +21 -0
- package/src/drawing-response/drawable-image.jsx +36 -0
- package/src/drawing-response/drawable-line.jsx +62 -0
- package/src/drawing-response/drawable-main.jsx +333 -0
- package/src/drawing-response/drawable-palette.jsx +99 -0
- package/src/drawing-response/drawable-rectangle.jsx +69 -0
- package/src/drawing-response/drawable-text.jsx +318 -0
- package/src/drawing-response/drawable-transformer.jsx +52 -0
- package/src/drawing-response/factory.js +17 -0
- package/src/drawing-response/icon.jsx +52 -0
- package/src/drawing-response/index.jsx +92 -0
- package/src/index.js +72 -0
- package/dist/author/button.d.ts +0 -29
- package/dist/author/button.js +0 -25
- package/dist/author/defaults.d.ts +0 -118
- package/dist/author/defaults.js +0 -86
- package/dist/author/image-container.d.ts +0 -42
- package/dist/author/image-container.js +0 -183
- package/dist/author/index.d.ts +0 -37
- package/dist/author/index.js +0 -79
- package/dist/author/root.d.ts +0 -17
- package/dist/author/root.js +0 -142
- package/dist/controller/defaults.d.ts +0 -24
- package/dist/controller/defaults.js +0 -18
- package/dist/controller/index.d.ts +0 -13
- package/dist/controller/index.js +0 -46
- package/dist/delivery/drawing-response/button.d.ts +0 -31
- package/dist/delivery/drawing-response/button.js +0 -36
- package/dist/delivery/drawing-response/constants.d.ts +0 -16
- package/dist/delivery/drawing-response/constants.js +0 -40
- package/dist/delivery/drawing-response/container.d.ts +0 -32
- package/dist/delivery/drawing-response/container.js +0 -212
- package/dist/delivery/drawing-response/drawable-circle.d.ts +0 -18
- package/dist/delivery/drawing-response/drawable-circle.js +0 -51
- package/dist/delivery/drawing-response/drawable-eraser.d.ts +0 -17
- package/dist/delivery/drawing-response/drawable-eraser.js +0 -52
- package/dist/delivery/drawing-response/drawable-free-path.d.ts +0 -18
- package/dist/delivery/drawing-response/drawable-free-path.js +0 -52
- package/dist/delivery/drawing-response/drawable-helper.d.ts +0 -17
- package/dist/delivery/drawing-response/drawable-helper.js +0 -12
- package/dist/delivery/drawing-response/drawable-image.d.ts +0 -24
- package/dist/delivery/drawing-response/drawable-image.js +0 -28
- package/dist/delivery/drawing-response/drawable-line.d.ts +0 -18
- package/dist/delivery/drawing-response/drawable-line.js +0 -53
- package/dist/delivery/drawing-response/drawable-main.d.ts +0 -25
- package/dist/delivery/drawing-response/drawable-main.js +0 -212
- package/dist/delivery/drawing-response/drawable-palette.d.ts +0 -14
- package/dist/delivery/drawing-response/drawable-palette.js +0 -89
- package/dist/delivery/drawing-response/drawable-rectangle.d.ts +0 -18
- package/dist/delivery/drawing-response/drawable-rectangle.js +0 -49
- package/dist/delivery/drawing-response/drawable-text.d.ts +0 -30
- package/dist/delivery/drawing-response/drawable-text.js +0 -189
- package/dist/delivery/drawing-response/drawable-transformer.d.ts +0 -16
- package/dist/delivery/drawing-response/drawable-transformer.js +0 -35
- package/dist/delivery/drawing-response/factory.d.ts +0 -11
- package/dist/delivery/drawing-response/factory.js +0 -19
- package/dist/delivery/drawing-response/icon.d.ts +0 -19
- package/dist/delivery/drawing-response/icon.js +0 -52
- package/dist/delivery/drawing-response/index.d.ts +0 -18
- package/dist/delivery/drawing-response/index.js +0 -70
- package/dist/delivery/index.d.ts +0 -19
- package/dist/delivery/index.js +0 -47
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -165
- package/dist/index.js +0 -2
- 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/_arrayFilter.js +0 -10
- 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/_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/_baseFlatten.js +0 -13
- 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/_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/_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/_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/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.js +0 -9
- 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/_baseUnset.js +0 -19
- 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/_customOmitClone.js +0 -7
- 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/_flatRest.js +0 -9
- 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/_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/_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/_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/_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/_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/_parent.js +0 -8
- 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/_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/_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/cloneDeep.js +0 -8
- 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/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/flatten.js +0 -7
- 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/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/isPlainObject.js +0 -14
- 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/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/omit.js +0 -21
- 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
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { model, outcome } from '../index';
|
|
2
|
+
|
|
3
|
+
describe('controller', () => {
|
|
4
|
+
let result, question, session, env;
|
|
5
|
+
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
question = {
|
|
8
|
+
prompt: 'This is the question prompt',
|
|
9
|
+
promptEnabled: true,
|
|
10
|
+
imageUrl: '',
|
|
11
|
+
imageDimensions: {
|
|
12
|
+
height: 0,
|
|
13
|
+
width: 0,
|
|
14
|
+
},
|
|
15
|
+
teacherInstructions: 'Teacher Instructions',
|
|
16
|
+
backgroundImageEnabled: true,
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('outcome', () => {
|
|
21
|
+
it('returns score of 0', async () => {
|
|
22
|
+
const result = await outcome(question);
|
|
23
|
+
expect(result.score).toEqual(0);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('model', () => {
|
|
28
|
+
describe('mode: gather', () => {
|
|
29
|
+
beforeEach(async () => {
|
|
30
|
+
session = {};
|
|
31
|
+
env = { mode: 'gather' };
|
|
32
|
+
result = await model(question, session, env);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('returns mode', () => {
|
|
36
|
+
expect(result.mode).toEqual('gather');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('returns prompt', () => {
|
|
40
|
+
expect(result.prompt).toEqual('This is the question prompt');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('returns imageDimensions', () => {
|
|
44
|
+
expect(result.imageDimensions).toEqual({ height: 0, width: 0 });
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('does not return responseCorrect', () => {
|
|
48
|
+
expect(result.responseCorrect).toBe(undefined);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('gather mode promptEnabled: true', async () => {
|
|
52
|
+
result = await model(question, {}, { mode: 'gather' });
|
|
53
|
+
|
|
54
|
+
expect(result).toEqual({
|
|
55
|
+
disabled: false,
|
|
56
|
+
mode: 'gather',
|
|
57
|
+
imageUrl: question.imageUrl,
|
|
58
|
+
imageDimensions: question.imageDimensions,
|
|
59
|
+
prompt: question.prompt,
|
|
60
|
+
teacherInstructions: null,
|
|
61
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('gather mode promptEnabled: false', async () => {
|
|
66
|
+
result = await model({ ...question, promptEnabled: false }, {}, { mode: 'gather' });
|
|
67
|
+
|
|
68
|
+
expect(result).toEqual({
|
|
69
|
+
disabled: false,
|
|
70
|
+
mode: 'gather',
|
|
71
|
+
imageUrl: question.imageUrl,
|
|
72
|
+
imageDimensions: question.imageDimensions,
|
|
73
|
+
prompt: null,
|
|
74
|
+
teacherInstructions: null,
|
|
75
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('view mode, student role', async () => {
|
|
80
|
+
result = await model(question, {}, { mode: 'view' });
|
|
81
|
+
|
|
82
|
+
expect(result).toEqual({
|
|
83
|
+
disabled: true,
|
|
84
|
+
mode: 'view',
|
|
85
|
+
imageUrl: question.imageUrl,
|
|
86
|
+
imageDimensions: question.imageDimensions,
|
|
87
|
+
prompt: question.prompt,
|
|
88
|
+
teacherInstructions: null,
|
|
89
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('view mode, instructor role and teacherInstructions enabled', async () => {
|
|
94
|
+
result = await model(question, {}, { mode: 'view', role: 'instructor' });
|
|
95
|
+
|
|
96
|
+
expect(result).toEqual({
|
|
97
|
+
disabled: true,
|
|
98
|
+
mode: 'view',
|
|
99
|
+
imageUrl: question.imageUrl,
|
|
100
|
+
imageDimensions: question.imageDimensions,
|
|
101
|
+
prompt: question.prompt,
|
|
102
|
+
teacherInstructions: question.teacherInstructions,
|
|
103
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('evaluate mode, instructor role and teacherInstructions disabled', async () => {
|
|
108
|
+
result = await model(
|
|
109
|
+
{ ...question, teacherInstructionsEnabled: false },
|
|
110
|
+
{},
|
|
111
|
+
{ mode: 'evaluate', role: 'instructor' },
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
expect(result).toEqual({
|
|
115
|
+
disabled: true,
|
|
116
|
+
mode: 'evaluate',
|
|
117
|
+
imageUrl: question.imageUrl,
|
|
118
|
+
imageDimensions: question.imageDimensions,
|
|
119
|
+
prompt: question.prompt,
|
|
120
|
+
teacherInstructions: null,
|
|
121
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('evaluate mode, student role', async () => {
|
|
126
|
+
result = await model(question, {}, { mode: 'evaluate' });
|
|
127
|
+
|
|
128
|
+
expect(result).toEqual({
|
|
129
|
+
disabled: true,
|
|
130
|
+
mode: 'evaluate',
|
|
131
|
+
imageUrl: question.imageUrl,
|
|
132
|
+
imageDimensions: question.imageDimensions,
|
|
133
|
+
prompt: question.prompt,
|
|
134
|
+
teacherInstructions: null,
|
|
135
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('evaluate mode, instructor role and teacherInstructions enabled', async () => {
|
|
140
|
+
result = await model(question, {}, { mode: 'evaluate', role: 'instructor' });
|
|
141
|
+
|
|
142
|
+
expect(result).toEqual({
|
|
143
|
+
disabled: true,
|
|
144
|
+
mode: 'evaluate',
|
|
145
|
+
imageUrl: question.imageUrl,
|
|
146
|
+
imageDimensions: question.imageDimensions,
|
|
147
|
+
prompt: question.prompt,
|
|
148
|
+
teacherInstructions: question.teacherInstructions,
|
|
149
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('view mode, instructor role and teacherInstructions disabled', async () => {
|
|
154
|
+
result = await model(
|
|
155
|
+
{ ...question, teacherInstructionsEnabled: false },
|
|
156
|
+
{},
|
|
157
|
+
{ mode: 'view', role: 'instructor' },
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
expect(result).toEqual({
|
|
161
|
+
disabled: true,
|
|
162
|
+
mode: 'view',
|
|
163
|
+
imageUrl: question.imageUrl,
|
|
164
|
+
imageDimensions: question.imageDimensions,
|
|
165
|
+
prompt: question.prompt,
|
|
166
|
+
teacherInstructions: null,
|
|
167
|
+
backgroundImageEnabled: question.backgroundImageEnabled,
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
backgroundImageEnabled: true,
|
|
3
|
+
imageDimensions: { height: 0, width: 0 },
|
|
4
|
+
imageUrl: '',
|
|
5
|
+
prompt: '',
|
|
6
|
+
promptEnabled: true,
|
|
7
|
+
spellCheckEnabled: true,
|
|
8
|
+
studentInstructionsEnabled: true,
|
|
9
|
+
teacherInstructions: '',
|
|
10
|
+
teacherInstructionsEnabled: true,
|
|
11
|
+
toolbarEditorPosition: 'bottom',
|
|
12
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import debug from 'debug';
|
|
2
|
+
import defaults from './defaults';
|
|
3
|
+
|
|
4
|
+
const log = debug('pie-elements:drawing-response:controller');
|
|
5
|
+
|
|
6
|
+
export const normalize = (question) => ({ ...defaults, ...question });
|
|
7
|
+
|
|
8
|
+
export function model(question, session, env) {
|
|
9
|
+
const normalizedQuestion = normalize(question);
|
|
10
|
+
const { extraCSSRules, imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled, language } = normalizedQuestion;
|
|
11
|
+
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
const out = {
|
|
14
|
+
disabled: env.mode !== 'gather',
|
|
15
|
+
mode: env.mode,
|
|
16
|
+
imageDimensions,
|
|
17
|
+
imageUrl,
|
|
18
|
+
prompt: promptEnabled ? prompt : null,
|
|
19
|
+
backgroundImageEnabled,
|
|
20
|
+
language,
|
|
21
|
+
extraCSSRules,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
25
|
+
out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled
|
|
26
|
+
? normalizedQuestion.teacherInstructions
|
|
27
|
+
: null;
|
|
28
|
+
} else {
|
|
29
|
+
out.teacherInstructions = null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
resolve(out);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const createDefaultModel = (model = {}) =>
|
|
37
|
+
new Promise((resolve) => {
|
|
38
|
+
resolve({
|
|
39
|
+
...defaults,
|
|
40
|
+
...model,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export function outcome(/*config, session*/) {
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
log('outcome...');
|
|
47
|
+
resolve({
|
|
48
|
+
score: 0,
|
|
49
|
+
completed: 'n/a',
|
|
50
|
+
note: 'Requires manual scoring',
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// remove all html tags
|
|
56
|
+
const getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');
|
|
57
|
+
|
|
58
|
+
// remove all html tags except img, iframe and source tag for audio
|
|
59
|
+
const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
60
|
+
|
|
61
|
+
export const validate = (model = {}, config = {}) => {
|
|
62
|
+
const errors = {};
|
|
63
|
+
|
|
64
|
+
['teacherInstructions', 'prompt'].forEach((field) => {
|
|
65
|
+
if (config[field]?.required && !getContent(model[field])) {
|
|
66
|
+
errors[field] = 'This field is required.';
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return errors;
|
|
71
|
+
};
|