@pie-element/drawing-response 12.1.0-next.28 → 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,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/configure/src/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 }: {
|
|
13
|
+
label: any;
|
|
14
|
+
onClick: any;
|
|
15
|
+
disabled: any;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
propTypes: {
|
|
18
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
19
|
+
label: PropTypes.Requireable<string>;
|
|
20
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
+
};
|
|
22
|
+
defaultProps: {
|
|
23
|
+
className: string;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
label: string;
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default CustomButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
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/author/button.tsx
|
|
7
|
+
var i = n(r)({ marginLeft: 8 }), a = ({ label: e, onClick: n, disabled: r }) => /* @__PURE__ */ t(i, {
|
|
8
|
+
onClick: n,
|
|
9
|
+
disabled: r,
|
|
10
|
+
size: "small",
|
|
11
|
+
variant: "contained",
|
|
12
|
+
children: e
|
|
13
|
+
});
|
|
14
|
+
a.propTypes = {
|
|
15
|
+
disabled: e.bool,
|
|
16
|
+
label: e.string,
|
|
17
|
+
onClick: e.func
|
|
18
|
+
}, a.defaultProps = {
|
|
19
|
+
className: "",
|
|
20
|
+
disabled: !1,
|
|
21
|
+
label: "Add",
|
|
22
|
+
onClick: () => {}
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as default };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/configure/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
|
+
model: {
|
|
11
|
+
backgroundImageEnabled: boolean;
|
|
12
|
+
imageDimensions: {
|
|
13
|
+
height: number;
|
|
14
|
+
width: number;
|
|
15
|
+
};
|
|
16
|
+
imageUrl: string;
|
|
17
|
+
prompt: string;
|
|
18
|
+
promptEnabled: boolean;
|
|
19
|
+
spellCheckEnabled: boolean;
|
|
20
|
+
studentInstructionsEnabled: boolean;
|
|
21
|
+
teacherInstructions: string;
|
|
22
|
+
teacherInstructionsEnabled: boolean;
|
|
23
|
+
toolbarEditorPosition: string;
|
|
24
|
+
};
|
|
25
|
+
configuration: {
|
|
26
|
+
baseInputConfiguration: {
|
|
27
|
+
h3: {
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
};
|
|
30
|
+
audio: {
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
};
|
|
33
|
+
video: {
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
};
|
|
36
|
+
image: {
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
};
|
|
39
|
+
textAlign: {
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
};
|
|
42
|
+
showParagraphs: {
|
|
43
|
+
disabled: boolean;
|
|
44
|
+
};
|
|
45
|
+
separateParagraphs: {
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
spellCheck: {
|
|
50
|
+
label: string;
|
|
51
|
+
settings: boolean;
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
backgroundImage: {
|
|
55
|
+
settings: boolean;
|
|
56
|
+
label: string;
|
|
57
|
+
};
|
|
58
|
+
prompt: {
|
|
59
|
+
settings: boolean;
|
|
60
|
+
label: string;
|
|
61
|
+
inputConfiguration: {
|
|
62
|
+
audio: {
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
};
|
|
65
|
+
video: {
|
|
66
|
+
disabled: boolean;
|
|
67
|
+
};
|
|
68
|
+
image: {
|
|
69
|
+
disabled: boolean;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
required: boolean;
|
|
73
|
+
};
|
|
74
|
+
settingsPanelDisabled: boolean;
|
|
75
|
+
teacherInstructions: {
|
|
76
|
+
settings: boolean;
|
|
77
|
+
label: string;
|
|
78
|
+
inputConfiguration: {
|
|
79
|
+
audio: {
|
|
80
|
+
disabled: boolean;
|
|
81
|
+
};
|
|
82
|
+
video: {
|
|
83
|
+
disabled: boolean;
|
|
84
|
+
};
|
|
85
|
+
image: {
|
|
86
|
+
disabled: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
required: boolean;
|
|
90
|
+
};
|
|
91
|
+
maxImageWidth: {
|
|
92
|
+
teacherInstructions: number;
|
|
93
|
+
prompt: number;
|
|
94
|
+
};
|
|
95
|
+
maxImageHeight: {
|
|
96
|
+
teacherInstructions: number;
|
|
97
|
+
prompt: number;
|
|
98
|
+
};
|
|
99
|
+
withRubric: {
|
|
100
|
+
settings: boolean;
|
|
101
|
+
label: string;
|
|
102
|
+
};
|
|
103
|
+
mathMlOptions: {
|
|
104
|
+
mmlOutput: boolean;
|
|
105
|
+
mmlEditing: boolean;
|
|
106
|
+
};
|
|
107
|
+
language: {
|
|
108
|
+
settings: boolean;
|
|
109
|
+
label: string;
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
};
|
|
112
|
+
languageChoices: {
|
|
113
|
+
label: string;
|
|
114
|
+
options: never[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
export default _default;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/author/defaults.ts
|
|
2
|
+
var e = {
|
|
3
|
+
model: {
|
|
4
|
+
backgroundImageEnabled: !0,
|
|
5
|
+
imageDimensions: {
|
|
6
|
+
height: 0,
|
|
7
|
+
width: 0
|
|
8
|
+
},
|
|
9
|
+
imageUrl: "",
|
|
10
|
+
prompt: "",
|
|
11
|
+
promptEnabled: !0,
|
|
12
|
+
spellCheckEnabled: !0,
|
|
13
|
+
studentInstructionsEnabled: !0,
|
|
14
|
+
teacherInstructions: "",
|
|
15
|
+
teacherInstructionsEnabled: !0,
|
|
16
|
+
toolbarEditorPosition: "bottom"
|
|
17
|
+
},
|
|
18
|
+
configuration: {
|
|
19
|
+
baseInputConfiguration: {
|
|
20
|
+
h3: { disabled: !0 },
|
|
21
|
+
audio: { disabled: !1 },
|
|
22
|
+
video: { disabled: !1 },
|
|
23
|
+
image: { disabled: !1 },
|
|
24
|
+
textAlign: { disabled: !0 },
|
|
25
|
+
showParagraphs: { disabled: !1 },
|
|
26
|
+
separateParagraphs: { disabled: !0 }
|
|
27
|
+
},
|
|
28
|
+
spellCheck: {
|
|
29
|
+
label: "Spellcheck",
|
|
30
|
+
settings: !1,
|
|
31
|
+
enabled: !0
|
|
32
|
+
},
|
|
33
|
+
backgroundImage: {
|
|
34
|
+
settings: !0,
|
|
35
|
+
label: "Background Image"
|
|
36
|
+
},
|
|
37
|
+
prompt: {
|
|
38
|
+
settings: !0,
|
|
39
|
+
label: "Prompt",
|
|
40
|
+
inputConfiguration: {
|
|
41
|
+
audio: { disabled: !1 },
|
|
42
|
+
video: { disabled: !1 },
|
|
43
|
+
image: { disabled: !1 }
|
|
44
|
+
},
|
|
45
|
+
required: !1
|
|
46
|
+
},
|
|
47
|
+
settingsPanelDisabled: !1,
|
|
48
|
+
teacherInstructions: {
|
|
49
|
+
settings: !0,
|
|
50
|
+
label: "Teacher Instructions",
|
|
51
|
+
inputConfiguration: {
|
|
52
|
+
audio: { disabled: !1 },
|
|
53
|
+
video: { disabled: !1 },
|
|
54
|
+
image: { disabled: !1 }
|
|
55
|
+
},
|
|
56
|
+
required: !1
|
|
57
|
+
},
|
|
58
|
+
maxImageWidth: {
|
|
59
|
+
teacherInstructions: 300,
|
|
60
|
+
prompt: 300
|
|
61
|
+
},
|
|
62
|
+
maxImageHeight: {
|
|
63
|
+
teacherInstructions: 300,
|
|
64
|
+
prompt: 300
|
|
65
|
+
},
|
|
66
|
+
withRubric: {
|
|
67
|
+
settings: !1,
|
|
68
|
+
label: "Add Rubric"
|
|
69
|
+
},
|
|
70
|
+
mathMlOptions: {
|
|
71
|
+
mmlOutput: !1,
|
|
72
|
+
mmlEditing: !1
|
|
73
|
+
},
|
|
74
|
+
language: {
|
|
75
|
+
settings: !1,
|
|
76
|
+
label: "Specify Language",
|
|
77
|
+
enabled: !1
|
|
78
|
+
},
|
|
79
|
+
languageChoices: {
|
|
80
|
+
label: "Language Choices",
|
|
81
|
+
options: []
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { e as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/configure/src/image-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 ImageContainer extends Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
imageDimensions: PropTypes.Requireable<object>;
|
|
14
|
+
};
|
|
15
|
+
static defaultProps: {};
|
|
16
|
+
constructor(props: any);
|
|
17
|
+
componentDidMount(): void;
|
|
18
|
+
handleFileRead: any;
|
|
19
|
+
handleUploadImage: any;
|
|
20
|
+
makeDropzoneActive: () => void;
|
|
21
|
+
makeDropzoneInactive: () => void;
|
|
22
|
+
handleOnDrop: any;
|
|
23
|
+
handleOnDragOver: any;
|
|
24
|
+
handleOnDragExit: any;
|
|
25
|
+
handleEnableDrag: () => void;
|
|
26
|
+
handleDisableDrag: () => void;
|
|
27
|
+
handleInputClick: any;
|
|
28
|
+
handleOnImageLoad: ({ target: { offsetHeight, offsetWidth, naturalHeight, naturalWidth } }: {
|
|
29
|
+
target: {
|
|
30
|
+
offsetHeight: any;
|
|
31
|
+
offsetWidth: any;
|
|
32
|
+
naturalHeight: any;
|
|
33
|
+
naturalWidth: any;
|
|
34
|
+
};
|
|
35
|
+
}) => void;
|
|
36
|
+
initialiseResize: any;
|
|
37
|
+
stopResizing: any;
|
|
38
|
+
startResizing: any;
|
|
39
|
+
renderUploadControl(label: any): React.JSX.Element;
|
|
40
|
+
render(): React.JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
export default ImageContainer;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import e from "./button.js";
|
|
2
|
+
import { Component as t } from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { styled as a } from "@mui/material/styles";
|
|
6
|
+
//#region src/author/image-container.tsx
|
|
7
|
+
var o = (e) => e.type.match(/image.*/), s = a("div")(({ theme: e }) => ({ marginTop: e.spacing(1) })), c = a("div")(({ active: e }) => ({
|
|
8
|
+
border: e ? "1px solid #0032C2" : "1px solid #E0E1E6",
|
|
9
|
+
borderRadius: "5px"
|
|
10
|
+
})), l = a("div")({
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
justifyContent: "center"
|
|
15
|
+
}), u = a("div")({ minHeight: 350 }), d = a("img")({
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
display: "flex",
|
|
18
|
+
justifyContent: "center"
|
|
19
|
+
}), f = a("div")({
|
|
20
|
+
position: "relative",
|
|
21
|
+
width: "fit-content"
|
|
22
|
+
}), p = a("div")({
|
|
23
|
+
borderBottom: "1px solid #727272",
|
|
24
|
+
borderRight: "1px solid #727272",
|
|
25
|
+
bottom: "-10px",
|
|
26
|
+
cursor: "se-resize",
|
|
27
|
+
height: "10px",
|
|
28
|
+
position: "absolute",
|
|
29
|
+
right: "-10px",
|
|
30
|
+
width: "10px"
|
|
31
|
+
}), m = a("input")({ display: "none" }), h = a("div")({
|
|
32
|
+
backgroundColor: "#ECEDF1",
|
|
33
|
+
borderBottom: "1px solid #E0E1E6",
|
|
34
|
+
borderTopLeftRadius: "5px",
|
|
35
|
+
borderTopRightRadius: "5px",
|
|
36
|
+
display: "flex",
|
|
37
|
+
padding: "12px 8px"
|
|
38
|
+
}), g = class extends t {
|
|
39
|
+
static propTypes = { imageDimensions: n.object };
|
|
40
|
+
static defaultProps = {};
|
|
41
|
+
constructor(e) {
|
|
42
|
+
super(e), this.state = {
|
|
43
|
+
maxImageWidth: "100%",
|
|
44
|
+
maxImageHeight: "auto",
|
|
45
|
+
dragEnabled: !0,
|
|
46
|
+
dropzoneActive: !1
|
|
47
|
+
}, this.fakeImageHandler = {
|
|
48
|
+
cancel: () => {},
|
|
49
|
+
done: (e, t) => this.props.onImageUpload(t),
|
|
50
|
+
fileChosen: () => {},
|
|
51
|
+
progress: () => {}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
componentDidMount() {
|
|
55
|
+
if (this.imageSection) {
|
|
56
|
+
let { height: e, width: t } = this.imageSection.getBoundingClientRect();
|
|
57
|
+
this.setState({
|
|
58
|
+
maxImageWidth: t,
|
|
59
|
+
maxImageHeight: e
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
handleFileRead = (e) => {
|
|
64
|
+
let { onImageUpload: t, insertImage: n } = this.props, r = new FileReader();
|
|
65
|
+
r.onloadend = () => t(r.result), r.readAsDataURL(e), n && n({
|
|
66
|
+
...this.fakeImageHandler,
|
|
67
|
+
getChosenFile: () => e,
|
|
68
|
+
isPasted: !0
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
handleUploadImage = (e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
let t = e.target.files[0];
|
|
74
|
+
this.handleFileRead(t);
|
|
75
|
+
};
|
|
76
|
+
makeDropzoneActive = () => this.setState({ dropzoneActive: !0 });
|
|
77
|
+
makeDropzoneInactive = () => this.setState({ dropzoneActive: !1 });
|
|
78
|
+
handleOnDrop = (e) => {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
let { items: t, files: n } = e.dataTransfer;
|
|
81
|
+
if (t && t[0].kind === "file") {
|
|
82
|
+
let e = t[0].getAsFile();
|
|
83
|
+
o(e) && this.handleFileRead(e);
|
|
84
|
+
} else o(n[0]) && this.handleFileRead(n[0]);
|
|
85
|
+
this.makeDropzoneInactive();
|
|
86
|
+
};
|
|
87
|
+
handleOnDragOver = (e) => {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
let { dropzoneActive: t } = this.state;
|
|
90
|
+
t || this.makeDropzoneActive();
|
|
91
|
+
};
|
|
92
|
+
handleOnDragExit = (e) => {
|
|
93
|
+
e.preventDefault(), this.makeDropzoneInactive();
|
|
94
|
+
};
|
|
95
|
+
handleEnableDrag = () => this.setState({ dragEnabled: !0 });
|
|
96
|
+
handleDisableDrag = () => this.setState({ dragEnabled: !1 });
|
|
97
|
+
handleInputClick = () => {
|
|
98
|
+
let { insertImage: e } = this.props;
|
|
99
|
+
e && e(this.fakeImageHandler);
|
|
100
|
+
};
|
|
101
|
+
handleOnImageLoad = ({ target: { offsetHeight: e, offsetWidth: t, naturalHeight: n, naturalWidth: r } }) => {
|
|
102
|
+
let { onUpdateImageDimension: i, imageDimensions: a } = this.props, o = this.resize, s = {
|
|
103
|
+
height: a && a.height || e || n,
|
|
104
|
+
width: a && a.width || t || r
|
|
105
|
+
}, c = r / n;
|
|
106
|
+
s.width !== s.height * c && (s.width = s.height * c), this.setState({ dimensions: s }), i(s), o.addEventListener("mousedown", this.initialiseResize, !1);
|
|
107
|
+
};
|
|
108
|
+
initialiseResize = () => {
|
|
109
|
+
window.addEventListener("mousemove", this.startResizing, !1), window.addEventListener("mouseup", this.stopResizing, !1);
|
|
110
|
+
};
|
|
111
|
+
stopResizing = () => {
|
|
112
|
+
let { onUpdateImageDimension: e } = this.props, { dimensions: t } = this.state;
|
|
113
|
+
this.handleEnableDrag(), e(t), window.removeEventListener("mousemove", this.startResizing, !1), window.removeEventListener("mouseup", this.stopResizing, !1);
|
|
114
|
+
};
|
|
115
|
+
startResizing = (e) => {
|
|
116
|
+
let t = this.image, { maxImageWidth: n, maxImageHeight: r, dimensions: i } = this.state, a = e.target.getBoundingClientRect(), o = e.clientX - a.left, s = e.clientY - a.top, c = i.width / i.height;
|
|
117
|
+
o <= n + 5 && o / c <= r + 5 && o > 150 && s > 150 && t && (t.style.width = `${o}px`, t.style.height = `${o / c}px`, this.setState({ dimensions: {
|
|
118
|
+
width: o,
|
|
119
|
+
height: o / c
|
|
120
|
+
} })), this.handleDisableDrag();
|
|
121
|
+
};
|
|
122
|
+
renderUploadControl(t) {
|
|
123
|
+
return /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(e, {
|
|
124
|
+
label: t,
|
|
125
|
+
onClick: this.handleInputClick
|
|
126
|
+
}), /* @__PURE__ */ r(m, {
|
|
127
|
+
accept: "image/*",
|
|
128
|
+
onChange: this.handleUploadImage,
|
|
129
|
+
ref: (e) => {
|
|
130
|
+
this.input = e;
|
|
131
|
+
},
|
|
132
|
+
type: "file"
|
|
133
|
+
})] });
|
|
134
|
+
}
|
|
135
|
+
render() {
|
|
136
|
+
let { imageUrl: e, imageDimensions: t } = this.props, { dropzoneActive: n, dragEnabled: a, maxImageHeight: o, maxImageWidth: m } = this.state;
|
|
137
|
+
return /* @__PURE__ */ r(s, { children: /* @__PURE__ */ i(c, {
|
|
138
|
+
active: n,
|
|
139
|
+
...a ? {
|
|
140
|
+
onDragExit: this.handleOnDragExit,
|
|
141
|
+
onDragLeave: this.handleOnDragExit,
|
|
142
|
+
onDragOver: this.handleOnDragOver,
|
|
143
|
+
onDrop: this.handleOnDrop
|
|
144
|
+
} : {},
|
|
145
|
+
children: [/* @__PURE__ */ r(h, { children: this.renderUploadControl(e ? "Replace Image" : "Upload Image") }), /* @__PURE__ */ r(u, {
|
|
146
|
+
ref: (e) => {
|
|
147
|
+
this.imageSection = e;
|
|
148
|
+
},
|
|
149
|
+
children: e ? /* @__PURE__ */ i(f, { children: [/* @__PURE__ */ r(d, {
|
|
150
|
+
height: "auto",
|
|
151
|
+
onLoad: this.handleOnImageLoad,
|
|
152
|
+
ref: (e) => {
|
|
153
|
+
this.image = e;
|
|
154
|
+
},
|
|
155
|
+
src: e,
|
|
156
|
+
style: {
|
|
157
|
+
width: t && t.width ? t.width : void 0,
|
|
158
|
+
maxWidth: m,
|
|
159
|
+
maxHeight: o
|
|
160
|
+
},
|
|
161
|
+
alt: ""
|
|
162
|
+
}), /* @__PURE__ */ r(p, { ref: (e) => {
|
|
163
|
+
this.resize = e;
|
|
164
|
+
} })] }) : /* @__PURE__ */ i(u, {
|
|
165
|
+
as: l,
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ r("label", { children: "Drag and drop or upload image from computer" }),
|
|
168
|
+
/* @__PURE__ */ r("br", {}),
|
|
169
|
+
this.renderUploadControl("Upload Image")
|
|
170
|
+
]
|
|
171
|
+
})
|
|
172
|
+
})]
|
|
173
|
+
}) });
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
g.propTypes = {
|
|
177
|
+
imageUrl: n.string.isRequired,
|
|
178
|
+
onImageUpload: n.func.isRequired,
|
|
179
|
+
onUpdateImageDimension: n.func.isRequired,
|
|
180
|
+
insertImage: n.func
|
|
181
|
+
};
|
|
182
|
+
//#endregion
|
|
183
|
+
export { g as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/configure/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 default class DrawableResponseConfigure extends HTMLElement {
|
|
10
|
+
static createDefaultModel: (model: {} | undefined, config: any) => {
|
|
11
|
+
backgroundImageEnabled: boolean;
|
|
12
|
+
imageDimensions: {
|
|
13
|
+
height: number;
|
|
14
|
+
width: number;
|
|
15
|
+
};
|
|
16
|
+
imageUrl: string;
|
|
17
|
+
prompt: string;
|
|
18
|
+
promptEnabled: boolean;
|
|
19
|
+
spellCheckEnabled: boolean;
|
|
20
|
+
studentInstructionsEnabled: boolean;
|
|
21
|
+
teacherInstructions: string;
|
|
22
|
+
teacherInstructionsEnabled: boolean;
|
|
23
|
+
toolbarEditorPosition: string;
|
|
24
|
+
};
|
|
25
|
+
constructor();
|
|
26
|
+
set model(s: any);
|
|
27
|
+
set configuration(c: any);
|
|
28
|
+
dispatchModelUpdated(reset: any): void;
|
|
29
|
+
onModelChanged: any;
|
|
30
|
+
onConfigurationChanged: any;
|
|
31
|
+
insertImage: any;
|
|
32
|
+
onDeleteImage: any;
|
|
33
|
+
insertSound(handler: any): void;
|
|
34
|
+
onDeleteSound(src: any, done: any): void;
|
|
35
|
+
_render(): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import e from "./root.js";
|
|
2
|
+
import t from "./defaults.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import { createRoot as r } from "react-dom/client";
|
|
5
|
+
import i from "debug";
|
|
6
|
+
import { DeleteImageEvent as a, DeleteSoundEvent as o, InsertImageEvent as s, InsertSoundEvent as c, ModelUpdatedEvent as l } from "@pie-element/shared-configure-events";
|
|
7
|
+
//#region src/author/index.ts
|
|
8
|
+
var u = i("hotspot:configure"), d = class i extends HTMLElement {
|
|
9
|
+
static createDefaultModel = (e = {}, n) => {
|
|
10
|
+
let r = {
|
|
11
|
+
...t.model,
|
|
12
|
+
...e
|
|
13
|
+
};
|
|
14
|
+
return n?.withRubric?.forceEnabled && !r.rubricEnabled && (r.rubricEnabled = !0), r;
|
|
15
|
+
};
|
|
16
|
+
constructor() {
|
|
17
|
+
super(), this._root = null, this._configuration = t.configuration, this._configuration.withRubric?.forceEnabled && (this._configuration.withRubric.settings = !1), this._model = i.createDefaultModel({}, this._configuration), this.onModelChanged = this.onModelChanged.bind(this);
|
|
18
|
+
}
|
|
19
|
+
set model(e) {
|
|
20
|
+
this._model = i.createDefaultModel(e, this._configuration), this._render();
|
|
21
|
+
}
|
|
22
|
+
set configuration(e) {
|
|
23
|
+
let n = {
|
|
24
|
+
...t.configuration,
|
|
25
|
+
...e
|
|
26
|
+
};
|
|
27
|
+
this._configuration = n;
|
|
28
|
+
let { withRubric: r = {} } = e || {};
|
|
29
|
+
r?.forceEnabled && (this._configuration.withRubric.settings = !1, this._model.rubricEnabled || (this._model.rubricEnabled = !0)), n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
|
|
30
|
+
value: this._model.language,
|
|
31
|
+
label: this._model.language
|
|
32
|
+
})) : delete this._model.language, this._render();
|
|
33
|
+
}
|
|
34
|
+
dispatchModelUpdated(e) {
|
|
35
|
+
let t = !!e;
|
|
36
|
+
this.dispatchEvent(new l(this._model, t));
|
|
37
|
+
}
|
|
38
|
+
onModelChanged = (e, t) => {
|
|
39
|
+
this._model = e, this.dispatchModelUpdated(t), this._render();
|
|
40
|
+
};
|
|
41
|
+
onConfigurationChanged = (e) => {
|
|
42
|
+
this._configuration = e, this._render();
|
|
43
|
+
};
|
|
44
|
+
insertImage = (e) => {
|
|
45
|
+
this.dispatchEvent(new s(e));
|
|
46
|
+
};
|
|
47
|
+
onDeleteImage = (e, t) => {
|
|
48
|
+
this.dispatchEvent(new a(e, t));
|
|
49
|
+
};
|
|
50
|
+
insertSound(e) {
|
|
51
|
+
this.dispatchEvent(new c(e));
|
|
52
|
+
}
|
|
53
|
+
onDeleteSound(e, t) {
|
|
54
|
+
this.dispatchEvent(new o(e, t));
|
|
55
|
+
}
|
|
56
|
+
_render() {
|
|
57
|
+
u("_render");
|
|
58
|
+
let t = n.createElement(e, {
|
|
59
|
+
model: this._model,
|
|
60
|
+
configuration: this._configuration,
|
|
61
|
+
onModelChanged: this.onModelChanged,
|
|
62
|
+
onConfigurationChanged: this.onConfigurationChanged,
|
|
63
|
+
imageSupport: {
|
|
64
|
+
add: this.insertImage,
|
|
65
|
+
delete: this.onDeleteImage
|
|
66
|
+
},
|
|
67
|
+
uploadSoundSupport: {
|
|
68
|
+
add: this.insertSound.bind(this),
|
|
69
|
+
delete: this.onDeleteSound.bind(this)
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
this._root ||= r(this), this._root.render(t);
|
|
73
|
+
}
|
|
74
|
+
disconnectedCallback() {
|
|
75
|
+
this._root && this._root.unmount();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { d as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/drawing-response/configure/src/root.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
|
+
export declare class Root extends React.Component {
|
|
11
|
+
onPromptChanged: any;
|
|
12
|
+
onTeacherInstructionsChanged: any;
|
|
13
|
+
onUpdateImageDimension: any;
|
|
14
|
+
onImageUpload: any;
|
|
15
|
+
render(): React.JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
export default Root;
|