@pie-element/drawing-response 12.1.0-next.19 → 12.1.1-next.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/button.d.ts +29 -0
- package/dist/author/button.js +25 -0
- package/dist/author/defaults.d.ts +118 -0
- package/dist/author/defaults.js +86 -0
- package/dist/author/image-container.d.ts +42 -0
- package/dist/author/image-container.js +183 -0
- package/dist/author/index.d.ts +37 -0
- package/dist/author/index.js +79 -0
- package/dist/author/root.d.ts +17 -0
- package/dist/author/root.js +142 -0
- package/dist/controller/defaults.d.ts +24 -0
- package/dist/controller/defaults.js +18 -0
- package/dist/controller/index.d.ts +13 -0
- package/dist/controller/index.js +46 -0
- package/dist/delivery/drawing-response/button.d.ts +31 -0
- package/dist/delivery/drawing-response/button.js +36 -0
- package/dist/delivery/drawing-response/constants.d.ts +16 -0
- package/dist/delivery/drawing-response/constants.js +40 -0
- package/dist/delivery/drawing-response/container.d.ts +32 -0
- package/dist/delivery/drawing-response/container.js +212 -0
- package/dist/delivery/drawing-response/drawable-circle.d.ts +18 -0
- package/dist/delivery/drawing-response/drawable-circle.js +51 -0
- package/dist/delivery/drawing-response/drawable-eraser.d.ts +17 -0
- package/dist/delivery/drawing-response/drawable-eraser.js +52 -0
- package/dist/delivery/drawing-response/drawable-free-path.d.ts +18 -0
- package/dist/delivery/drawing-response/drawable-free-path.js +52 -0
- package/dist/delivery/drawing-response/drawable-helper.d.ts +17 -0
- package/dist/delivery/drawing-response/drawable-helper.js +12 -0
- package/dist/delivery/drawing-response/drawable-image.d.ts +24 -0
- package/dist/delivery/drawing-response/drawable-image.js +28 -0
- package/dist/delivery/drawing-response/drawable-line.d.ts +18 -0
- package/dist/delivery/drawing-response/drawable-line.js +53 -0
- package/dist/delivery/drawing-response/drawable-main.d.ts +25 -0
- package/dist/delivery/drawing-response/drawable-main.js +212 -0
- package/dist/delivery/drawing-response/drawable-palette.d.ts +14 -0
- package/dist/delivery/drawing-response/drawable-palette.js +89 -0
- package/dist/delivery/drawing-response/drawable-rectangle.d.ts +18 -0
- package/dist/delivery/drawing-response/drawable-rectangle.js +49 -0
- package/dist/delivery/drawing-response/drawable-text.d.ts +30 -0
- package/dist/delivery/drawing-response/drawable-text.js +189 -0
- package/dist/delivery/drawing-response/drawable-transformer.d.ts +16 -0
- package/dist/delivery/drawing-response/drawable-transformer.js +35 -0
- package/dist/delivery/drawing-response/factory.d.ts +11 -0
- package/dist/delivery/drawing-response/factory.js +19 -0
- package/dist/delivery/drawing-response/icon.d.ts +19 -0
- package/dist/delivery/drawing-response/icon.js +52 -0
- package/dist/delivery/drawing-response/index.d.ts +18 -0
- package/dist/delivery/drawing-response/index.js +70 -0
- package/dist/delivery/index.d.ts +19 -0
- package/dist/delivery/index.js +47 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +165 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.js +19 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_parent.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/flatten.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/omit.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +7 -0
- package/package.json +56 -20
- package/CHANGELOG.json +0 -547
- package/CHANGELOG.md +0 -1948
- package/LICENSE.md +0 -5
- package/README.md +0 -1
- package/configure/CHANGELOG.json +0 -367
- package/configure/CHANGELOG.md +0 -1749
- package/configure/lib/button.js +0 -37
- package/configure/lib/button.js.map +0 -1
- package/configure/lib/defaults.js +0 -116
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/image-container.js +0 -307
- package/configure/lib/image-container.js.map +0 -1
- package/configure/lib/index.js +0 -147
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/root.js +0 -219
- package/configure/lib/root.js.map +0 -1
- package/configure/package.json +0 -24
- package/configure/src/__tests__/image-container.test.jsx +0 -231
- package/configure/src/__tests__/index.test.js +0 -72
- package/configure/src/__tests__/root.test.jsx +0 -110
- package/configure/src/button.jsx +0 -33
- package/configure/src/defaults.js +0 -80
- package/configure/src/image-container.jsx +0 -316
- package/configure/src/index.js +0 -167
- package/configure/src/root.jsx +0 -198
- package/controller/CHANGELOG.json +0 -52
- package/controller/CHANGELOG.md +0 -253
- package/controller/lib/defaults.js +0 -22
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -84
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -16
- package/controller/src/__tests__/index.test.js +0 -172
- package/controller/src/defaults.js +0 -12
- package/controller/src/index.js +0 -71
- package/docs/config-schema.json +0 -1766
- package/docs/config-schema.json.md +0 -1313
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -14
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -37
- package/docs/pie-schema.json +0 -823
- package/docs/pie-schema.json.md +0 -606
- package/lib/drawing-response/button.js +0 -49
- package/lib/drawing-response/button.js.map +0 -1
- package/lib/drawing-response/constants.js +0 -43
- package/lib/drawing-response/constants.js.map +0 -1
- package/lib/drawing-response/container.js +0 -327
- package/lib/drawing-response/container.js.map +0 -1
- package/lib/drawing-response/drawable-circle.js +0 -80
- package/lib/drawing-response/drawable-circle.js.map +0 -1
- package/lib/drawing-response/drawable-eraser.js +0 -64
- package/lib/drawing-response/drawable-eraser.js.map +0 -1
- package/lib/drawing-response/drawable-free-path.js +0 -71
- package/lib/drawing-response/drawable-free-path.js.map +0 -1
- package/lib/drawing-response/drawable-helper.js +0 -34
- package/lib/drawing-response/drawable-helper.js.map +0 -1
- package/lib/drawing-response/drawable-image.js +0 -41
- package/lib/drawing-response/drawable-image.js.map +0 -1
- package/lib/drawing-response/drawable-line.js +0 -75
- package/lib/drawing-response/drawable-line.js.map +0 -1
- package/lib/drawing-response/drawable-main.js +0 -345
- package/lib/drawing-response/drawable-main.js.map +0 -1
- package/lib/drawing-response/drawable-palette.js +0 -140
- package/lib/drawing-response/drawable-palette.js.map +0 -1
- package/lib/drawing-response/drawable-rectangle.js +0 -80
- package/lib/drawing-response/drawable-rectangle.js.map +0 -1
- package/lib/drawing-response/drawable-text.js +0 -295
- package/lib/drawing-response/drawable-text.js.map +0 -1
- package/lib/drawing-response/drawable-transformer.js +0 -52
- package/lib/drawing-response/drawable-transformer.js.map +0 -1
- package/lib/drawing-response/factory.js +0 -22
- package/lib/drawing-response/factory.js.map +0 -1
- package/lib/drawing-response/icon.js +0 -55
- package/lib/drawing-response/icon.js.map +0 -1
- package/lib/drawing-response/index.js +0 -91
- package/lib/drawing-response/index.js.map +0 -1
- package/lib/index.js +0 -68
- package/lib/index.js.map +0 -1
- package/src/__tests__/drawing-index-test.jsx +0 -103
- package/src/drawing-response/__tests__/container.test.jsx +0 -82
- package/src/drawing-response/__tests__/drawable-helper.test.jsx +0 -24
- package/src/drawing-response/__tests__/drawing-main.test.jsx +0 -855
- package/src/drawing-response/__tests__/factory.test.js +0 -13
- package/src/drawing-response/button.jsx +0 -45
- package/src/drawing-response/constants.js +0 -44
- package/src/drawing-response/container.jsx +0 -301
- package/src/drawing-response/drawable-circle.jsx +0 -74
- package/src/drawing-response/drawable-eraser.jsx +0 -53
- package/src/drawing-response/drawable-free-path.jsx +0 -59
- package/src/drawing-response/drawable-helper.jsx +0 -21
- package/src/drawing-response/drawable-image.jsx +0 -36
- package/src/drawing-response/drawable-line.jsx +0 -62
- package/src/drawing-response/drawable-main.jsx +0 -333
- package/src/drawing-response/drawable-palette.jsx +0 -99
- package/src/drawing-response/drawable-rectangle.jsx +0 -69
- package/src/drawing-response/drawable-text.jsx +0 -318
- package/src/drawing-response/drawable-transformer.jsx +0 -52
- package/src/drawing-response/factory.js +0 -17
- package/src/drawing-response/icon.jsx +0 -52
- package/src/drawing-response/index.jsx +0 -92
- package/src/index.js +0 -72
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js";
|
|
2
|
+
import t from "./image-container.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { styled as o } from "@mui/material/styles";
|
|
7
|
+
import { InputContainer as s, layout as c, settings as l } from "@pie-lib/config-ui";
|
|
8
|
+
import u from "@pie-lib/editable-html-tip-tap";
|
|
9
|
+
import d from "@mui/material/Typography";
|
|
10
|
+
//#region src/author/root.tsx
|
|
11
|
+
var { Panel: f, toggle: p, dropdown: m } = l, h = o(s)(({ theme: e }) => ({
|
|
12
|
+
paddingTop: e.spacing(1),
|
|
13
|
+
marginTop: e.spacing(2),
|
|
14
|
+
marginBottom: e.spacing(1),
|
|
15
|
+
width: "100%"
|
|
16
|
+
})), g = o("div")(({ theme: e }) => ({
|
|
17
|
+
fontSize: e.typography.fontSize - 2,
|
|
18
|
+
color: e.palette.error.main,
|
|
19
|
+
paddingTop: e.spacing(1)
|
|
20
|
+
})), _ = class extends n.Component {
|
|
21
|
+
onPromptChanged = (t) => {
|
|
22
|
+
let { model: n, onModelChanged: r } = this.props;
|
|
23
|
+
r({
|
|
24
|
+
...e(n),
|
|
25
|
+
prompt: t
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
onTeacherInstructionsChanged = (e) => {
|
|
29
|
+
let { model: t, onModelChanged: n } = this.props;
|
|
30
|
+
n({
|
|
31
|
+
...t,
|
|
32
|
+
teacherInstructions: e
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
onUpdateImageDimension = (e) => {
|
|
36
|
+
let { model: t, onModelChanged: n } = this.props;
|
|
37
|
+
n({
|
|
38
|
+
...t,
|
|
39
|
+
imageDimensions: e
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
onImageUpload = (e) => {
|
|
43
|
+
let { model: t, onModelChanged: n } = this.props;
|
|
44
|
+
n({
|
|
45
|
+
...t,
|
|
46
|
+
imageUrl: e
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
render() {
|
|
50
|
+
let { configuration: e, imageSupport: r, model: o, onConfigurationChanged: s, onModelChanged: l, uploadSoundSupport: _ } = this.props, { baseInputConfiguration: v = {}, backgroundImage: y = {}, contentDimensions: b = {}, maxImageWidth: x = {}, maxImageHeight: S = {}, prompt: C = {}, settingsPanelDisabled: w, spellCheck: T = {}, teacherInstructions: E = {}, withRubric: D = {}, language: O = {}, languageChoices: k = {}, mathMlOptions: A = {} } = e || {}, { backgroundImageEnabled: j, errors: M = {}, extraCSSRules: N, promptEnabled: P, spellCheckEnabled: F, teacherInstructionsEnabled: I, toolbarEditorPosition: L } = o || {}, { prompt: R, teacherInstructions: z } = M, B = x && x.prompt, V = S && S.prompt, H = { position: L === "top" ? "top" : "bottom" }, U = {
|
|
51
|
+
backgroundImageEnabled: y.settings && p(y.label),
|
|
52
|
+
promptEnabled: C.settings && p(C.label),
|
|
53
|
+
"language.enabled": O.settings && p(O.label, !0),
|
|
54
|
+
language: O.settings && O.enabled && m(k.label, k.options)
|
|
55
|
+
}, W = {
|
|
56
|
+
teacherInstructionsEnabled: E.settings && p(E.label),
|
|
57
|
+
spellCheckEnabled: T.settings && p(T.label),
|
|
58
|
+
rubricEnabled: D?.settings && p(D?.label)
|
|
59
|
+
}, G = (e = {}) => ({
|
|
60
|
+
...v,
|
|
61
|
+
...e
|
|
62
|
+
});
|
|
63
|
+
return /* @__PURE__ */ a(c.ConfigLayout, {
|
|
64
|
+
extraCSSRules: N,
|
|
65
|
+
dimensions: b,
|
|
66
|
+
hideSettings: w,
|
|
67
|
+
settings: /* @__PURE__ */ i(f, {
|
|
68
|
+
model: o,
|
|
69
|
+
onChangeModel: l,
|
|
70
|
+
configuration: e,
|
|
71
|
+
onChangeConfiguration: s,
|
|
72
|
+
groups: {
|
|
73
|
+
Settings: U,
|
|
74
|
+
Properties: W
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
children: [
|
|
78
|
+
I && /* @__PURE__ */ a(h, {
|
|
79
|
+
label: E.label,
|
|
80
|
+
children: [/* @__PURE__ */ i(u, {
|
|
81
|
+
markup: o.teacherInstructions || "",
|
|
82
|
+
onChange: this.onTeacherInstructionsChanged,
|
|
83
|
+
imageSupport: r,
|
|
84
|
+
nonEmpty: !1,
|
|
85
|
+
error: z,
|
|
86
|
+
toolbarOpts: H,
|
|
87
|
+
pluginProps: G(E?.inputConfiguration),
|
|
88
|
+
spellCheck: F,
|
|
89
|
+
maxImageWidth: x && x.teacherInstructions || B,
|
|
90
|
+
maxImageHeight: S && S.teacherInstructions || V,
|
|
91
|
+
uploadSoundSupport: _,
|
|
92
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
93
|
+
mathMlOptions: A
|
|
94
|
+
}), z && /* @__PURE__ */ i(g, { children: z })]
|
|
95
|
+
}),
|
|
96
|
+
P && /* @__PURE__ */ a(h, {
|
|
97
|
+
label: "Item Stem",
|
|
98
|
+
children: [/* @__PURE__ */ i(u, {
|
|
99
|
+
markup: o.prompt,
|
|
100
|
+
onChange: this.onPromptChanged,
|
|
101
|
+
error: R,
|
|
102
|
+
toolbarOpts: H,
|
|
103
|
+
spellCheck: F,
|
|
104
|
+
pluginProps: G(C?.inputConfiguration),
|
|
105
|
+
imageSupport: r,
|
|
106
|
+
maxImageWidth: B,
|
|
107
|
+
maxImageHeight: V,
|
|
108
|
+
uploadSoundSupport: _,
|
|
109
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
110
|
+
mathMlOptions: A
|
|
111
|
+
}), R && /* @__PURE__ */ i(g, { children: R })]
|
|
112
|
+
}),
|
|
113
|
+
j && /* @__PURE__ */ a(n.Fragment, { children: [/* @__PURE__ */ i(d, {
|
|
114
|
+
variant: "h6",
|
|
115
|
+
children: "Define Background Image"
|
|
116
|
+
}), /* @__PURE__ */ i(t, {
|
|
117
|
+
imageUrl: o.imageUrl,
|
|
118
|
+
onUpdateImageDimension: this.onUpdateImageDimension,
|
|
119
|
+
onImageUpload: this.onImageUpload,
|
|
120
|
+
imageDimensions: o.imageDimensions,
|
|
121
|
+
insertImage: r && r.add
|
|
122
|
+
})] })
|
|
123
|
+
]
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
_.propTypes = {
|
|
128
|
+
configuration: r.object,
|
|
129
|
+
model: r.object.isRequired,
|
|
130
|
+
imageSupport: r.shape({
|
|
131
|
+
add: r.func,
|
|
132
|
+
delete: r.func
|
|
133
|
+
}),
|
|
134
|
+
uploadSoundSupport: r.shape({
|
|
135
|
+
add: r.func,
|
|
136
|
+
delete: r.func
|
|
137
|
+
}),
|
|
138
|
+
onModelChanged: r.func.isRequired,
|
|
139
|
+
onConfigurationChanged: r.func.isRequired
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
export { _ as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/controller/src/defaults.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
backgroundImageEnabled: boolean;
|
|
11
|
+
imageDimensions: {
|
|
12
|
+
height: number;
|
|
13
|
+
width: number;
|
|
14
|
+
};
|
|
15
|
+
imageUrl: string;
|
|
16
|
+
prompt: string;
|
|
17
|
+
promptEnabled: boolean;
|
|
18
|
+
spellCheckEnabled: boolean;
|
|
19
|
+
studentInstructionsEnabled: boolean;
|
|
20
|
+
teacherInstructions: string;
|
|
21
|
+
teacherInstructionsEnabled: boolean;
|
|
22
|
+
toolbarEditorPosition: string;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/controller/defaults.ts
|
|
2
|
+
var e = {
|
|
3
|
+
backgroundImageEnabled: !0,
|
|
4
|
+
imageDimensions: {
|
|
5
|
+
height: 0,
|
|
6
|
+
width: 0
|
|
7
|
+
},
|
|
8
|
+
imageUrl: "",
|
|
9
|
+
prompt: "",
|
|
10
|
+
promptEnabled: !0,
|
|
11
|
+
spellCheckEnabled: !0,
|
|
12
|
+
studentInstructionsEnabled: !0,
|
|
13
|
+
teacherInstructions: "",
|
|
14
|
+
teacherInstructionsEnabled: !0,
|
|
15
|
+
toolbarEditorPosition: "bottom"
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/controller/src/index.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const normalize: (question: any) => any;
|
|
10
|
+
export declare function model(question: any, session: any, env: any): Promise<unknown>;
|
|
11
|
+
export declare const createDefaultModel: (model?: {}) => Promise<unknown>;
|
|
12
|
+
export declare function outcome(): Promise<unknown>;
|
|
13
|
+
export declare const validate: (model?: {}, config?: {}) => {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import e from "./defaults.js";
|
|
2
|
+
import t from "debug";
|
|
3
|
+
//#region src/controller/index.ts
|
|
4
|
+
var n = t("pie-elements:drawing-response:controller"), r = (t) => ({
|
|
5
|
+
...e,
|
|
6
|
+
...t
|
|
7
|
+
});
|
|
8
|
+
function i(e, t, n) {
|
|
9
|
+
let i = r(e), { extraCSSRules: a, imageUrl: o, imageDimensions: s, prompt: c, promptEnabled: l, backgroundImageEnabled: u, language: d } = i;
|
|
10
|
+
return new Promise((e) => {
|
|
11
|
+
let t = {
|
|
12
|
+
disabled: n.mode !== "gather",
|
|
13
|
+
mode: n.mode,
|
|
14
|
+
imageDimensions: s,
|
|
15
|
+
imageUrl: o,
|
|
16
|
+
prompt: l ? c : null,
|
|
17
|
+
backgroundImageEnabled: u,
|
|
18
|
+
language: d,
|
|
19
|
+
extraCSSRules: a
|
|
20
|
+
};
|
|
21
|
+
n.role === "instructor" && (n.mode === "view" || n.mode === "evaluate") ? t.teacherInstructions = i.teacherInstructionsEnabled ? i.teacherInstructions : null : t.teacherInstructions = null, e(t);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
var a = (t = {}) => new Promise((n) => {
|
|
25
|
+
n({
|
|
26
|
+
...e,
|
|
27
|
+
...t
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
function o() {
|
|
31
|
+
return new Promise((e) => {
|
|
32
|
+
n("outcome..."), e({
|
|
33
|
+
score: 0,
|
|
34
|
+
completed: "n/a",
|
|
35
|
+
note: "Requires manual scoring"
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var s = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), c = (e = {}, t = {}) => {
|
|
40
|
+
let n = {};
|
|
41
|
+
return ["teacherInstructions", "prompt"].forEach((r) => {
|
|
42
|
+
t[r]?.required && !s(e[r]) && (n[r] = "This field is required.");
|
|
43
|
+
}), n;
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { a as createDefaultModel, i as model, r as normalize, o as outcome, c as validate };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/src/drawing-response/button.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
declare const CustomButton: {
|
|
12
|
+
({ label, onClick, disabled, title }: {
|
|
13
|
+
label: any;
|
|
14
|
+
onClick: any;
|
|
15
|
+
disabled: any;
|
|
16
|
+
title: any;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
propTypes: {
|
|
19
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
20
|
+
label: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
21
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
title: PropTypes.Requireable<string>;
|
|
23
|
+
};
|
|
24
|
+
defaultProps: {
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
label: string;
|
|
27
|
+
onClick: () => void;
|
|
28
|
+
title: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default CustomButton;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { styled as n } from "@mui/material/styles";
|
|
5
|
+
import r from "@mui/material/Button";
|
|
6
|
+
//#region src/delivery/drawing-response/button.tsx
|
|
7
|
+
var i = n(r)({
|
|
8
|
+
fontSize: "0.9em",
|
|
9
|
+
marginLeft: 8,
|
|
10
|
+
minWidth: 32,
|
|
11
|
+
height: 32,
|
|
12
|
+
"& span": { "& svg": {
|
|
13
|
+
width: "1.3em !important",
|
|
14
|
+
height: "1.3em !important"
|
|
15
|
+
} }
|
|
16
|
+
}), a = ({ label: e, onClick: n, disabled: r, title: a }) => /* @__PURE__ */ t(i, {
|
|
17
|
+
title: a,
|
|
18
|
+
onClick: n,
|
|
19
|
+
disabled: r,
|
|
20
|
+
size: "small",
|
|
21
|
+
variant: "contained",
|
|
22
|
+
children: e
|
|
23
|
+
});
|
|
24
|
+
a.propTypes = {
|
|
25
|
+
disabled: e.bool,
|
|
26
|
+
label: e.oneOfType([e.string, e.object]),
|
|
27
|
+
onClick: e.func,
|
|
28
|
+
title: e.string
|
|
29
|
+
}, a.defaultProps = {
|
|
30
|
+
disabled: !1,
|
|
31
|
+
label: "Add",
|
|
32
|
+
onClick: () => {},
|
|
33
|
+
title: ""
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { a as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/src/drawing-response/constants.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
tools: {
|
|
11
|
+
type: string;
|
|
12
|
+
label: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/delivery/drawing-response/constants.ts
|
|
2
|
+
var e = { tools: [
|
|
3
|
+
{
|
|
4
|
+
type: "Select",
|
|
5
|
+
label: "Select",
|
|
6
|
+
icon: "mdiCursorDefault"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
type: "FreePathDrawable",
|
|
10
|
+
label: "Free Draw",
|
|
11
|
+
icon: "mdiPencil"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
type: "LineDrawable",
|
|
15
|
+
label: "Line",
|
|
16
|
+
icon: "mdiMinus"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: "RectangleDrawable",
|
|
20
|
+
label: "Rectangle",
|
|
21
|
+
icon: "mdiRectangle"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: "CircleDrawable",
|
|
25
|
+
label: "Circle",
|
|
26
|
+
icon: "mdiCircle"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "Text",
|
|
30
|
+
label: "Text Entry",
|
|
31
|
+
icon: "mdiFormatColorText"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "EraserDrawable",
|
|
35
|
+
label: "Eraser",
|
|
36
|
+
icon: "mdiEraser"
|
|
37
|
+
}
|
|
38
|
+
] };
|
|
39
|
+
//#endregion
|
|
40
|
+
export { e as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/src/drawing-response/container.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React, { Component } from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class Container extends Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
14
|
+
session: PropTypes.Validator<object>;
|
|
15
|
+
onSessionChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
16
|
+
imageDimensions: PropTypes.Validator<object>;
|
|
17
|
+
imageUrl: PropTypes.Validator<string>;
|
|
18
|
+
backgroundImageEnabled: PropTypes.Validator<boolean>;
|
|
19
|
+
language: PropTypes.Requireable<string>;
|
|
20
|
+
};
|
|
21
|
+
constructor(props: any);
|
|
22
|
+
setTranslatedState(language: any): void;
|
|
23
|
+
UNSAFE_componentWillReceiveProps(props: any): void;
|
|
24
|
+
setDimensions(): void;
|
|
25
|
+
componentDidMount(): void;
|
|
26
|
+
componentWillUnmount(): void;
|
|
27
|
+
handleMakeToolActive(tool: any): void;
|
|
28
|
+
checkIfToolIsDisabled: any;
|
|
29
|
+
handleColorChange(type: any, color: any): void;
|
|
30
|
+
render(): React.JSX.Element;
|
|
31
|
+
}
|
|
32
|
+
export default Container;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import e from "./constants.js";
|
|
2
|
+
import t from "./button.js";
|
|
3
|
+
import n from "./drawable-palette.js";
|
|
4
|
+
import r from "./drawable-main.js";
|
|
5
|
+
import i from "./drawable-text.js";
|
|
6
|
+
import a from "./icon.js";
|
|
7
|
+
import { Component as o } from "react";
|
|
8
|
+
import s from "prop-types";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
import { styled as u } from "@mui/material/styles";
|
|
11
|
+
import d from "@pie-lib/translator";
|
|
12
|
+
//#region src/delivery/drawing-response/container.tsx
|
|
13
|
+
var { tools: f } = e, { translator: p } = d, m = u("div")(({ theme: e }) => ({ marginTop: e.spacing(2) })), h = u("div")(({ theme: e }) => ({
|
|
14
|
+
border: "1px solid #E0E1E6",
|
|
15
|
+
borderRadius: "5px",
|
|
16
|
+
marginTop: e.spacing(2),
|
|
17
|
+
backgroundColor: "#ECEDF1"
|
|
18
|
+
})), g = u("div")({
|
|
19
|
+
minHeight: 350,
|
|
20
|
+
backgroundColor: "#fff"
|
|
21
|
+
}), _ = u("div")(({ theme: e }) => ({
|
|
22
|
+
borderBottom: "1px solid #E0E1E6",
|
|
23
|
+
borderTopLeftRadius: "5px",
|
|
24
|
+
borderTopRightRadius: "5px",
|
|
25
|
+
padding: "12px 8px 4px",
|
|
26
|
+
boxSizing: "border-box",
|
|
27
|
+
maxWidth: "calc(100% - 163px)",
|
|
28
|
+
"& button": { marginBottom: e.spacing(1) }
|
|
29
|
+
})), v = [
|
|
30
|
+
"red",
|
|
31
|
+
"orange",
|
|
32
|
+
"yellow",
|
|
33
|
+
"violet",
|
|
34
|
+
"blue",
|
|
35
|
+
"green",
|
|
36
|
+
"white",
|
|
37
|
+
"black"
|
|
38
|
+
].map((e) => ({
|
|
39
|
+
value: e,
|
|
40
|
+
label: e
|
|
41
|
+
})), y = class extends o {
|
|
42
|
+
static propTypes = {
|
|
43
|
+
disabled: s.bool,
|
|
44
|
+
session: s.object.isRequired,
|
|
45
|
+
onSessionChange: s.func.isRequired,
|
|
46
|
+
imageDimensions: s.object.isRequired,
|
|
47
|
+
imageUrl: s.string.isRequired,
|
|
48
|
+
backgroundImageEnabled: s.bool.isRequired,
|
|
49
|
+
language: s.string
|
|
50
|
+
};
|
|
51
|
+
constructor(e) {
|
|
52
|
+
super(e);
|
|
53
|
+
let t = new i();
|
|
54
|
+
this.state = {
|
|
55
|
+
scale: 1,
|
|
56
|
+
drawableDimensions: {
|
|
57
|
+
height: 0,
|
|
58
|
+
width: 0
|
|
59
|
+
},
|
|
60
|
+
toolActive: f[0],
|
|
61
|
+
fillColor: "white",
|
|
62
|
+
fillColorList: [
|
|
63
|
+
{
|
|
64
|
+
value: "transparent",
|
|
65
|
+
label: "no fill"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: "lightblue",
|
|
69
|
+
label: "light blue"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
value: "lightyellow",
|
|
73
|
+
label: "light yellow"
|
|
74
|
+
},
|
|
75
|
+
...v
|
|
76
|
+
],
|
|
77
|
+
outlineColor: "black",
|
|
78
|
+
outlineColorList: v,
|
|
79
|
+
paintColor: "red",
|
|
80
|
+
paintColorList: v,
|
|
81
|
+
TextEntry: t
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
setTranslatedState(e) {
|
|
85
|
+
let t = v.map((t) => ({
|
|
86
|
+
value: t.value,
|
|
87
|
+
label: p.t(`drawingResponse.${t.label}`, { lng: e })
|
|
88
|
+
}));
|
|
89
|
+
this.setState({
|
|
90
|
+
fillColorList: [
|
|
91
|
+
{
|
|
92
|
+
value: "transparent",
|
|
93
|
+
label: p.t("drawingResponse.noFill", { lng: e })
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
value: "lightblue",
|
|
97
|
+
label: p.t("drawingResponse.lightblue", { lng: e })
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
value: "lightyellow",
|
|
101
|
+
label: p.t("drawingResponse.lightyellow", { lng: e })
|
|
102
|
+
},
|
|
103
|
+
...t
|
|
104
|
+
],
|
|
105
|
+
paintColor: p.t("drawingResponse.red", { lng: e }),
|
|
106
|
+
outlineColorList: t,
|
|
107
|
+
paintColorList: t
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
111
|
+
let { language: t } = e;
|
|
112
|
+
this.setTranslatedState(t);
|
|
113
|
+
}
|
|
114
|
+
setDimensions() {
|
|
115
|
+
let e = setInterval(() => {
|
|
116
|
+
try {
|
|
117
|
+
let { height: e, width: t } = this.drawable.getBoundingClientRect(), n = this.props.session.width || t;
|
|
118
|
+
e !== 0 && t !== 0 && this.setState({ drawableDimensions: {
|
|
119
|
+
height: e,
|
|
120
|
+
width: n
|
|
121
|
+
} });
|
|
122
|
+
} catch (e) {
|
|
123
|
+
console.warn("setDimensions Error: ", e);
|
|
124
|
+
} finally {
|
|
125
|
+
clearInterval(e);
|
|
126
|
+
}
|
|
127
|
+
}, 100);
|
|
128
|
+
}
|
|
129
|
+
componentDidMount() {
|
|
130
|
+
let { language: e } = this.props;
|
|
131
|
+
this.setTranslatedState(e), this.setDimensions(), this.observer = new MutationObserver((e) => {
|
|
132
|
+
e.forEach(() => {
|
|
133
|
+
let e = document.getElementById("question-container")?.style?.cssText, t = (e?.substring(e.indexOf("--pie-zoom") + 11, e.lastIndexOf("%")))?.replace(/\s/g, "");
|
|
134
|
+
t ? parseFloat(t) / 100 !== this.state.scale && this.setState({ scale: parseFloat(t) / 100 }) : !t && this.state.scale !== 1 && this.setState({ scale: 1 });
|
|
135
|
+
});
|
|
136
|
+
}), this.resizeObserver = new ResizeObserver(() => {
|
|
137
|
+
this.setDimensions();
|
|
138
|
+
}), this.drawable && this.resizeObserver.observe(this.drawable);
|
|
139
|
+
let t = document.getElementById("question-container");
|
|
140
|
+
t && this.observer.observe(t, {
|
|
141
|
+
attributes: !0,
|
|
142
|
+
attributeFilter: ["style"]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
componentWillUnmount() {
|
|
146
|
+
let { TextEntry: e } = this.state;
|
|
147
|
+
e.removeEventListeners(), this.observer?.disconnect(), this.resizeObserver?.disconnect();
|
|
148
|
+
}
|
|
149
|
+
handleMakeToolActive(e) {
|
|
150
|
+
let { TextEntry: t } = this.state, { type: n } = e, { language: r } = this.props;
|
|
151
|
+
n === "Text" ? (t.addNewTextEntry(r), this.setState({ updatedAt: /* @__PURE__ */ new Date() })) : this.setState({ toolActive: e });
|
|
152
|
+
}
|
|
153
|
+
checkIfToolIsDisabled = (e) => {
|
|
154
|
+
if (this.props.disabled) return !0;
|
|
155
|
+
let { toolActive: t } = this.state;
|
|
156
|
+
return e === "Text" ? !1 : e === t.type;
|
|
157
|
+
};
|
|
158
|
+
handleColorChange(e, t) {
|
|
159
|
+
let n = `${e}Color`;
|
|
160
|
+
this.setState({ [n]: t });
|
|
161
|
+
}
|
|
162
|
+
render() {
|
|
163
|
+
let { disabled: e, imageUrl: i, imageDimensions: o, onSessionChange: s, session: u, backgroundImageEnabled: d, language: p } = this.props, { drawableDimensions: v, toolActive: y, fillColor: b, fillColorList: x, outlineColor: S, outlineColorList: C, paintColor: w, paintColorList: T, TextEntry: E } = this.state, D = v.height * this.state.scale;
|
|
164
|
+
return /* @__PURE__ */ l(m, { children: [!e && /* @__PURE__ */ c(n, {
|
|
165
|
+
fillColor: b,
|
|
166
|
+
fillList: x,
|
|
167
|
+
outlineColor: S,
|
|
168
|
+
outlineList: C,
|
|
169
|
+
paintColor: w,
|
|
170
|
+
paintList: T,
|
|
171
|
+
onFillColorChange: (e) => this.handleColorChange("fill", e),
|
|
172
|
+
onOutlineColorChange: (e) => this.handleColorChange("outline", e),
|
|
173
|
+
onPaintColorChange: (e) => this.handleColorChange("paint", e),
|
|
174
|
+
language: p
|
|
175
|
+
}), /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(_, { children: f.map((e) => {
|
|
176
|
+
let { type: n, label: r, icon: i } = e;
|
|
177
|
+
return /* @__PURE__ */ c(t, {
|
|
178
|
+
title: r,
|
|
179
|
+
disabled: this.checkIfToolIsDisabled(n),
|
|
180
|
+
onClick: () => this.handleMakeToolActive(e),
|
|
181
|
+
label: /* @__PURE__ */ c(a, { path: i })
|
|
182
|
+
}, n);
|
|
183
|
+
}) }), /* @__PURE__ */ c(g, {
|
|
184
|
+
ref: (e) => {
|
|
185
|
+
this.drawable = e;
|
|
186
|
+
},
|
|
187
|
+
style: {
|
|
188
|
+
height: D,
|
|
189
|
+
maxHeight: D,
|
|
190
|
+
overflow: "scroll"
|
|
191
|
+
},
|
|
192
|
+
children: /* @__PURE__ */ c(r, {
|
|
193
|
+
scale: this.state.scale,
|
|
194
|
+
session: u,
|
|
195
|
+
disabled: e,
|
|
196
|
+
onSessionChange: s,
|
|
197
|
+
fillColor: b,
|
|
198
|
+
outlineColor: S,
|
|
199
|
+
paintColor: w,
|
|
200
|
+
imageUrl: i,
|
|
201
|
+
drawableDimensions: v,
|
|
202
|
+
imageDimensions: o,
|
|
203
|
+
toolActive: y,
|
|
204
|
+
TextEntry: E,
|
|
205
|
+
backgroundImageEnabled: d,
|
|
206
|
+
language: p
|
|
207
|
+
})
|
|
208
|
+
})] })] });
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
//#endregion
|
|
212
|
+
export { y as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/src/drawing-response/drawable-circle.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import DrawableHelper from './drawable-helper.js';
|
|
11
|
+
export default class CircleDrawable extends DrawableHelper {
|
|
12
|
+
static TYPE: string;
|
|
13
|
+
constructor(props: any);
|
|
14
|
+
registerMovement(x: any, y: any): void;
|
|
15
|
+
handleOnClick(props: any): void;
|
|
16
|
+
handleDragEnd: any;
|
|
17
|
+
render(props: any): React.JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import e from "./drawable-helper.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { Circle as n } from "react-konva";
|
|
5
|
+
//#region src/delivery/drawing-response/drawable-circle.tsx
|
|
6
|
+
function r(e) {
|
|
7
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
8
|
+
}
|
|
9
|
+
function i(e, t) {
|
|
10
|
+
return !e || r(e) ? e : r(e.default) ? e.default : t && r(e[t]) ? e[t] : t && r(e[t]?.default) ? e[t].default : e;
|
|
11
|
+
}
|
|
12
|
+
var a = i(n, "Circle"), o = class n extends e {
|
|
13
|
+
static TYPE = "CircleDrawable";
|
|
14
|
+
constructor(e) {
|
|
15
|
+
super(e, n.TYPE);
|
|
16
|
+
let { startx: t, starty: r, x: i, y: a } = e;
|
|
17
|
+
this.startx = t, this.starty = r, this.x = i || t, this.y = a || r;
|
|
18
|
+
let o = this.startx - this.x, s = this.starty - this.y;
|
|
19
|
+
this.radius = Math.sqrt(o * o + s * s);
|
|
20
|
+
}
|
|
21
|
+
registerMovement(e, t) {
|
|
22
|
+
this.x = e, this.y = t;
|
|
23
|
+
let n = this.startx - this.x, r = this.starty - this.y;
|
|
24
|
+
this.radius = Math.sqrt(n * n + r * r);
|
|
25
|
+
}
|
|
26
|
+
handleOnClick(e) {
|
|
27
|
+
let { paint: t, paintColor: n, forceUpdate: r } = e;
|
|
28
|
+
t && (this.paintColor = n, r());
|
|
29
|
+
}
|
|
30
|
+
handleDragEnd = (e, t) => {
|
|
31
|
+
let n = this.startx - t.target.getX(), r = this.starty - t.target.getY();
|
|
32
|
+
this.startx = t.target.getX(), this.starty = t.target.getY(), this.x -= n, this.y -= r, e.handleSessionChange();
|
|
33
|
+
};
|
|
34
|
+
render(e) {
|
|
35
|
+
let { draggable: n, key: r, onMouseOverElement: i, onMouseOutElement: o } = e;
|
|
36
|
+
return /* @__PURE__ */ t(a, {
|
|
37
|
+
draggable: n,
|
|
38
|
+
radius: this.radius,
|
|
39
|
+
x: this.startx,
|
|
40
|
+
y: this.starty,
|
|
41
|
+
fill: this.paintColor || this.fillColor,
|
|
42
|
+
onClick: () => this.handleOnClick(e),
|
|
43
|
+
onDragEnd: this.handleDragEnd.bind(this, e),
|
|
44
|
+
onMouseEnter: i,
|
|
45
|
+
onMouseLeave: o,
|
|
46
|
+
stroke: this.outlineColor
|
|
47
|
+
}, r);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { o as default };
|