@pie-element/inline-dropdown 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/author/defaults.d.ts +195 -0
- package/dist/author/defaults.d.ts.map +1 -0
- package/dist/author/defaults.js +130 -0
- package/dist/author/index.d.ts +44 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +83 -0
- package/dist/author/inline-dropdown-toolbar.d.ts +48 -0
- package/dist/author/inline-dropdown-toolbar.d.ts.map +1 -0
- package/dist/author/inline-dropdown-toolbar.js +261 -0
- package/dist/author/main.d.ts +49 -0
- package/dist/author/main.d.ts.map +1 -0
- package/dist/author/main.js +375 -0
- package/dist/author/markupUtils.d.ts +13 -0
- package/dist/author/markupUtils.d.ts.map +1 -0
- package/dist/author/markupUtils.js +23 -0
- package/dist/author/response-area.d.ts +21 -0
- package/dist/author/response-area.d.ts.map +1 -0
- package/dist/author/response-area.js +32 -0
- package/dist/author/utils.d.ts +11 -0
- package/dist/author/utils.d.ts.map +1 -0
- package/dist/author/utils.js +10 -0
- package/dist/controller/defaults.d.ts +28 -0
- package/dist/controller/defaults.d.ts.map +1 -0
- package/dist/controller/defaults.js +21 -0
- package/dist/controller/index.d.ts +55 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +126 -0
- package/dist/controller/utils.d.ts +13 -0
- package/dist/controller/utils.d.ts.map +1 -0
- package/dist/controller/utils.js +13 -0
- package/dist/delivery/index.d.ts +21 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +60 -0
- package/dist/delivery/inline-dropdown.d.ts +39 -0
- package/dist/delivery/inline-dropdown.d.ts.map +1 -0
- package/dist/delivery/inline-dropdown.js +109 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.iife.d.ts +9 -0
- package/dist/index.iife.d.ts.map +1 -0
- package/dist/index.iife.js +148 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayReduce.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseExtremum.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGt.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js +26 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseReduce.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castFunction.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseEach.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_escapeHtmlChar.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js +18 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/escape.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/forEach.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isUndefined.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/map.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/max.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/reduce.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
- package/package.json +70 -0
- package/src/author/defaults.ts +141 -0
- package/src/author/index.ts +161 -0
- package/src/author/inline-dropdown-toolbar.tsx +454 -0
- package/src/author/main.tsx +609 -0
- package/src/author/markupUtils.tsx +68 -0
- package/src/author/response-area.tsx +55 -0
- package/src/author/utils.ts +32 -0
- package/src/controller/defaults.ts +28 -0
- package/src/controller/index.ts +340 -0
- package/src/controller/utils.ts +36 -0
- package/src/delivery/index.ts +100 -0
- package/src/delivery/inline-dropdown.tsx +209 -0
- package/src/index.iife.ts +16 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/inline-dropdown/configure/src/inline-dropdown-toolbar.jsx
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { getPluginProps } from './utils.js';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import ReactDOM from 'react-dom';
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
|
+
import EditableHtml from '@pie-lib/editable-html-tip-tap';
|
|
16
|
+
import { renderMath } from '@pie-element/shared-math-rendering-mathjax';
|
|
17
|
+
import { styled } from '@mui/material/styles';
|
|
18
|
+
import { isEmpty, isEqual } from 'lodash-es';
|
|
19
|
+
import { color } from '@pie-lib/render-ui';
|
|
20
|
+
|
|
21
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
22
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
23
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
24
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
25
|
+
import IconButton from '@mui/material/IconButton';
|
|
26
|
+
|
|
27
|
+
const MenuItemWrapper: any = styled('div')(({ theme }) => ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignItems: 'flex-start',
|
|
30
|
+
position: 'relative',
|
|
31
|
+
background: theme.palette.common.white,
|
|
32
|
+
borderBottom: `1px solid ${theme.palette.grey[400]}`,
|
|
33
|
+
|
|
34
|
+
'&:last-child': {
|
|
35
|
+
borderRadius: '0 0 4px 4px',
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
const SelectedIcon: any = styled('div')(({ theme }) => ({
|
|
40
|
+
display: 'flex',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
color: theme.palette.common.white,
|
|
43
|
+
fontSize: theme.typography.fontSize,
|
|
44
|
+
fontStyle: 'normal',
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
transform: 'translate(0, -50%)',
|
|
47
|
+
backgroundColor: color.correct(),
|
|
48
|
+
borderRadius: '50%',
|
|
49
|
+
top: theme.spacing(2),
|
|
50
|
+
left: theme.spacing(1),
|
|
51
|
+
zIndex: 3,
|
|
52
|
+
}));
|
|
53
|
+
|
|
54
|
+
const ValueHolder: any = styled('div')(({ theme, correct }) => ({
|
|
55
|
+
flex: 1,
|
|
56
|
+
padding: theme.spacing(0.75),
|
|
57
|
+
paddingLeft: theme.spacing(3.5),
|
|
58
|
+
...(correct && {
|
|
59
|
+
background: color.correctSecondary(),
|
|
60
|
+
}),
|
|
61
|
+
'& p': {
|
|
62
|
+
// browser adds extra margin for p tags by default
|
|
63
|
+
margin: 0,
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
const ActionButtons: any = styled('div')(({ theme }) => ({
|
|
68
|
+
margin: theme.spacing(0.5),
|
|
69
|
+
display: 'flex',
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const StyledIconButton: any = styled(IconButton)(({ theme }) => ({
|
|
73
|
+
fontSize: theme.typography.fontSize,
|
|
74
|
+
padding: theme.spacing(0.5),
|
|
75
|
+
color: theme.palette.common.black,
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
class MenuItemComp extends React.Component {
|
|
79
|
+
static propTypes = {
|
|
80
|
+
correct: PropTypes.bool.isRequired,
|
|
81
|
+
onClick: PropTypes.func.isRequired,
|
|
82
|
+
onRemoveChoice: PropTypes.func.isRequired,
|
|
83
|
+
onEditChoice: PropTypes.func.isRequired,
|
|
84
|
+
value: PropTypes.string.isRequired,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
onRemoveClick: any = (e) => {
|
|
88
|
+
const { onRemoveChoice } = this.props;
|
|
89
|
+
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
|
|
93
|
+
onRemoveChoice();
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
onEditClick: any = (e) => {
|
|
97
|
+
const { onEditChoice } = this.props;
|
|
98
|
+
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
e.stopPropagation();
|
|
101
|
+
|
|
102
|
+
onEditChoice();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
render() {
|
|
106
|
+
const { correct, onClick, value } = this.props;
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<MenuItemWrapper>
|
|
110
|
+
{correct && (
|
|
111
|
+
<SelectedIcon onClick={onClick}>
|
|
112
|
+
<CheckIcon fontSize="inherit" />
|
|
113
|
+
</SelectedIcon>
|
|
114
|
+
)}
|
|
115
|
+
<ValueHolder
|
|
116
|
+
correct={correct}
|
|
117
|
+
onClick={onClick}
|
|
118
|
+
dangerouslySetInnerHTML={{
|
|
119
|
+
__html: value,
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
<ActionButtons>
|
|
123
|
+
<StyledIconButton onClick={this.onEditClick} size="small" aria-label="Edit">
|
|
124
|
+
<EditIcon fontSize="inherit" />
|
|
125
|
+
</StyledIconButton>
|
|
126
|
+
<StyledIconButton onClick={this.onRemoveClick} size="small" aria-label="Remove">
|
|
127
|
+
<CloseIcon fontSize="inherit" />
|
|
128
|
+
</StyledIconButton>
|
|
129
|
+
</ActionButtons>
|
|
130
|
+
</MenuItemWrapper>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const MenuItem = MenuItemComp;
|
|
136
|
+
|
|
137
|
+
const findSlateNode = (key) => {
|
|
138
|
+
return window.document.querySelector('[data-key="' + key + '"]');
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const createElementFromHTML = (htmlString) => {
|
|
142
|
+
const div = document.createElement('div');
|
|
143
|
+
|
|
144
|
+
div.innerHTML = (htmlString || '').trim();
|
|
145
|
+
|
|
146
|
+
return div;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const ResponseContainer: any = styled('div')(({ theme }) => ({
|
|
150
|
+
boxShadow: theme.shadows[2],
|
|
151
|
+
borderRadius: '4px',
|
|
152
|
+
width: '400px',
|
|
153
|
+
}));
|
|
154
|
+
|
|
155
|
+
const RespArea: any = styled(EditableHtml)(({ theme }) => ({
|
|
156
|
+
borderRadius: '4px',
|
|
157
|
+
backgroundColor: theme.palette.common.white,
|
|
158
|
+
'& [data-slate-editor="true"]': {
|
|
159
|
+
minHeight: 'initial !important',
|
|
160
|
+
},
|
|
161
|
+
}));
|
|
162
|
+
|
|
163
|
+
const AddButton: any = styled(IconButton)(({ theme }) => ({
|
|
164
|
+
fontSize: theme.typography.fontSize + 2,
|
|
165
|
+
padding: theme.spacing(0.5),
|
|
166
|
+
color: theme.palette.common.black,
|
|
167
|
+
position: 'absolute',
|
|
168
|
+
top: '50%',
|
|
169
|
+
right: theme.spacing(2),
|
|
170
|
+
transform: 'translate(0, -50%)',
|
|
171
|
+
}));
|
|
172
|
+
|
|
173
|
+
const ChoicesHolder: any = styled('div')({
|
|
174
|
+
display: 'flex',
|
|
175
|
+
flexDirection: 'column',
|
|
176
|
+
'& > div:last-child': {
|
|
177
|
+
border: 'none',
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
const ItemBuilder: any = styled('div')(({ theme }) => ({
|
|
182
|
+
padding: theme.spacing(0.5),
|
|
183
|
+
position: 'relative',
|
|
184
|
+
}));
|
|
185
|
+
|
|
186
|
+
class RespAreaToolbar extends React.Component {
|
|
187
|
+
static propTypes = {
|
|
188
|
+
node: PropTypes.object,
|
|
189
|
+
pos: PropTypes.number,
|
|
190
|
+
uploadSoundSupport: PropTypes.object,
|
|
191
|
+
onDone: PropTypes.func,
|
|
192
|
+
choices: PropTypes.array,
|
|
193
|
+
onAddChoice: PropTypes.func.isRequired,
|
|
194
|
+
onCheck: PropTypes.func,
|
|
195
|
+
editorCallback: PropTypes.func,
|
|
196
|
+
onRemoveChoice: PropTypes.func.isRequired,
|
|
197
|
+
onSelectChoice: PropTypes.func.isRequired,
|
|
198
|
+
onToolbarDone: PropTypes.func.isRequired,
|
|
199
|
+
editor: PropTypes.object,
|
|
200
|
+
spellCheck: PropTypes.bool,
|
|
201
|
+
};
|
|
202
|
+
clickedInside = false;
|
|
203
|
+
preventDone = false;
|
|
204
|
+
|
|
205
|
+
state = {
|
|
206
|
+
respAreaMarkup: '',
|
|
207
|
+
editedChoiceIndex: -1,
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
componentDidMount() {
|
|
211
|
+
const { editor } = this.props;
|
|
212
|
+
|
|
213
|
+
const domNode = editor.view.nodeDOM(editor.state.selection.from);
|
|
214
|
+
|
|
215
|
+
if (domNode?.nodeType === 1) {
|
|
216
|
+
//eslint-disable-next-line
|
|
217
|
+
const domNodeRect = domNode.getBoundingClientRect();
|
|
218
|
+
const editorNode = domNode.closest('.tiptap');
|
|
219
|
+
const editorRect = editorNode.getBoundingClientRect();
|
|
220
|
+
const top = domNodeRect.top - domNodeRect.height;
|
|
221
|
+
const left = domNodeRect.left - editorRect.left;
|
|
222
|
+
|
|
223
|
+
this.setState({
|
|
224
|
+
toolbarStyle: {
|
|
225
|
+
position: 'absolute',
|
|
226
|
+
top: `${top + domNodeRect.height + 40}px`,
|
|
227
|
+
left: `${left + 25}px`,
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
componentDidUpdate() {
|
|
234
|
+
//eslint-disable-next-line
|
|
235
|
+
const domNode = ReactDOM.findDOMNode(this);
|
|
236
|
+
|
|
237
|
+
renderMath(domNode);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
onRespAreaChange: any = (respAreaMarkup) => {
|
|
241
|
+
this.setState({ respAreaMarkup });
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
onAddChoice: any = () => {
|
|
245
|
+
const { editor } = this.props;
|
|
246
|
+
const { tr } = editor.state;
|
|
247
|
+
|
|
248
|
+
tr.isDone = true;
|
|
249
|
+
editor.view.dispatch(tr);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
onDone: any = (val) => {
|
|
253
|
+
const { choices, node, editor, onAddChoice, onToolbarDone } = this.props;
|
|
254
|
+
|
|
255
|
+
const { editedChoiceIndex } = this.state;
|
|
256
|
+
const onlyText = createElementFromHTML(val).textContent.trim();
|
|
257
|
+
|
|
258
|
+
if (editedChoiceIndex >= 0 && choices?.[editedChoiceIndex]?.correct) {
|
|
259
|
+
editor.commands.updateAttributes('inline_dropdown', { value: val });
|
|
260
|
+
onToolbarDone(false);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (!isEmpty(onlyText)) {
|
|
264
|
+
onAddChoice(node.attrs.index, val, editedChoiceIndex);
|
|
265
|
+
editor.commands.refreshResponseArea();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
this.setState({ editedChoiceIndex: -1 });
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
onSelectChoice: any = (newValue, index) => {
|
|
272
|
+
const { node, editor, onToolbarDone, onSelectChoice } = this.props;
|
|
273
|
+
|
|
274
|
+
editor.commands.updateAttributes('inline_dropdown', { value: newValue });
|
|
275
|
+
|
|
276
|
+
onToolbarDone(false);
|
|
277
|
+
onSelectChoice(index);
|
|
278
|
+
editor.commands.refreshResponseArea();
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
onRemoveChoice: any = (val, index) => {
|
|
282
|
+
const { node, editor, onToolbarDone, onRemoveChoice } = this.props;
|
|
283
|
+
|
|
284
|
+
if (isEqual(val, node.attrs.value)) {
|
|
285
|
+
editor.commands.updateAttributes('inline_dropdown', { value: null });
|
|
286
|
+
onToolbarDone(false);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
onRemoveChoice(index);
|
|
290
|
+
editor.commands.refreshResponseArea();
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
onEditChoice: any = (val, index) => {
|
|
294
|
+
const { editedChoiceIndex } = this.state;
|
|
295
|
+
|
|
296
|
+
this.preventDone = true;
|
|
297
|
+
|
|
298
|
+
if (editedChoiceIndex >= 0) {
|
|
299
|
+
const html = this.editorRef.getHTML() || '';
|
|
300
|
+
|
|
301
|
+
this.onDone(html);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
this.onRespAreaChange(val);
|
|
305
|
+
this.setState({ editedChoiceIndex: index });
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
onKeyDown: any = (event) => {
|
|
309
|
+
if (event.key === 'Enter') {
|
|
310
|
+
const html = this.editorRef.getHTML() || '';
|
|
311
|
+
|
|
312
|
+
this.onDone(html);
|
|
313
|
+
this.preventDone = true;
|
|
314
|
+
|
|
315
|
+
// Cancelling event
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return false;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
onBlur: any = () => {
|
|
323
|
+
if (this.clickedInside) {
|
|
324
|
+
this.clickedInside = false;
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const { node, choices, onCheck, onToolbarDone, editor } = this.props;
|
|
329
|
+
const correctResponse = (choices || []).find((choice) => choice.correct);
|
|
330
|
+
|
|
331
|
+
this.onAddChoice();
|
|
332
|
+
if (!choices || (choices && choices.length < 2) || !correctResponse) {
|
|
333
|
+
onCheck(() => {
|
|
334
|
+
const { tr } = editor.state;
|
|
335
|
+
|
|
336
|
+
tr.deleteSelection();
|
|
337
|
+
editor.view.dispatch(tr);
|
|
338
|
+
onToolbarDone(false);
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
onClickInside: any = () => {
|
|
344
|
+
this.clickedInside = true;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
render() {
|
|
348
|
+
const {
|
|
349
|
+
choices,
|
|
350
|
+
spellCheck,
|
|
351
|
+
uploadSoundSupport,
|
|
352
|
+
mathMlOptions = {},
|
|
353
|
+
baseInputConfiguration = {},
|
|
354
|
+
responseAreaInputConfiguration = {},
|
|
355
|
+
} = this.props;
|
|
356
|
+
const { respAreaMarkup, toolbarStyle } = this.state;
|
|
357
|
+
|
|
358
|
+
if (!toolbarStyle) {
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
return (
|
|
363
|
+
<ResponseContainer
|
|
364
|
+
style={{
|
|
365
|
+
...toolbarStyle,
|
|
366
|
+
backgroundColor: '#E0E1E6',
|
|
367
|
+
}}
|
|
368
|
+
onMouseDown={this.onClickInside}
|
|
369
|
+
>
|
|
370
|
+
<ItemBuilder>
|
|
371
|
+
<RespArea
|
|
372
|
+
editorRef={(ref) => {
|
|
373
|
+
if (ref) {
|
|
374
|
+
this.editorRef = ref;
|
|
375
|
+
this.props.editorCallback?.(ref);
|
|
376
|
+
}
|
|
377
|
+
}}
|
|
378
|
+
autoFocus={true}
|
|
379
|
+
autoSave
|
|
380
|
+
toolbarOpts={{
|
|
381
|
+
position: 'top',
|
|
382
|
+
alwaysVisible: false,
|
|
383
|
+
showDone: false,
|
|
384
|
+
doneOn: 'blur',
|
|
385
|
+
}}
|
|
386
|
+
markup={respAreaMarkup}
|
|
387
|
+
onKeyDown={this.onKeyDown}
|
|
388
|
+
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
389
|
+
onChange={(respAreaMarkup) => {
|
|
390
|
+
if (this.preventDone) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
this.onRespAreaChange(respAreaMarkup);
|
|
395
|
+
}}
|
|
396
|
+
onDone={(val) => {
|
|
397
|
+
if (this.preventDone) {
|
|
398
|
+
this.preventDone = false;
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
this.onDone(val);
|
|
403
|
+
}}
|
|
404
|
+
onBlur={(e) => {
|
|
405
|
+
if (!e.relatedTarget) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const isInInsertCharacter = !!(e.relatedTarget && e.relatedTarget.closest('.insert-character-dialog'));
|
|
410
|
+
const isInDoneButton = !!(e.relatedTarget && e.relatedTarget.closest('[aria-label="Done"]'));
|
|
411
|
+
|
|
412
|
+
this.preventDone = isInInsertCharacter || isInDoneButton;
|
|
413
|
+
if (isInInsertCharacter || isInDoneButton) {
|
|
414
|
+
this.clickedInside = true;
|
|
415
|
+
}
|
|
416
|
+
this.onBlur(e);
|
|
417
|
+
}}
|
|
418
|
+
placeholder="Add Choice"
|
|
419
|
+
pluginProps={getPluginProps(responseAreaInputConfiguration?.inputConfiguration, baseInputConfiguration)}
|
|
420
|
+
spellCheck={spellCheck}
|
|
421
|
+
uploadSoundSupport={uploadSoundSupport}
|
|
422
|
+
mathMlOptions={mathMlOptions}
|
|
423
|
+
/>
|
|
424
|
+
<AddButton
|
|
425
|
+
onClick={() => this.onAddChoice()}
|
|
426
|
+
size="small"
|
|
427
|
+
aria-label="Add"
|
|
428
|
+
>
|
|
429
|
+
<AddIcon fontSize="inherit" />
|
|
430
|
+
</AddButton>
|
|
431
|
+
</ItemBuilder>
|
|
432
|
+
|
|
433
|
+
{choices && (
|
|
434
|
+
<ChoicesHolder>
|
|
435
|
+
{choices.map(({ label, correct }, index) => (
|
|
436
|
+
<MenuItem
|
|
437
|
+
key={index}
|
|
438
|
+
onClick={() => this.onSelectChoice(label, index)}
|
|
439
|
+
onRemoveChoice={() => this.onRemoveChoice(label, index)}
|
|
440
|
+
onEditChoice={() => this.onEditChoice(label, index)}
|
|
441
|
+
value={label}
|
|
442
|
+
correct={correct}
|
|
443
|
+
/>
|
|
444
|
+
))}
|
|
445
|
+
</ChoicesHolder>
|
|
446
|
+
)}
|
|
447
|
+
</ResponseContainer>
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const StyledRespAreaToolbar = RespAreaToolbar;
|
|
453
|
+
|
|
454
|
+
export default StyledRespAreaToolbar;
|