@adminforth/rich-editor 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog.md +6 -0
- package/dist/index.js +6 -25
- package/dist/types.js +0 -14
- package/index.ts +5 -24
- package/package.json +1 -1
- package/types.ts +4 -24
- package/custom/node_modules/.package-lock.json +0 -66
- package/custom/node_modules/eventemitter3/LICENSE +0 -21
- package/custom/node_modules/eventemitter3/README.md +0 -94
- package/custom/node_modules/eventemitter3/dist/eventemitter3.esm.js +0 -347
- package/custom/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +0 -1
- package/custom/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +0 -1
- package/custom/node_modules/eventemitter3/dist/eventemitter3.umd.js +0 -355
- package/custom/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +0 -1
- package/custom/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +0 -1
- package/custom/node_modules/eventemitter3/index.d.ts +0 -135
- package/custom/node_modules/eventemitter3/index.js +0 -336
- package/custom/node_modules/eventemitter3/index.mjs +0 -4
- package/custom/node_modules/eventemitter3/package.json +0 -67
- package/custom/node_modules/fast-diff/LICENSE +0 -201
- package/custom/node_modules/fast-diff/README.md +0 -24
- package/custom/node_modules/fast-diff/diff.d.ts +0 -21
- package/custom/node_modules/fast-diff/diff.js +0 -1138
- package/custom/node_modules/fast-diff/package.json +0 -30
- package/custom/node_modules/lodash-es/LICENSE +0 -47
- package/custom/node_modules/lodash-es/README.md +0 -10
- package/custom/node_modules/lodash-es/_DataView.js +0 -7
- package/custom/node_modules/lodash-es/_Hash.js +0 -32
- package/custom/node_modules/lodash-es/_LazyWrapper.js +0 -28
- package/custom/node_modules/lodash-es/_ListCache.js +0 -32
- package/custom/node_modules/lodash-es/_LodashWrapper.js +0 -22
- package/custom/node_modules/lodash-es/_Map.js +0 -7
- package/custom/node_modules/lodash-es/_MapCache.js +0 -32
- package/custom/node_modules/lodash-es/_Promise.js +0 -7
- package/custom/node_modules/lodash-es/_Set.js +0 -7
- package/custom/node_modules/lodash-es/_SetCache.js +0 -27
- package/custom/node_modules/lodash-es/_Stack.js +0 -27
- package/custom/node_modules/lodash-es/_Symbol.js +0 -6
- package/custom/node_modules/lodash-es/_Uint8Array.js +0 -6
- package/custom/node_modules/lodash-es/_WeakMap.js +0 -7
- package/custom/node_modules/lodash-es/_addMapEntry.js +0 -15
- package/custom/node_modules/lodash-es/_addSetEntry.js +0 -15
- package/custom/node_modules/lodash-es/_apply.js +0 -21
- package/custom/node_modules/lodash-es/_arrayAggregator.js +0 -22
- package/custom/node_modules/lodash-es/_arrayEach.js +0 -22
- package/custom/node_modules/lodash-es/_arrayEachRight.js +0 -21
- package/custom/node_modules/lodash-es/_arrayEvery.js +0 -23
- package/custom/node_modules/lodash-es/_arrayFilter.js +0 -25
- package/custom/node_modules/lodash-es/_arrayIncludes.js +0 -17
- package/custom/node_modules/lodash-es/_arrayIncludesWith.js +0 -22
- package/custom/node_modules/lodash-es/_arrayLikeKeys.js +0 -49
- package/custom/node_modules/lodash-es/_arrayMap.js +0 -21
- package/custom/node_modules/lodash-es/_arrayPush.js +0 -20
- package/custom/node_modules/lodash-es/_arrayReduce.js +0 -26
- package/custom/node_modules/lodash-es/_arrayReduceRight.js +0 -24
- package/custom/node_modules/lodash-es/_arraySample.js +0 -15
- package/custom/node_modules/lodash-es/_arraySampleSize.js +0 -17
- package/custom/node_modules/lodash-es/_arrayShuffle.js +0 -15
- package/custom/node_modules/lodash-es/_arraySome.js +0 -23
- package/custom/node_modules/lodash-es/_asciiSize.js +0 -12
- package/custom/node_modules/lodash-es/_asciiToArray.js +0 -12
- package/custom/node_modules/lodash-es/_asciiWords.js +0 -15
- package/custom/node_modules/lodash-es/_assignMergeValue.js +0 -20
- package/custom/node_modules/lodash-es/_assignValue.js +0 -28
- package/custom/node_modules/lodash-es/_assocIndexOf.js +0 -21
- package/custom/node_modules/lodash-es/_baseAggregator.js +0 -21
- package/custom/node_modules/lodash-es/_baseAssign.js +0 -17
- package/custom/node_modules/lodash-es/_baseAssignIn.js +0 -17
- package/custom/node_modules/lodash-es/_baseAssignValue.js +0 -25
- package/custom/node_modules/lodash-es/_baseAt.js +0 -23
- package/custom/node_modules/lodash-es/_baseClamp.js +0 -22
- package/custom/node_modules/lodash-es/_baseClone.js +0 -166
- package/custom/node_modules/lodash-es/_baseConforms.js +0 -18
- package/custom/node_modules/lodash-es/_baseConformsTo.js +0 -27
- package/custom/node_modules/lodash-es/_baseCreate.js +0 -30
- package/custom/node_modules/lodash-es/_baseDelay.js +0 -21
- package/custom/node_modules/lodash-es/_baseDifference.js +0 -67
- package/custom/node_modules/lodash-es/_baseEach.js +0 -14
- package/custom/node_modules/lodash-es/_baseEachRight.js +0 -14
- package/custom/node_modules/lodash-es/_baseEvery.js +0 -21
- package/custom/node_modules/lodash-es/_baseExtremum.js +0 -32
- package/custom/node_modules/lodash-es/_baseFill.js +0 -32
- package/custom/node_modules/lodash-es/_baseFilter.js +0 -21
- package/custom/node_modules/lodash-es/_baseFindIndex.js +0 -24
- package/custom/node_modules/lodash-es/_baseFindKey.js +0 -23
- package/custom/node_modules/lodash-es/_baseFlatten.js +0 -38
- package/custom/node_modules/lodash-es/_baseFor.js +0 -16
- package/custom/node_modules/lodash-es/_baseForOwn.js +0 -16
- package/custom/node_modules/lodash-es/_baseForOwnRight.js +0 -16
- package/custom/node_modules/lodash-es/_baseForRight.js +0 -15
- package/custom/node_modules/lodash-es/_baseFunctions.js +0 -19
- package/custom/node_modules/lodash-es/_baseGet.js +0 -24
- package/custom/node_modules/lodash-es/_baseGetAllKeys.js +0 -20
- package/custom/node_modules/lodash-es/_baseGetTag.js +0 -28
- package/custom/node_modules/lodash-es/_baseGt.js +0 -14
- package/custom/node_modules/lodash-es/_baseHas.js +0 -19
- package/custom/node_modules/lodash-es/_baseHasIn.js +0 -13
- package/custom/node_modules/lodash-es/_baseInRange.js +0 -18
- package/custom/node_modules/lodash-es/_baseIndexOf.js +0 -20
- package/custom/node_modules/lodash-es/_baseIndexOfWith.js +0 -23
- package/custom/node_modules/lodash-es/_baseIntersection.js +0 -74
- package/custom/node_modules/lodash-es/_baseInverter.js +0 -21
- package/custom/node_modules/lodash-es/_baseInvoke.js +0 -24
- package/custom/node_modules/lodash-es/_baseIsArguments.js +0 -18
- package/custom/node_modules/lodash-es/_baseIsArrayBuffer.js +0 -17
- package/custom/node_modules/lodash-es/_baseIsDate.js +0 -18
- package/custom/node_modules/lodash-es/_baseIsEqual.js +0 -28
- package/custom/node_modules/lodash-es/_baseIsEqualDeep.js +0 -83
- package/custom/node_modules/lodash-es/_baseIsMap.js +0 -18
- package/custom/node_modules/lodash-es/_baseIsMatch.js +0 -62
- package/custom/node_modules/lodash-es/_baseIsNaN.js +0 -12
- package/custom/node_modules/lodash-es/_baseIsNative.js +0 -47
- package/custom/node_modules/lodash-es/_baseIsRegExp.js +0 -18
- package/custom/node_modules/lodash-es/_baseIsSet.js +0 -18
- package/custom/node_modules/lodash-es/_baseIsTypedArray.js +0 -60
- package/custom/node_modules/lodash-es/_baseIteratee.js +0 -31
- package/custom/node_modules/lodash-es/_baseKeys.js +0 -30
- package/custom/node_modules/lodash-es/_baseKeysIn.js +0 -33
- package/custom/node_modules/lodash-es/_baseLodash.js +0 -10
- package/custom/node_modules/lodash-es/_baseLt.js +0 -14
- package/custom/node_modules/lodash-es/_baseMap.js +0 -22
- package/custom/node_modules/lodash-es/_baseMatches.js +0 -22
- package/custom/node_modules/lodash-es/_baseMatchesProperty.js +0 -33
- package/custom/node_modules/lodash-es/_baseMean.js +0 -20
- package/custom/node_modules/lodash-es/_baseMerge.js +0 -42
- package/custom/node_modules/lodash-es/_baseMergeDeep.js +0 -94
- package/custom/node_modules/lodash-es/_baseNth.js +0 -20
- package/custom/node_modules/lodash-es/_baseOrderBy.js +0 -49
- package/custom/node_modules/lodash-es/_basePick.js +0 -19
- package/custom/node_modules/lodash-es/_basePickBy.js +0 -30
- package/custom/node_modules/lodash-es/_baseProperty.js +0 -14
- package/custom/node_modules/lodash-es/_basePropertyDeep.js +0 -16
- package/custom/node_modules/lodash-es/_basePropertyOf.js +0 -14
- package/custom/node_modules/lodash-es/_basePullAll.js +0 -51
- package/custom/node_modules/lodash-es/_basePullAt.js +0 -37
- package/custom/node_modules/lodash-es/_baseRandom.js +0 -18
- package/custom/node_modules/lodash-es/_baseRange.js +0 -28
- package/custom/node_modules/lodash-es/_baseReduce.js +0 -23
- package/custom/node_modules/lodash-es/_baseRepeat.js +0 -35
- package/custom/node_modules/lodash-es/_baseRest.js +0 -17
- package/custom/node_modules/lodash-es/_baseSample.js +0 -15
- package/custom/node_modules/lodash-es/_baseSampleSize.js +0 -18
- package/custom/node_modules/lodash-es/_baseSet.js +0 -51
- package/custom/node_modules/lodash-es/_baseSetData.js +0 -17
- package/custom/node_modules/lodash-es/_baseSetToString.js +0 -22
- package/custom/node_modules/lodash-es/_baseShuffle.js +0 -15
- package/custom/node_modules/lodash-es/_baseSlice.js +0 -31
- package/custom/node_modules/lodash-es/_baseSome.js +0 -22
- package/custom/node_modules/lodash-es/_baseSortBy.js +0 -21
- package/custom/node_modules/lodash-es/_baseSortedIndex.js +0 -42
- package/custom/node_modules/lodash-es/_baseSortedIndexBy.js +0 -67
- package/custom/node_modules/lodash-es/_baseSortedUniq.js +0 -30
- package/custom/node_modules/lodash-es/_baseSum.js +0 -24
- package/custom/node_modules/lodash-es/_baseTimes.js +0 -20
- package/custom/node_modules/lodash-es/_baseToNumber.js +0 -24
- package/custom/node_modules/lodash-es/_baseToPairs.js +0 -18
- package/custom/node_modules/lodash-es/_baseToString.js +0 -37
- package/custom/node_modules/lodash-es/_baseTrim.js +0 -19
- package/custom/node_modules/lodash-es/_baseUnary.js +0 -14
- package/custom/node_modules/lodash-es/_baseUniq.js +0 -72
- package/custom/node_modules/lodash-es/_baseUnset.js +0 -20
- package/custom/node_modules/lodash-es/_baseUpdate.js +0 -18
- package/custom/node_modules/lodash-es/_baseValues.js +0 -19
- package/custom/node_modules/lodash-es/_baseWhile.js +0 -26
- package/custom/node_modules/lodash-es/_baseWrapperValue.js +0 -25
- package/custom/node_modules/lodash-es/_baseXor.js +0 -36
- package/custom/node_modules/lodash-es/_baseZipObject.js +0 -23
- package/custom/node_modules/lodash-es/_cacheHas.js +0 -13
- package/custom/node_modules/lodash-es/_castArrayLikeObject.js +0 -14
- package/custom/node_modules/lodash-es/_castFunction.js +0 -14
- package/custom/node_modules/lodash-es/_castPath.js +0 -21
- package/custom/node_modules/lodash-es/_castRest.js +0 -14
- package/custom/node_modules/lodash-es/_castSlice.js +0 -18
- package/custom/node_modules/lodash-es/_charsEndIndex.js +0 -19
- package/custom/node_modules/lodash-es/_charsStartIndex.js +0 -20
- package/custom/node_modules/lodash-es/_cloneArrayBuffer.js +0 -16
- package/custom/node_modules/lodash-es/_cloneBuffer.js +0 -35
- package/custom/node_modules/lodash-es/_cloneDataView.js +0 -16
- package/custom/node_modules/lodash-es/_cloneMap.js +0 -22
- package/custom/node_modules/lodash-es/_cloneRegExp.js +0 -17
- package/custom/node_modules/lodash-es/_cloneSet.js +0 -22
- package/custom/node_modules/lodash-es/_cloneSymbol.js +0 -18
- package/custom/node_modules/lodash-es/_cloneTypedArray.js +0 -16
- package/custom/node_modules/lodash-es/_compareAscending.js +0 -41
- package/custom/node_modules/lodash-es/_compareMultiple.js +0 -44
- package/custom/node_modules/lodash-es/_composeArgs.js +0 -39
- package/custom/node_modules/lodash-es/_composeArgsRight.js +0 -41
- package/custom/node_modules/lodash-es/_copyArray.js +0 -20
- package/custom/node_modules/lodash-es/_copyObject.js +0 -40
- package/custom/node_modules/lodash-es/_copySymbols.js +0 -16
- package/custom/node_modules/lodash-es/_copySymbolsIn.js +0 -16
- package/custom/node_modules/lodash-es/_coreJsData.js +0 -6
- package/custom/node_modules/lodash-es/_countHolders.js +0 -21
- package/custom/node_modules/lodash-es/_createAggregator.js +0 -23
- package/custom/node_modules/lodash-es/_createAssigner.js +0 -37
- package/custom/node_modules/lodash-es/_createBaseEach.js +0 -32
- package/custom/node_modules/lodash-es/_createBaseFor.js +0 -25
- package/custom/node_modules/lodash-es/_createBind.js +0 -28
- package/custom/node_modules/lodash-es/_createCaseFirst.js +0 -33
- package/custom/node_modules/lodash-es/_createCompounder.js +0 -24
- package/custom/node_modules/lodash-es/_createCtor.js +0 -37
- package/custom/node_modules/lodash-es/_createCurry.js +0 -46
- package/custom/node_modules/lodash-es/_createFind.js +0 -25
- package/custom/node_modules/lodash-es/_createFlow.js +0 -78
- package/custom/node_modules/lodash-es/_createHybrid.js +0 -92
- package/custom/node_modules/lodash-es/_createInverter.js +0 -17
- package/custom/node_modules/lodash-es/_createMathOperation.js +0 -38
- package/custom/node_modules/lodash-es/_createOver.js +0 -27
- package/custom/node_modules/lodash-es/_createPadding.js +0 -33
- package/custom/node_modules/lodash-es/_createPartial.js +0 -43
- package/custom/node_modules/lodash-es/_createRange.js +0 -30
- package/custom/node_modules/lodash-es/_createRecurry.js +0 -56
- package/custom/node_modules/lodash-es/_createRelationalOperation.js +0 -20
- package/custom/node_modules/lodash-es/_createRound.js +0 -35
- package/custom/node_modules/lodash-es/_createSet.js +0 -19
- package/custom/node_modules/lodash-es/_createToPairs.js +0 -30
- package/custom/node_modules/lodash-es/_createWrap.js +0 -106
- package/custom/node_modules/lodash-es/_customDefaultsAssignIn.js +0 -29
- package/custom/node_modules/lodash-es/_customDefaultsMerge.js +0 -28
- package/custom/node_modules/lodash-es/_customOmitClone.js +0 -16
- package/custom/node_modules/lodash-es/_deburrLetter.js +0 -71
- package/custom/node_modules/lodash-es/_defineProperty.js +0 -11
- package/custom/node_modules/lodash-es/_equalArrays.js +0 -84
- package/custom/node_modules/lodash-es/_equalByTag.js +0 -112
- package/custom/node_modules/lodash-es/_equalObjects.js +0 -90
- package/custom/node_modules/lodash-es/_escapeHtmlChar.js +0 -21
- package/custom/node_modules/lodash-es/_escapeStringChar.js +0 -22
- package/custom/node_modules/lodash-es/_flatRest.js +0 -16
- package/custom/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/custom/node_modules/lodash-es/_getAllKeys.js +0 -16
- package/custom/node_modules/lodash-es/_getAllKeysIn.js +0 -17
- package/custom/node_modules/lodash-es/_getData.js +0 -15
- package/custom/node_modules/lodash-es/_getFuncName.js +0 -31
- package/custom/node_modules/lodash-es/_getHolder.js +0 -13
- package/custom/node_modules/lodash-es/_getMapData.js +0 -18
- package/custom/node_modules/lodash-es/_getMatchData.js +0 -24
- package/custom/node_modules/lodash-es/_getNative.js +0 -17
- package/custom/node_modules/lodash-es/_getPrototype.js +0 -6
- package/custom/node_modules/lodash-es/_getRawTag.js +0 -46
- package/custom/node_modules/lodash-es/_getSymbols.js +0 -30
- package/custom/node_modules/lodash-es/_getSymbolsIn.js +0 -25
- package/custom/node_modules/lodash-es/_getTag.js +0 -58
- package/custom/node_modules/lodash-es/_getValue.js +0 -13
- package/custom/node_modules/lodash-es/_getView.js +0 -33
- package/custom/node_modules/lodash-es/_getWrapDetails.js +0 -17
- package/custom/node_modules/lodash-es/_hasPath.js +0 -39
- package/custom/node_modules/lodash-es/_hasUnicode.js +0 -26
- package/custom/node_modules/lodash-es/_hasUnicodeWord.js +0 -15
- package/custom/node_modules/lodash-es/_hashClear.js +0 -15
- package/custom/node_modules/lodash-es/_hashDelete.js +0 -17
- package/custom/node_modules/lodash-es/_hashGet.js +0 -30
- package/custom/node_modules/lodash-es/_hashHas.js +0 -23
- package/custom/node_modules/lodash-es/_hashSet.js +0 -23
- package/custom/node_modules/lodash-es/_initCloneArray.js +0 -26
- package/custom/node_modules/lodash-es/_initCloneByTag.js +0 -77
- package/custom/node_modules/lodash-es/_initCloneObject.js +0 -18
- package/custom/node_modules/lodash-es/_insertWrapDetails.js +0 -23
- package/custom/node_modules/lodash-es/_isFlattenable.js +0 -20
- package/custom/node_modules/lodash-es/_isIndex.js +0 -25
- package/custom/node_modules/lodash-es/_isIterateeCall.js +0 -30
- package/custom/node_modules/lodash-es/_isKey.js +0 -29
- package/custom/node_modules/lodash-es/_isKeyable.js +0 -15
- package/custom/node_modules/lodash-es/_isLaziable.js +0 -28
- package/custom/node_modules/lodash-es/_isMaskable.js +0 -14
- package/custom/node_modules/lodash-es/_isMasked.js +0 -20
- package/custom/node_modules/lodash-es/_isPrototype.js +0 -18
- package/custom/node_modules/lodash-es/_isStrictComparable.js +0 -15
- package/custom/node_modules/lodash-es/_iteratorToArray.js +0 -18
- package/custom/node_modules/lodash-es/_lazyClone.js +0 -23
- package/custom/node_modules/lodash-es/_lazyReverse.js +0 -23
- package/custom/node_modules/lodash-es/_lazyValue.js +0 -69
- package/custom/node_modules/lodash-es/_listCacheClear.js +0 -13
- package/custom/node_modules/lodash-es/_listCacheDelete.js +0 -35
- package/custom/node_modules/lodash-es/_listCacheGet.js +0 -19
- package/custom/node_modules/lodash-es/_listCacheHas.js +0 -16
- package/custom/node_modules/lodash-es/_listCacheSet.js +0 -26
- package/custom/node_modules/lodash-es/_mapCacheClear.js +0 -21
- package/custom/node_modules/lodash-es/_mapCacheDelete.js +0 -18
- package/custom/node_modules/lodash-es/_mapCacheGet.js +0 -16
- package/custom/node_modules/lodash-es/_mapCacheHas.js +0 -16
- package/custom/node_modules/lodash-es/_mapCacheSet.js +0 -22
- package/custom/node_modules/lodash-es/_mapToArray.js +0 -18
- package/custom/node_modules/lodash-es/_matchesStrictComparable.js +0 -20
- package/custom/node_modules/lodash-es/_memoizeCapped.js +0 -26
- package/custom/node_modules/lodash-es/_mergeData.js +0 -90
- package/custom/node_modules/lodash-es/_metaMap.js +0 -6
- package/custom/node_modules/lodash-es/_nativeCreate.js +0 -6
- package/custom/node_modules/lodash-es/_nativeKeys.js +0 -6
- package/custom/node_modules/lodash-es/_nativeKeysIn.js +0 -20
- package/custom/node_modules/lodash-es/_nodeUtil.js +0 -30
- package/custom/node_modules/lodash-es/_objectToString.js +0 -22
- package/custom/node_modules/lodash-es/_overArg.js +0 -15
- package/custom/node_modules/lodash-es/_overRest.js +0 -36
- package/custom/node_modules/lodash-es/_parent.js +0 -16
- package/custom/node_modules/lodash-es/_reEscape.js +0 -4
- package/custom/node_modules/lodash-es/_reEvaluate.js +0 -4
- package/custom/node_modules/lodash-es/_reInterpolate.js +0 -4
- package/custom/node_modules/lodash-es/_realNames.js +0 -4
- package/custom/node_modules/lodash-es/_reorder.js +0 -29
- package/custom/node_modules/lodash-es/_replaceHolders.js +0 -29
- package/custom/node_modules/lodash-es/_root.js +0 -9
- package/custom/node_modules/lodash-es/_safeGet.js +0 -21
- package/custom/node_modules/lodash-es/_setCacheAdd.js +0 -19
- package/custom/node_modules/lodash-es/_setCacheHas.js +0 -14
- package/custom/node_modules/lodash-es/_setData.js +0 -20
- package/custom/node_modules/lodash-es/_setToArray.js +0 -18
- package/custom/node_modules/lodash-es/_setToPairs.js +0 -18
- package/custom/node_modules/lodash-es/_setToString.js +0 -14
- package/custom/node_modules/lodash-es/_setWrapToString.js +0 -21
- package/custom/node_modules/lodash-es/_shortOut.js +0 -37
- package/custom/node_modules/lodash-es/_shuffleSelf.js +0 -28
- package/custom/node_modules/lodash-es/_stackClear.js +0 -15
- package/custom/node_modules/lodash-es/_stackDelete.js +0 -18
- package/custom/node_modules/lodash-es/_stackGet.js +0 -14
- package/custom/node_modules/lodash-es/_stackHas.js +0 -14
- package/custom/node_modules/lodash-es/_stackSet.js +0 -34
- package/custom/node_modules/lodash-es/_strictIndexOf.js +0 -23
- package/custom/node_modules/lodash-es/_strictLastIndexOf.js +0 -21
- package/custom/node_modules/lodash-es/_stringSize.js +0 -18
- package/custom/node_modules/lodash-es/_stringToArray.js +0 -18
- package/custom/node_modules/lodash-es/_stringToPath.js +0 -27
- package/custom/node_modules/lodash-es/_toKey.js +0 -21
- package/custom/node_modules/lodash-es/_toSource.js +0 -26
- package/custom/node_modules/lodash-es/_trimmedEndIndex.js +0 -19
- package/custom/node_modules/lodash-es/_unescapeHtmlChar.js +0 -21
- package/custom/node_modules/lodash-es/_unicodeSize.js +0 -44
- package/custom/node_modules/lodash-es/_unicodeToArray.js +0 -40
- package/custom/node_modules/lodash-es/_unicodeWords.js +0 -69
- package/custom/node_modules/lodash-es/_updateWrapDetails.js +0 -46
- package/custom/node_modules/lodash-es/_wrapperClone.js +0 -23
- package/custom/node_modules/lodash-es/add.js +0 -22
- package/custom/node_modules/lodash-es/after.js +0 -42
- package/custom/node_modules/lodash-es/array.default.js +0 -81
- package/custom/node_modules/lodash-es/array.js +0 -66
- package/custom/node_modules/lodash-es/ary.js +0 -29
- package/custom/node_modules/lodash-es/assign.js +0 -58
- package/custom/node_modules/lodash-es/assignIn.js +0 -40
- package/custom/node_modules/lodash-es/assignInWith.js +0 -38
- package/custom/node_modules/lodash-es/assignWith.js +0 -37
- package/custom/node_modules/lodash-es/at.js +0 -23
- package/custom/node_modules/lodash-es/attempt.js +0 -35
- package/custom/node_modules/lodash-es/before.js +0 -40
- package/custom/node_modules/lodash-es/bind.js +0 -57
- package/custom/node_modules/lodash-es/bindAll.js +0 -41
- package/custom/node_modules/lodash-es/bindKey.js +0 -68
- package/custom/node_modules/lodash-es/camelCase.js +0 -29
- package/custom/node_modules/lodash-es/capitalize.js +0 -23
- package/custom/node_modules/lodash-es/castArray.js +0 -44
- package/custom/node_modules/lodash-es/ceil.js +0 -26
- package/custom/node_modules/lodash-es/chain.js +0 -38
- package/custom/node_modules/lodash-es/chunk.js +0 -50
- package/custom/node_modules/lodash-es/clamp.js +0 -39
- package/custom/node_modules/lodash-es/clone.js +0 -36
- package/custom/node_modules/lodash-es/cloneDeep.js +0 -29
- package/custom/node_modules/lodash-es/cloneDeepWith.js +0 -40
- package/custom/node_modules/lodash-es/cloneWith.js +0 -42
- package/custom/node_modules/lodash-es/collection.default.js +0 -37
- package/custom/node_modules/lodash-es/collection.js +0 -29
- package/custom/node_modules/lodash-es/commit.js +0 -33
- package/custom/node_modules/lodash-es/compact.js +0 -31
- package/custom/node_modules/lodash-es/concat.js +0 -43
- package/custom/node_modules/lodash-es/cond.js +0 -60
- package/custom/node_modules/lodash-es/conforms.js +0 -35
- package/custom/node_modules/lodash-es/conformsTo.js +0 -32
- package/custom/node_modules/lodash-es/constant.js +0 -26
- package/custom/node_modules/lodash-es/countBy.js +0 -40
- package/custom/node_modules/lodash-es/create.js +0 -43
- package/custom/node_modules/lodash-es/curry.js +0 -57
- package/custom/node_modules/lodash-es/curryRight.js +0 -54
- package/custom/node_modules/lodash-es/date.default.js +0 -5
- package/custom/node_modules/lodash-es/date.js +0 -2
- package/custom/node_modules/lodash-es/debounce.js +0 -191
- package/custom/node_modules/lodash-es/deburr.js +0 -45
- package/custom/node_modules/lodash-es/defaultTo.js +0 -25
- package/custom/node_modules/lodash-es/defaults.js +0 -64
- package/custom/node_modules/lodash-es/defaultsDeep.js +0 -30
- package/custom/node_modules/lodash-es/defer.js +0 -26
- package/custom/node_modules/lodash-es/delay.js +0 -28
- package/custom/node_modules/lodash-es/difference.js +0 -33
- package/custom/node_modules/lodash-es/differenceBy.js +0 -44
- package/custom/node_modules/lodash-es/differenceWith.js +0 -40
- package/custom/node_modules/lodash-es/divide.js +0 -22
- package/custom/node_modules/lodash-es/drop.js +0 -38
- package/custom/node_modules/lodash-es/dropRight.js +0 -39
- package/custom/node_modules/lodash-es/dropRightWhile.js +0 -45
- package/custom/node_modules/lodash-es/dropWhile.js +0 -45
- package/custom/node_modules/lodash-es/each.js +0 -1
- package/custom/node_modules/lodash-es/eachRight.js +0 -1
- package/custom/node_modules/lodash-es/endsWith.js +0 -43
- package/custom/node_modules/lodash-es/entries.js +0 -1
- package/custom/node_modules/lodash-es/entriesIn.js +0 -1
- package/custom/node_modules/lodash-es/eq.js +0 -37
- package/custom/node_modules/lodash-es/escape.js +0 -43
- package/custom/node_modules/lodash-es/escapeRegExp.js +0 -32
- package/custom/node_modules/lodash-es/every.js +0 -56
- package/custom/node_modules/lodash-es/extend.js +0 -1
- package/custom/node_modules/lodash-es/extendWith.js +0 -1
- package/custom/node_modules/lodash-es/fill.js +0 -45
- package/custom/node_modules/lodash-es/filter.js +0 -52
- package/custom/node_modules/lodash-es/find.js +0 -42
- package/custom/node_modules/lodash-es/findIndex.js +0 -55
- package/custom/node_modules/lodash-es/findKey.js +0 -44
- package/custom/node_modules/lodash-es/findLast.js +0 -25
- package/custom/node_modules/lodash-es/findLastIndex.js +0 -59
- package/custom/node_modules/lodash-es/findLastKey.js +0 -44
- package/custom/node_modules/lodash-es/first.js +0 -1
- package/custom/node_modules/lodash-es/flake.lock +0 -40
- package/custom/node_modules/lodash-es/flake.nix +0 -20
- package/custom/node_modules/lodash-es/flatMap.js +0 -29
- package/custom/node_modules/lodash-es/flatMapDeep.js +0 -31
- package/custom/node_modules/lodash-es/flatMapDepth.js +0 -31
- package/custom/node_modules/lodash-es/flatten.js +0 -22
- package/custom/node_modules/lodash-es/flattenDeep.js +0 -25
- package/custom/node_modules/lodash-es/flattenDepth.js +0 -33
- package/custom/node_modules/lodash-es/flip.js +0 -28
- package/custom/node_modules/lodash-es/floor.js +0 -26
- package/custom/node_modules/lodash-es/flow.js +0 -27
- package/custom/node_modules/lodash-es/flowRight.js +0 -26
- package/custom/node_modules/lodash-es/forEach.js +0 -41
- package/custom/node_modules/lodash-es/forEachRight.js +0 -31
- package/custom/node_modules/lodash-es/forIn.js +0 -39
- package/custom/node_modules/lodash-es/forInRight.js +0 -37
- package/custom/node_modules/lodash-es/forOwn.js +0 -36
- package/custom/node_modules/lodash-es/forOwnRight.js +0 -34
- package/custom/node_modules/lodash-es/fromPairs.js +0 -28
- package/custom/node_modules/lodash-es/function.default.js +0 -31
- package/custom/node_modules/lodash-es/function.js +0 -24
- package/custom/node_modules/lodash-es/functions.js +0 -31
- package/custom/node_modules/lodash-es/functionsIn.js +0 -31
- package/custom/node_modules/lodash-es/get.js +0 -33
- package/custom/node_modules/lodash-es/groupBy.js +0 -41
- package/custom/node_modules/lodash-es/gt.js +0 -29
- package/custom/node_modules/lodash-es/gte.js +0 -30
- package/custom/node_modules/lodash-es/has.js +0 -35
- package/custom/node_modules/lodash-es/hasIn.js +0 -34
- package/custom/node_modules/lodash-es/head.js +0 -23
- package/custom/node_modules/lodash-es/identity.js +0 -21
- package/custom/node_modules/lodash-es/inRange.js +0 -55
- package/custom/node_modules/lodash-es/includes.js +0 -53
- package/custom/node_modules/lodash-es/indexOf.js +0 -42
- package/custom/node_modules/lodash-es/initial.js +0 -22
- package/custom/node_modules/lodash-es/intersection.js +0 -30
- package/custom/node_modules/lodash-es/intersectionBy.js +0 -45
- package/custom/node_modules/lodash-es/intersectionWith.js +0 -41
- package/custom/node_modules/lodash-es/invert.js +0 -42
- package/custom/node_modules/lodash-es/invertBy.js +0 -56
- package/custom/node_modules/lodash-es/invoke.js +0 -24
- package/custom/node_modules/lodash-es/invokeMap.js +0 -41
- package/custom/node_modules/lodash-es/isArguments.js +0 -36
- package/custom/node_modules/lodash-es/isArray.js +0 -26
- package/custom/node_modules/lodash-es/isArrayBuffer.js +0 -27
- package/custom/node_modules/lodash-es/isArrayLike.js +0 -33
- package/custom/node_modules/lodash-es/isArrayLikeObject.js +0 -33
- package/custom/node_modules/lodash-es/isBoolean.js +0 -29
- package/custom/node_modules/lodash-es/isBuffer.js +0 -38
- package/custom/node_modules/lodash-es/isDate.js +0 -27
- package/custom/node_modules/lodash-es/isElement.js +0 -25
- package/custom/node_modules/lodash-es/isEmpty.js +0 -77
- package/custom/node_modules/lodash-es/isEqual.js +0 -35
- package/custom/node_modules/lodash-es/isEqualWith.js +0 -41
- package/custom/node_modules/lodash-es/isError.js +0 -36
- package/custom/node_modules/lodash-es/isFinite.js +0 -36
- package/custom/node_modules/lodash-es/isFunction.js +0 -37
- package/custom/node_modules/lodash-es/isInteger.js +0 -33
- package/custom/node_modules/lodash-es/isLength.js +0 -35
- package/custom/node_modules/lodash-es/isMap.js +0 -27
- package/custom/node_modules/lodash-es/isMatch.js +0 -36
- package/custom/node_modules/lodash-es/isMatchWith.js +0 -41
- package/custom/node_modules/lodash-es/isNaN.js +0 -38
- package/custom/node_modules/lodash-es/isNative.js +0 -40
- package/custom/node_modules/lodash-es/isNil.js +0 -25
- package/custom/node_modules/lodash-es/isNull.js +0 -22
- package/custom/node_modules/lodash-es/isNumber.js +0 -38
- package/custom/node_modules/lodash-es/isObject.js +0 -31
- package/custom/node_modules/lodash-es/isObjectLike.js +0 -29
- package/custom/node_modules/lodash-es/isPlainObject.js +0 -62
- package/custom/node_modules/lodash-es/isRegExp.js +0 -27
- package/custom/node_modules/lodash-es/isSafeInteger.js +0 -37
- package/custom/node_modules/lodash-es/isSet.js +0 -27
- package/custom/node_modules/lodash-es/isString.js +0 -30
- package/custom/node_modules/lodash-es/isSymbol.js +0 -29
- package/custom/node_modules/lodash-es/isTypedArray.js +0 -27
- package/custom/node_modules/lodash-es/isUndefined.js +0 -22
- package/custom/node_modules/lodash-es/isWeakMap.js +0 -28
- package/custom/node_modules/lodash-es/isWeakSet.js +0 -28
- package/custom/node_modules/lodash-es/iteratee.js +0 -53
- package/custom/node_modules/lodash-es/join.js +0 -26
- package/custom/node_modules/lodash-es/kebabCase.js +0 -28
- package/custom/node_modules/lodash-es/keyBy.js +0 -36
- package/custom/node_modules/lodash-es/keys.js +0 -37
- package/custom/node_modules/lodash-es/keysIn.js +0 -32
- package/custom/node_modules/lodash-es/lang.default.js +0 -71
- package/custom/node_modules/lodash-es/lang.js +0 -57
- package/custom/node_modules/lodash-es/last.js +0 -20
- package/custom/node_modules/lodash-es/lastIndexOf.js +0 -46
- package/custom/node_modules/lodash-es/lodash.default.js +0 -643
- package/custom/node_modules/lodash-es/lodash.js +0 -331
- package/custom/node_modules/lodash-es/lowerCase.js +0 -27
- package/custom/node_modules/lodash-es/lowerFirst.js +0 -22
- package/custom/node_modules/lodash-es/lt.js +0 -29
- package/custom/node_modules/lodash-es/lte.js +0 -30
- package/custom/node_modules/lodash-es/map.js +0 -53
- package/custom/node_modules/lodash-es/mapKeys.js +0 -36
- package/custom/node_modules/lodash-es/mapValues.js +0 -43
- package/custom/node_modules/lodash-es/matches.js +0 -46
- package/custom/node_modules/lodash-es/matchesProperty.js +0 -44
- package/custom/node_modules/lodash-es/math.default.js +0 -21
- package/custom/node_modules/lodash-es/math.js +0 -16
- package/custom/node_modules/lodash-es/max.js +0 -29
- package/custom/node_modules/lodash-es/maxBy.js +0 -34
- package/custom/node_modules/lodash-es/mean.js +0 -22
- package/custom/node_modules/lodash-es/meanBy.js +0 -31
- package/custom/node_modules/lodash-es/memoize.js +0 -73
- package/custom/node_modules/lodash-es/merge.js +0 -39
- package/custom/node_modules/lodash-es/mergeWith.js +0 -39
- package/custom/node_modules/lodash-es/method.js +0 -34
- package/custom/node_modules/lodash-es/methodOf.js +0 -33
- package/custom/node_modules/lodash-es/min.js +0 -29
- package/custom/node_modules/lodash-es/minBy.js +0 -34
- package/custom/node_modules/lodash-es/mixin.js +0 -74
- package/custom/node_modules/lodash-es/multiply.js +0 -22
- package/custom/node_modules/lodash-es/negate.js +0 -40
- package/custom/node_modules/lodash-es/next.js +0 -35
- package/custom/node_modules/lodash-es/noop.js +0 -17
- package/custom/node_modules/lodash-es/now.js +0 -23
- package/custom/node_modules/lodash-es/nth.js +0 -29
- package/custom/node_modules/lodash-es/nthArg.js +0 -32
- package/custom/node_modules/lodash-es/number.default.js +0 -7
- package/custom/node_modules/lodash-es/number.js +0 -4
- package/custom/node_modules/lodash-es/object.default.js +0 -60
- package/custom/node_modules/lodash-es/object.js +0 -48
- package/custom/node_modules/lodash-es/omit.js +0 -57
- package/custom/node_modules/lodash-es/omitBy.js +0 -29
- package/custom/node_modules/lodash-es/once.js +0 -25
- package/custom/node_modules/lodash-es/orderBy.js +0 -47
- package/custom/node_modules/lodash-es/over.js +0 -24
- package/custom/node_modules/lodash-es/overArgs.js +0 -61
- package/custom/node_modules/lodash-es/overEvery.js +0 -34
- package/custom/node_modules/lodash-es/overSome.js +0 -37
- package/custom/node_modules/lodash-es/package.json +0 -21
- package/custom/node_modules/lodash-es/pad.js +0 -49
- package/custom/node_modules/lodash-es/padEnd.js +0 -39
- package/custom/node_modules/lodash-es/padStart.js +0 -39
- package/custom/node_modules/lodash-es/parseInt.js +0 -43
- package/custom/node_modules/lodash-es/partial.js +0 -50
- package/custom/node_modules/lodash-es/partialRight.js +0 -49
- package/custom/node_modules/lodash-es/partition.js +0 -43
- package/custom/node_modules/lodash-es/pick.js +0 -25
- package/custom/node_modules/lodash-es/pickBy.js +0 -37
- package/custom/node_modules/lodash-es/plant.js +0 -48
- package/custom/node_modules/lodash-es/property.js +0 -32
- package/custom/node_modules/lodash-es/propertyOf.js +0 -30
- package/custom/node_modules/lodash-es/pull.js +0 -29
- package/custom/node_modules/lodash-es/pullAll.js +0 -29
- package/custom/node_modules/lodash-es/pullAllBy.js +0 -33
- package/custom/node_modules/lodash-es/pullAllWith.js +0 -32
- package/custom/node_modules/lodash-es/pullAt.js +0 -43
- package/custom/node_modules/lodash-es/random.js +0 -82
- package/custom/node_modules/lodash-es/range.js +0 -46
- package/custom/node_modules/lodash-es/rangeRight.js +0 -41
- package/custom/node_modules/lodash-es/rearg.js +0 -33
- package/custom/node_modules/lodash-es/reduce.js +0 -51
- package/custom/node_modules/lodash-es/reduceRight.js +0 -36
- package/custom/node_modules/lodash-es/reject.js +0 -46
- package/custom/node_modules/lodash-es/release.md +0 -48
- package/custom/node_modules/lodash-es/remove.js +0 -53
- package/custom/node_modules/lodash-es/repeat.js +0 -37
- package/custom/node_modules/lodash-es/replace.js +0 -29
- package/custom/node_modules/lodash-es/rest.js +0 -40
- package/custom/node_modules/lodash-es/result.js +0 -56
- package/custom/node_modules/lodash-es/reverse.js +0 -34
- package/custom/node_modules/lodash-es/round.js +0 -26
- package/custom/node_modules/lodash-es/sample.js +0 -24
- package/custom/node_modules/lodash-es/sampleSize.js +0 -37
- package/custom/node_modules/lodash-es/seq.default.js +0 -20
- package/custom/node_modules/lodash-es/seq.js +0 -15
- package/custom/node_modules/lodash-es/set.js +0 -35
- package/custom/node_modules/lodash-es/setWith.js +0 -32
- package/custom/node_modules/lodash-es/shuffle.js +0 -25
- package/custom/node_modules/lodash-es/size.js +0 -46
- package/custom/node_modules/lodash-es/slice.js +0 -37
- package/custom/node_modules/lodash-es/snakeCase.js +0 -28
- package/custom/node_modules/lodash-es/some.js +0 -51
- package/custom/node_modules/lodash-es/sortBy.js +0 -48
- package/custom/node_modules/lodash-es/sortedIndex.js +0 -24
- package/custom/node_modules/lodash-es/sortedIndexBy.js +0 -33
- package/custom/node_modules/lodash-es/sortedIndexOf.js +0 -31
- package/custom/node_modules/lodash-es/sortedLastIndex.js +0 -25
- package/custom/node_modules/lodash-es/sortedLastIndexBy.js +0 -33
- package/custom/node_modules/lodash-es/sortedLastIndexOf.js +0 -31
- package/custom/node_modules/lodash-es/sortedUniq.js +0 -24
- package/custom/node_modules/lodash-es/sortedUniqBy.js +0 -26
- package/custom/node_modules/lodash-es/split.js +0 -52
- package/custom/node_modules/lodash-es/spread.js +0 -63
- package/custom/node_modules/lodash-es/startCase.js +0 -29
- package/custom/node_modules/lodash-es/startsWith.js +0 -39
- package/custom/node_modules/lodash-es/string.default.js +0 -41
- package/custom/node_modules/lodash-es/string.js +0 -32
- package/custom/node_modules/lodash-es/stubArray.js +0 -23
- package/custom/node_modules/lodash-es/stubFalse.js +0 -18
- package/custom/node_modules/lodash-es/stubObject.js +0 -23
- package/custom/node_modules/lodash-es/stubString.js +0 -18
- package/custom/node_modules/lodash-es/stubTrue.js +0 -18
- package/custom/node_modules/lodash-es/subtract.js +0 -22
- package/custom/node_modules/lodash-es/sum.js +0 -24
- package/custom/node_modules/lodash-es/sumBy.js +0 -33
- package/custom/node_modules/lodash-es/tail.js +0 -22
- package/custom/node_modules/lodash-es/take.js +0 -37
- package/custom/node_modules/lodash-es/takeRight.js +0 -39
- package/custom/node_modules/lodash-es/takeRightWhile.js +0 -45
- package/custom/node_modules/lodash-es/takeWhile.js +0 -45
- package/custom/node_modules/lodash-es/tap.js +0 -29
- package/custom/node_modules/lodash-es/template.js +0 -272
- package/custom/node_modules/lodash-es/templateSettings.js +0 -67
- package/custom/node_modules/lodash-es/throttle.js +0 -69
- package/custom/node_modules/lodash-es/thru.js +0 -28
- package/custom/node_modules/lodash-es/times.js +0 -51
- package/custom/node_modules/lodash-es/toArray.js +0 -58
- package/custom/node_modules/lodash-es/toFinite.js +0 -42
- package/custom/node_modules/lodash-es/toInteger.js +0 -36
- package/custom/node_modules/lodash-es/toIterator.js +0 -23
- package/custom/node_modules/lodash-es/toJSON.js +0 -1
- package/custom/node_modules/lodash-es/toLength.js +0 -38
- package/custom/node_modules/lodash-es/toLower.js +0 -28
- package/custom/node_modules/lodash-es/toNumber.js +0 -64
- package/custom/node_modules/lodash-es/toPairs.js +0 -30
- package/custom/node_modules/lodash-es/toPairsIn.js +0 -30
- package/custom/node_modules/lodash-es/toPath.js +0 -33
- package/custom/node_modules/lodash-es/toPlainObject.js +0 -32
- package/custom/node_modules/lodash-es/toSafeInteger.js +0 -37
- package/custom/node_modules/lodash-es/toString.js +0 -28
- package/custom/node_modules/lodash-es/toUpper.js +0 -28
- package/custom/node_modules/lodash-es/transform.js +0 -65
- package/custom/node_modules/lodash-es/trim.js +0 -47
- package/custom/node_modules/lodash-es/trimEnd.js +0 -41
- package/custom/node_modules/lodash-es/trimStart.js +0 -43
- package/custom/node_modules/lodash-es/truncate.js +0 -111
- package/custom/node_modules/lodash-es/unary.js +0 -22
- package/custom/node_modules/lodash-es/unescape.js +0 -34
- package/custom/node_modules/lodash-es/union.js +0 -26
- package/custom/node_modules/lodash-es/unionBy.js +0 -39
- package/custom/node_modules/lodash-es/unionWith.js +0 -34
- package/custom/node_modules/lodash-es/uniq.js +0 -25
- package/custom/node_modules/lodash-es/uniqBy.js +0 -31
- package/custom/node_modules/lodash-es/uniqWith.js +0 -28
- package/custom/node_modules/lodash-es/uniqueId.js +0 -28
- package/custom/node_modules/lodash-es/unset.js +0 -34
- package/custom/node_modules/lodash-es/unzip.js +0 -45
- package/custom/node_modules/lodash-es/unzipWith.js +0 -39
- package/custom/node_modules/lodash-es/update.js +0 -35
- package/custom/node_modules/lodash-es/updateWith.js +0 -33
- package/custom/node_modules/lodash-es/upperCase.js +0 -27
- package/custom/node_modules/lodash-es/upperFirst.js +0 -22
- package/custom/node_modules/lodash-es/util.default.js +0 -42
- package/custom/node_modules/lodash-es/util.js +0 -33
- package/custom/node_modules/lodash-es/value.js +0 -1
- package/custom/node_modules/lodash-es/valueOf.js +0 -1
- package/custom/node_modules/lodash-es/values.js +0 -34
- package/custom/node_modules/lodash-es/valuesIn.js +0 -32
- package/custom/node_modules/lodash-es/without.js +0 -31
- package/custom/node_modules/lodash-es/words.js +0 -35
- package/custom/node_modules/lodash-es/wrap.js +0 -30
- package/custom/node_modules/lodash-es/wrapperAt.js +0 -48
- package/custom/node_modules/lodash-es/wrapperChain.js +0 -34
- package/custom/node_modules/lodash-es/wrapperLodash.js +0 -147
- package/custom/node_modules/lodash-es/wrapperReverse.js +0 -44
- package/custom/node_modules/lodash-es/wrapperValue.js +0 -21
- package/custom/node_modules/lodash-es/xor.js +0 -28
- package/custom/node_modules/lodash-es/xorBy.js +0 -39
- package/custom/node_modules/lodash-es/xorWith.js +0 -34
- package/custom/node_modules/lodash-es/zip.js +0 -22
- package/custom/node_modules/lodash-es/zipObject.js +0 -24
- package/custom/node_modules/lodash-es/zipObjectDeep.js +0 -23
- package/custom/node_modules/lodash-es/zipWith.js +0 -32
- package/custom/node_modules/lodash.clonedeep/LICENSE +0 -47
- package/custom/node_modules/lodash.clonedeep/README.md +0 -18
- package/custom/node_modules/lodash.clonedeep/index.js +0 -1748
- package/custom/node_modules/lodash.clonedeep/package.json +0 -17
- package/custom/node_modules/lodash.isequal/LICENSE +0 -47
- package/custom/node_modules/lodash.isequal/README.md +0 -18
- package/custom/node_modules/lodash.isequal/index.js +0 -1848
- package/custom/node_modules/lodash.isequal/package.json +0 -16
- package/custom/node_modules/parchment/LICENSE +0 -30
- package/custom/node_modules/parchment/README.md +0 -271
- package/custom/node_modules/parchment/dist/parchment.d.ts +0 -453
- package/custom/node_modules/parchment/dist/parchment.js +0 -847
- package/custom/node_modules/parchment/dist/parchment.js.map +0 -1
- package/custom/node_modules/parchment/dist/parchment.umd.cjs +0 -2
- package/custom/node_modules/parchment/dist/parchment.umd.cjs.map +0 -1
- package/custom/node_modules/parchment/package.json +0 -53
- package/custom/node_modules/parchment/src/attributor/attributor.ts +0 -62
- package/custom/node_modules/parchment/src/attributor/class.ts +0 -43
- package/custom/node_modules/parchment/src/attributor/store.ts +0 -79
- package/custom/node_modules/parchment/src/attributor/style.ts +0 -44
- package/custom/node_modules/parchment/src/blot/abstract/blot.ts +0 -128
- package/custom/node_modules/parchment/src/blot/abstract/container.ts +0 -48
- package/custom/node_modules/parchment/src/blot/abstract/leaf.ts +0 -57
- package/custom/node_modules/parchment/src/blot/abstract/parent.ts +0 -400
- package/custom/node_modules/parchment/src/blot/abstract/shadow.ts +0 -188
- package/custom/node_modules/parchment/src/blot/block.ts +0 -123
- package/custom/node_modules/parchment/src/blot/embed.ts +0 -34
- package/custom/node_modules/parchment/src/blot/inline.ts +0 -159
- package/custom/node_modules/parchment/src/blot/scroll.ts +0 -216
- package/custom/node_modules/parchment/src/blot/text.ts +0 -100
- package/custom/node_modules/parchment/src/collection/linked-list.ts +0 -201
- package/custom/node_modules/parchment/src/collection/linked-node.ts +0 -8
- package/custom/node_modules/parchment/src/error.ts +0 -12
- package/custom/node_modules/parchment/src/parchment.ts +0 -48
- package/custom/node_modules/parchment/src/registry.ts +0 -155
- package/custom/node_modules/parchment/src/scope.ts +0 -18
- package/custom/node_modules/parchment/tsconfig.json +0 -16
- package/custom/node_modules/quill/LICENSE +0 -31
- package/custom/node_modules/quill/README.md +0 -104
- package/custom/node_modules/quill/assets/base.styl +0 -309
- package/custom/node_modules/quill/assets/bubble/toolbar.styl +0 -14
- package/custom/node_modules/quill/assets/bubble/tooltip.styl +0 -49
- package/custom/node_modules/quill/assets/bubble.styl +0 -45
- package/custom/node_modules/quill/assets/core.styl +0 -215
- package/custom/node_modules/quill/assets/favicon.png +0 -0
- package/custom/node_modules/quill/assets/icons/align-center.svg +0 -5
- package/custom/node_modules/quill/assets/icons/align-justify.svg +0 -5
- package/custom/node_modules/quill/assets/icons/align-left.svg +0 -5
- package/custom/node_modules/quill/assets/icons/align-right.svg +0 -5
- package/custom/node_modules/quill/assets/icons/attachment.svg +0 -3
- package/custom/node_modules/quill/assets/icons/audio.svg +0 -5
- package/custom/node_modules/quill/assets/icons/authorship.svg +0 -5
- package/custom/node_modules/quill/assets/icons/background.svg +0 -52
- package/custom/node_modules/quill/assets/icons/blockquote.svg +0 -6
- package/custom/node_modules/quill/assets/icons/bold.svg +0 -4
- package/custom/node_modules/quill/assets/icons/clean.svg +0 -7
- package/custom/node_modules/quill/assets/icons/code.svg +0 -5
- package/custom/node_modules/quill/assets/icons/color.svg +0 -5
- package/custom/node_modules/quill/assets/icons/comment.svg +0 -3
- package/custom/node_modules/quill/assets/icons/direction-ltr.svg +0 -7
- package/custom/node_modules/quill/assets/icons/direction-rtl.svg +0 -7
- package/custom/node_modules/quill/assets/icons/dropdown.svg +0 -4
- package/custom/node_modules/quill/assets/icons/embed.svg +0 -3
- package/custom/node_modules/quill/assets/icons/emoji.svg +0 -6
- package/custom/node_modules/quill/assets/icons/float-center.svg +0 -5
- package/custom/node_modules/quill/assets/icons/float-full.svg +0 -5
- package/custom/node_modules/quill/assets/icons/float-left.svg +0 -7
- package/custom/node_modules/quill/assets/icons/float-right.svg +0 -7
- package/custom/node_modules/quill/assets/icons/font.svg +0 -5
- package/custom/node_modules/quill/assets/icons/formula.svg +0 -5
- package/custom/node_modules/quill/assets/icons/hashtag.svg +0 -6
- package/custom/node_modules/quill/assets/icons/header-2.svg +0 -3
- package/custom/node_modules/quill/assets/icons/header-3.svg +0 -3
- package/custom/node_modules/quill/assets/icons/header-4.svg +0 -3
- package/custom/node_modules/quill/assets/icons/header-5.svg +0 -3
- package/custom/node_modules/quill/assets/icons/header-6.svg +0 -3
- package/custom/node_modules/quill/assets/icons/header.svg +0 -3
- package/custom/node_modules/quill/assets/icons/horizontal-rule.svg +0 -4
- package/custom/node_modules/quill/assets/icons/image.svg +0 -5
- package/custom/node_modules/quill/assets/icons/indent.svg +0 -6
- package/custom/node_modules/quill/assets/icons/italic.svg +0 -5
- package/custom/node_modules/quill/assets/icons/link.svg +0 -5
- package/custom/node_modules/quill/assets/icons/list-bullet.svg +0 -8
- package/custom/node_modules/quill/assets/icons/list-check.svg +0 -8
- package/custom/node_modules/quill/assets/icons/list-ordered.svg +0 -9
- package/custom/node_modules/quill/assets/icons/map.svg +0 -5
- package/custom/node_modules/quill/assets/icons/mention.svg +0 -4
- package/custom/node_modules/quill/assets/icons/more.svg +0 -3
- package/custom/node_modules/quill/assets/icons/outdent.svg +0 -6
- package/custom/node_modules/quill/assets/icons/redo.svg +0 -4
- package/custom/node_modules/quill/assets/icons/size-decrease.svg +0 -5
- package/custom/node_modules/quill/assets/icons/size-increase.svg +0 -6
- package/custom/node_modules/quill/assets/icons/size.svg +0 -6
- package/custom/node_modules/quill/assets/icons/spacing.svg +0 -9
- package/custom/node_modules/quill/assets/icons/speech.svg +0 -6
- package/custom/node_modules/quill/assets/icons/strike.svg +0 -5
- package/custom/node_modules/quill/assets/icons/subscript.svg +0 -4
- package/custom/node_modules/quill/assets/icons/superscript.svg +0 -4
- package/custom/node_modules/quill/assets/icons/table-border-all.svg +0 -5
- package/custom/node_modules/quill/assets/icons/table-border-bottom.svg +0 -28
- package/custom/node_modules/quill/assets/icons/table-border-left.svg +0 -28
- package/custom/node_modules/quill/assets/icons/table-border-none.svg +0 -25
- package/custom/node_modules/quill/assets/icons/table-border-outside.svg +0 -35
- package/custom/node_modules/quill/assets/icons/table-border-right.svg +0 -28
- package/custom/node_modules/quill/assets/icons/table-border-top.svg +0 -28
- package/custom/node_modules/quill/assets/icons/table-delete-cells.svg +0 -13
- package/custom/node_modules/quill/assets/icons/table-delete-columns.svg +0 -8
- package/custom/node_modules/quill/assets/icons/table-delete-rows.svg +0 -9
- package/custom/node_modules/quill/assets/icons/table-insert-cells.svg +0 -13
- package/custom/node_modules/quill/assets/icons/table-insert-columns.svg +0 -8
- package/custom/node_modules/quill/assets/icons/table-insert-rows.svg +0 -9
- package/custom/node_modules/quill/assets/icons/table-merge-cells.svg +0 -4
- package/custom/node_modules/quill/assets/icons/table-unmerge-cells.svg +0 -7
- package/custom/node_modules/quill/assets/icons/table.svg +0 -11
- package/custom/node_modules/quill/assets/icons/underline.svg +0 -4
- package/custom/node_modules/quill/assets/icons/undo.svg +0 -4
- package/custom/node_modules/quill/assets/icons/video.svg +0 -14
- package/custom/node_modules/quill/assets/snow/toolbar.styl +0 -26
- package/custom/node_modules/quill/assets/snow/tooltip.styl +0 -53
- package/custom/node_modules/quill/assets/snow.styl +0 -18
- package/custom/node_modules/quill/blots/block.d.ts +0 -34
- package/custom/node_modules/quill/blots/block.js +0 -182
- package/custom/node_modules/quill/blots/block.js.map +0 -1
- package/custom/node_modules/quill/blots/break.d.ts +0 -8
- package/custom/node_modules/quill/blots/break.js +0 -21
- package/custom/node_modules/quill/blots/break.js.map +0 -1
- package/custom/node_modules/quill/blots/container.d.ts +0 -4
- package/custom/node_modules/quill/blots/container.js +0 -4
- package/custom/node_modules/quill/blots/container.js.map +0 -1
- package/custom/node_modules/quill/blots/cursor.d.ts +0 -26
- package/custom/node_modules/quill/blots/cursor.js +0 -170
- package/custom/node_modules/quill/blots/cursor.js.map +0 -1
- package/custom/node_modules/quill/blots/embed.d.ts +0 -18
- package/custom/node_modules/quill/blots/embed.js +0 -72
- package/custom/node_modules/quill/blots/embed.js.map +0 -1
- package/custom/node_modules/quill/blots/inline.d.ts +0 -12
- package/custom/node_modules/quill/blots/inline.js +0 -48
- package/custom/node_modules/quill/blots/inline.js.map +0 -1
- package/custom/node_modules/quill/blots/scroll.d.ts +0 -49
- package/custom/node_modules/quill/blots/scroll.js +0 -349
- package/custom/node_modules/quill/blots/scroll.js.map +0 -1
- package/custom/node_modules/quill/blots/text.d.ts +0 -5
- package/custom/node_modules/quill/blots/text.js +0 -17
- package/custom/node_modules/quill/blots/text.js.map +0 -1
- package/custom/node_modules/quill/core/composition.d.ts +0 -12
- package/custom/node_modules/quill/core/composition.js +0 -44
- package/custom/node_modules/quill/core/composition.js.map +0 -1
- package/custom/node_modules/quill/core/editor.d.ts +0 -28
- package/custom/node_modules/quill/core/editor.js +0 -403
- package/custom/node_modules/quill/core/editor.js.map +0 -1
- package/custom/node_modules/quill/core/emitter.d.ts +0 -33
- package/custom/node_modules/quill/core/emitter.js +0 -78
- package/custom/node_modules/quill/core/emitter.js.map +0 -1
- package/custom/node_modules/quill/core/instances.d.ts +0 -3
- package/custom/node_modules/quill/core/instances.js +0 -2
- package/custom/node_modules/quill/core/instances.js.map +0 -1
- package/custom/node_modules/quill/core/logger.d.ts +0 -7
- package/custom/node_modules/quill/core/logger.js +0 -24
- package/custom/node_modules/quill/core/logger.js.map +0 -1
- package/custom/node_modules/quill/core/module.d.ts +0 -8
- package/custom/node_modules/quill/core/module.js +0 -10
- package/custom/node_modules/quill/core/module.js.map +0 -1
- package/custom/node_modules/quill/core/quill.d.ts +0 -218
- package/custom/node_modules/quill/core/quill.js +0 -628
- package/custom/node_modules/quill/core/quill.js.map +0 -1
- package/custom/node_modules/quill/core/selection.d.ts +0 -74
- package/custom/node_modules/quill/core/selection.js +0 -374
- package/custom/node_modules/quill/core/selection.js.map +0 -1
- package/custom/node_modules/quill/core/theme.d.ts +0 -32
- package/custom/node_modules/quill/core/theme.js +0 -28
- package/custom/node_modules/quill/core/theme.js.map +0 -1
- package/custom/node_modules/quill/core/utils/createRegistryWithFormats.d.ts +0 -5
- package/custom/node_modules/quill/core/utils/createRegistryWithFormats.js +0 -29
- package/custom/node_modules/quill/core/utils/createRegistryWithFormats.js.map +0 -1
- package/custom/node_modules/quill/core/utils/scrollRectIntoView.d.ts +0 -8
- package/custom/node_modules/quill/core/utils/scrollRectIntoView.js +0 -75
- package/custom/node_modules/quill/core/utils/scrollRectIntoView.js.map +0 -1
- package/custom/node_modules/quill/core.d.ts +0 -7
- package/custom/node_modules/quill/core.js +0 -37
- package/custom/node_modules/quill/core.js.map +0 -1
- package/custom/node_modules/quill/dist/quill.bubble.css +0 -10
- package/custom/node_modules/quill/dist/quill.bubble.css.map +0 -1
- package/custom/node_modules/quill/dist/quill.core.css +0 -10
- package/custom/node_modules/quill/dist/quill.core.css.map +0 -1
- package/custom/node_modules/quill/dist/quill.core.js +0 -3
- package/custom/node_modules/quill/dist/quill.core.js.LICENSE.txt +0 -7
- package/custom/node_modules/quill/dist/quill.core.js.map +0 -1
- package/custom/node_modules/quill/dist/quill.js +0 -3
- package/custom/node_modules/quill/dist/quill.js.LICENSE.txt +0 -7
- package/custom/node_modules/quill/dist/quill.js.map +0 -1
- package/custom/node_modules/quill/dist/quill.snow.css +0 -10
- package/custom/node_modules/quill/dist/quill.snow.css.map +0 -1
- package/custom/node_modules/quill/formats/align.d.ts +0 -5
- package/custom/node_modules/quill/formats/align.js +0 -10
- package/custom/node_modules/quill/formats/align.js.map +0 -1
- package/custom/node_modules/quill/formats/background.d.ts +0 -5
- package/custom/node_modules/quill/formats/background.js +0 -10
- package/custom/node_modules/quill/formats/background.js.map +0 -1
- package/custom/node_modules/quill/formats/blockquote.d.ts +0 -6
- package/custom/node_modules/quill/formats/blockquote.js +0 -7
- package/custom/node_modules/quill/formats/blockquote.js.map +0 -1
- package/custom/node_modules/quill/formats/bold.d.ts +0 -11
- package/custom/node_modules/quill/formats/bold.js +0 -19
- package/custom/node_modules/quill/formats/bold.js.map +0 -1
- package/custom/node_modules/quill/formats/code.d.ts +0 -15
- package/custom/node_modules/quill/formats/code.js +0 -44
- package/custom/node_modules/quill/formats/code.js.map +0 -1
- package/custom/node_modules/quill/formats/color.d.ts +0 -7
- package/custom/node_modules/quill/formats/color.js +0 -18
- package/custom/node_modules/quill/formats/color.js.map +0 -1
- package/custom/node_modules/quill/formats/direction.d.ts +0 -5
- package/custom/node_modules/quill/formats/direction.js +0 -10
- package/custom/node_modules/quill/formats/direction.js.map +0 -1
- package/custom/node_modules/quill/formats/font.d.ts +0 -7
- package/custom/node_modules/quill/formats/font.js +0 -14
- package/custom/node_modules/quill/formats/font.js.map +0 -1
- package/custom/node_modules/quill/formats/formula.d.ts +0 -10
- package/custom/node_modules/quill/formats/formula.js +0 -33
- package/custom/node_modules/quill/formats/formula.js.map +0 -1
- package/custom/node_modules/quill/formats/header.d.ts +0 -7
- package/custom/node_modules/quill/formats/header.js +0 -10
- package/custom/node_modules/quill/formats/header.js.map +0 -1
- package/custom/node_modules/quill/formats/image.d.ts +0 -13
- package/custom/node_modules/quill/formats/image.js +0 -44
- package/custom/node_modules/quill/formats/image.js.map +0 -1
- package/custom/node_modules/quill/formats/indent.d.ts +0 -8
- package/custom/node_modules/quill/formats/indent.js +0 -30
- package/custom/node_modules/quill/formats/indent.js.map +0 -1
- package/custom/node_modules/quill/formats/italic.d.ts +0 -6
- package/custom/node_modules/quill/formats/italic.js +0 -7
- package/custom/node_modules/quill/formats/italic.js.map +0 -1
- package/custom/node_modules/quill/formats/link.d.ts +0 -13
- package/custom/node_modules/quill/formats/link.js +0 -36
- package/custom/node_modules/quill/formats/link.js.map +0 -1
- package/custom/node_modules/quill/formats/list.d.ts +0 -13
- package/custom/node_modules/quill/formats/list.js +0 -50
- package/custom/node_modules/quill/formats/list.js.map +0 -1
- package/custom/node_modules/quill/formats/script.d.ts +0 -8
- package/custom/node_modules/quill/formats/script.js +0 -21
- package/custom/node_modules/quill/formats/script.js.map +0 -1
- package/custom/node_modules/quill/formats/size.d.ts +0 -4
- package/custom/node_modules/quill/formats/size.js +0 -11
- package/custom/node_modules/quill/formats/size.js.map +0 -1
- package/custom/node_modules/quill/formats/strike.d.ts +0 -6
- package/custom/node_modules/quill/formats/strike.js +0 -7
- package/custom/node_modules/quill/formats/strike.js.map +0 -1
- package/custom/node_modules/quill/formats/table.d.ts +0 -45
- package/custom/node_modules/quill/formats/table.js +0 -176
- package/custom/node_modules/quill/formats/table.js.map +0 -1
- package/custom/node_modules/quill/formats/underline.d.ts +0 -6
- package/custom/node_modules/quill/formats/underline.js +0 -7
- package/custom/node_modules/quill/formats/underline.js.map +0 -1
- package/custom/node_modules/quill/formats/video.d.ts +0 -14
- package/custom/node_modules/quill/formats/video.js +0 -48
- package/custom/node_modules/quill/formats/video.js.map +0 -1
- package/custom/node_modules/quill/modules/clipboard.d.ts +0 -43
- package/custom/node_modules/quill/modules/clipboard.js +0 -475
- package/custom/node_modules/quill/modules/clipboard.js.map +0 -1
- package/custom/node_modules/quill/modules/history.d.ts +0 -36
- package/custom/node_modules/quill/modules/history.js +0 -178
- package/custom/node_modules/quill/modules/history.js.map +0 -1
- package/custom/node_modules/quill/modules/input.d.ts +0 -10
- package/custom/node_modules/quill/modules/input.js +0 -83
- package/custom/node_modules/quill/modules/input.js.map +0 -1
- package/custom/node_modules/quill/modules/keyboard.d.ts +0 -58
- package/custom/node_modules/quill/modules/keyboard.js +0 -713
- package/custom/node_modules/quill/modules/keyboard.js.map +0 -1
- package/custom/node_modules/quill/modules/normalizeExternalHTML/index.d.ts +0 -2
- package/custom/node_modules/quill/modules/normalizeExternalHTML/index.js +0 -12
- package/custom/node_modules/quill/modules/normalizeExternalHTML/index.js.map +0 -1
- package/custom/node_modules/quill/modules/normalizeExternalHTML/normalizers/googleDocs.d.ts +0 -1
- package/custom/node_modules/quill/modules/normalizeExternalHTML/normalizers/googleDocs.js +0 -24
- package/custom/node_modules/quill/modules/normalizeExternalHTML/normalizers/googleDocs.js.map +0 -1
- package/custom/node_modules/quill/modules/normalizeExternalHTML/normalizers/msWord.d.ts +0 -1
- package/custom/node_modules/quill/modules/normalizeExternalHTML/normalizers/msWord.js +0 -87
- package/custom/node_modules/quill/modules/normalizeExternalHTML/normalizers/msWord.js.map +0 -1
- package/custom/node_modules/quill/modules/syntax.d.ts +0 -50
- package/custom/node_modules/quill/modules/syntax.js +0 -332
- package/custom/node_modules/quill/modules/syntax.js.map +0 -1
- package/custom/node_modules/quill/modules/table.d.ts +0 -20
- package/custom/node_modules/quill/modules/table.js +0 -125
- package/custom/node_modules/quill/modules/table.js.map +0 -1
- package/custom/node_modules/quill/modules/tableEmbed.d.ts +0 -27
- package/custom/node_modules/quill/modules/tableEmbed.js +0 -209
- package/custom/node_modules/quill/modules/tableEmbed.js.map +0 -1
- package/custom/node_modules/quill/modules/toolbar.d.ts +0 -24
- package/custom/node_modules/quill/modules/toolbar.js +0 -265
- package/custom/node_modules/quill/modules/toolbar.js.map +0 -1
- package/custom/node_modules/quill/modules/uiNode.d.ts +0 -19
- package/custom/node_modules/quill/modules/uiNode.js +0 -95
- package/custom/node_modules/quill/modules/uiNode.js.map +0 -1
- package/custom/node_modules/quill/modules/uploader.d.ts +0 -15
- package/custom/node_modules/quill/modules/uploader.js +0 -69
- package/custom/node_modules/quill/modules/uploader.js.map +0 -1
- package/custom/node_modules/quill/package.json +0 -100
- package/custom/node_modules/quill/quill.d.ts +0 -6
- package/custom/node_modules/quill/quill.js +0 -83
- package/custom/node_modules/quill/quill.js.map +0 -1
- package/custom/node_modules/quill/themes/base.d.ts +0 -35
- package/custom/node_modules/quill/themes/base.js +0 -257
- package/custom/node_modules/quill/themes/base.js.map +0 -1
- package/custom/node_modules/quill/themes/bubble.d.ts +0 -18
- package/custom/node_modules/quill/themes/bubble.js +0 -114
- package/custom/node_modules/quill/themes/bubble.js.map +0 -1
- package/custom/node_modules/quill/themes/snow.d.ts +0 -9
- package/custom/node_modules/quill/themes/snow.js +0 -122
- package/custom/node_modules/quill/themes/snow.js.map +0 -1
- package/custom/node_modules/quill/types.d.js +0 -2
- package/custom/node_modules/quill/types.d.js.map +0 -1
- package/custom/node_modules/quill/ui/color-picker.d.ts +0 -7
- package/custom/node_modules/quill/ui/color-picker.js +0 -30
- package/custom/node_modules/quill/ui/color-picker.js.map +0 -1
- package/custom/node_modules/quill/ui/icon-picker.d.ts +0 -7
- package/custom/node_modules/quill/ui/icon-picker.js +0 -22
- package/custom/node_modules/quill/ui/icon-picker.js.map +0 -1
- package/custom/node_modules/quill/ui/icons.d.ts +0 -49
- package/custom/node_modules/quill/ui/icons.js +0 -82
- package/custom/node_modules/quill/ui/icons.js.map +0 -1
- package/custom/node_modules/quill/ui/picker.d.ts +0 -16
- package/custom/node_modules/quill/ui/picker.js +0 -171
- package/custom/node_modules/quill/ui/picker.js.map +0 -1
- package/custom/node_modules/quill/ui/tooltip.d.ts +0 -12
- package/custom/node_modules/quill/ui/tooltip.js +0 -56
- package/custom/node_modules/quill/ui/tooltip.js.map +0 -1
- package/custom/node_modules/quill-delta/LICENSE +0 -14
- package/custom/node_modules/quill-delta/README.md +0 -672
- package/custom/node_modules/quill-delta/dist/AttributeMap.d.ts +0 -10
- package/custom/node_modules/quill-delta/dist/AttributeMap.js +0 -86
- package/custom/node_modules/quill-delta/dist/AttributeMap.js.map +0 -1
- package/custom/node_modules/quill-delta/dist/Delta.d.ts +0 -45
- package/custom/node_modules/quill-delta/dist/Delta.js +0 -478
- package/custom/node_modules/quill-delta/dist/Delta.js.map +0 -1
- package/custom/node_modules/quill-delta/dist/Op.d.ts +0 -11
- package/custom/node_modules/quill-delta/dist/Op.js +0 -22
- package/custom/node_modules/quill-delta/dist/Op.js.map +0 -1
- package/custom/node_modules/quill-delta/dist/OpIterator.d.ts +0 -13
- package/custom/node_modules/quill-delta/dist/OpIterator.js +0 -106
- package/custom/node_modules/quill-delta/dist/OpIterator.js.map +0 -1
- package/custom/node_modules/quill-delta/package.json +0 -77
- package/custom/node_modules/quill-delta/src/AttributeMap.ts +0 -101
- package/custom/node_modules/quill-delta/src/Delta.ts +0 -573
- package/custom/node_modules/quill-delta/src/Op.ts +0 -26
- package/custom/node_modules/quill-delta/src/OpIterator.ts +0 -106
- package/custom/node_modules/quill-delta/tsconfig.json +0 -15
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parchment.js","sources":["../src/scope.ts","../src/attributor/attributor.ts","../src/error.ts","../src/registry.ts","../src/attributor/class.ts","../src/attributor/style.ts","../src/attributor/store.ts","../src/blot/abstract/shadow.ts","../src/blot/abstract/leaf.ts","../src/collection/linked-list.ts","../src/blot/abstract/parent.ts","../src/blot/inline.ts","../src/blot/block.ts","../src/blot/abstract/container.ts","../src/blot/embed.ts","../src/blot/scroll.ts","../src/blot/text.ts"],"sourcesContent":["enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n","import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n","export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n","import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap<Node, Blot>();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n","import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n","import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n","import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n","import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n","import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n","import type LinkedNode from './linked-node.js';\n\nclass LinkedList<T extends LinkedNode> {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce<M>(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n","import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList<Blot>;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList<Blot>();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant<T extends Blot>(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants<T extends Blot>(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot | null): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n","import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record<string, unknown>,\n obj2: Record<string, unknown>,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n","import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n","import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n","import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n","import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n","import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n"],"names":["Scope","match","ClassAttributor","StyleAttributor","ParentBlot","AttributorStore","LeafBlot","InlineBlot","BlockBlot","ContainerBlot"],"mappings":"AAAK,IAAA,0BAAAA,YACHA,OAAAA,OAAA,OAAQ,CAAR,IAAA,QACAA,OAAAA,OAAA,QAAU,EAAV,IAAA,SAEAA,OAAAA,OAAA,YAAa,EAAb,IAAA,aACAA,OAAAA,OAAA,OAAQ,EAAR,IAAA,QACAA,OAAAA,OAAA,SAAU,CAAV,IAAA,UACAA,OAAAA,OAAA,QAAS,EAAT,IAAA,SAEAA,OAAAA,OAAA,aAAa,EAAb,IAAA,cACAA,OA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AAK;EAEd;AAAA,EAEO,SAAS,OAAe,aAAa,IAAuB;AAC1D,WAAA,CAAC,KAAK,SAAS,KAAK;AAAA,EAC7B;AAAA,EAEO,MAAM,OAAe,QAAQ,IAAoB;AACtD,QAAI,CAAC,OAAO;AACV,UAAI,UAAU;AACL,eAAA;AAEL,UAAA,UAAU,KAAK;AACjB,eAAO,KAAK;AAAA,IAEhB;AACM,UAAA,QAAQ,KAAK,OAAO,OAAO,KAAK,QAAQ,UAAU,KAAK,CAAC;AAC9D,gBAAK,OAAO,aAAa,OAAO,KAAK,QAAQ,MAAS,GACtD,KAAK,OAAO,KAAK,QAAQ,MAAM,KAAK,OAAO,GACpC;AAAA,EACT;AAAA,EAEO,OACL,WACA,UACM;AAEJ,IAAA,UAAU,KAAK,CAAC,aAEZ,SAAS,SAAS,mBAAmB,SAAS,WAAW,KAAK,OAEjE,MAED,KAAK,OAAO,KAAK,QAAQ,MAAM,KAAK,OAAO;AAAA,EAE/C;AAAA,EAEO,QAAgB;AACrB,WAAO,KAAK;AAAA,EACd;AACF;AA5FE,UAAuB,WAAW,QAClC,UAAc,QAAQ,MAAM;AAF9B,IAAM,WAAN;AA+FA,MAAA,aAAe;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports):typeof define=="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.Parchment={}))})(this,function(exports2){"use strict";var Scope=(Scope2=>(Scope2[Scope2.TYPE=3]="TYPE",Scope2[Scope2.LEVEL=12]="LEVEL",Scope2[Scope2.ATTRIBUTE=13]="ATTRIBUTE",Scope2[Scope2.BLOT=14]="BLOT",Scope2[Scope2.INLINE=7]="INLINE",Scope2[Scope2.BLOCK=11]="BLOCK",Scope2[Scope2.BLOCK_BLOT=10]="BLOCK_BLOT",Scope2[Scope2.INLINE_BLOT=6]="INLINE_BLOT",Scope2[Scope2.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",Scope2[Scope2.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",Scope2[Scope2.ANY=15]="ANY",Scope2))(Scope||{});class Attributor{constructor(attrName,keyName,options={}){this.attrName=attrName,this.keyName=keyName;const attributeBit=Scope.TYPE&Scope.ATTRIBUTE;this.scope=options.scope!=null?options.scope&Scope.LEVEL|attributeBit:Scope.ATTRIBUTE,options.whitelist!=null&&(this.whitelist=options.whitelist)}static keys(node){return Array.from(node.attributes).map(item=>item.name)}add(node,value){return this.canAdd(node,value)?(node.setAttribute(this.keyName,value),!0):!1}canAdd(_node,value){return this.whitelist==null?!0:typeof value=="string"?this.whitelist.indexOf(value.replace(/["']/g,""))>-1:this.whitelist.indexOf(value)>-1}remove(node){node.removeAttribute(this.keyName)}value(node){const value=node.getAttribute(this.keyName);return this.canAdd(node,value)&&value?value:""}}class ParchmentError extends Error{constructor(message){message="[Parchment] "+message,super(message),this.message=message,this.name=this.constructor.name}}const _Registry=class _Registry{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(node,bubble=!1){if(node==null)return null;if(this.blots.has(node))return this.blots.get(node)||null;if(bubble){let parentNode=null;try{parentNode=node.parentNode}catch{return null}return this.find(parentNode,bubble)}return null}create(scroll,input,value){const match2=this.query(input);if(match2==null)throw new ParchmentError(`Unable to create ${input} blot`);const blotClass=match2,node=input instanceof Node||input.nodeType===Node.TEXT_NODE?input:blotClass.create(value),blot=new blotClass(scroll,node,value);return _Registry.blots.set(blot.domNode,blot),blot}find(node,bubble=!1){return _Registry.find(node,bubble)}query(query,scope=Scope.ANY){let match2;return typeof query=="string"?match2=this.types[query]||this.attributes[query]:query instanceof Text||query.nodeType===Node.TEXT_NODE?match2=this.types.text:typeof query=="number"?query&Scope.LEVEL&Scope.BLOCK?match2=this.types.block:query&Scope.LEVEL&Scope.INLINE&&(match2=this.types.inline):query instanceof Element&&((query.getAttribute("class")||"").split(/\s+/).some(name=>(match2=this.classes[name],!!match2)),match2=match2||this.tags[query.tagName]),match2==null?null:"scope"in match2&&scope&Scope.LEVEL&match2.scope&&scope&Scope.TYPE&match2.scope?match2:null}register(...definitions){return definitions.map(definition=>{const isBlot="blotName"in definition,isAttr="attrName"in definition;if(!isBlot&&!isAttr)throw new ParchmentError("Invalid definition");if(isBlot&&definition.blotName==="abstract")throw new ParchmentError("Cannot register abstract class");const key=isBlot?definition.blotName:isAttr?definition.attrName:void 0;return this.types[key]=definition,isAttr?typeof definition.keyName=="string"&&(this.attributes[definition.keyName]=definition):isBlot&&(definition.className&&(this.classes[definition.className]=definition),definition.tagName&&(Array.isArray(definition.tagName)?definition.tagName=definition.tagName.map(tagName=>tagName.toUpperCase()):definition.tagName=definition.tagName.toUpperCase(),(Array.isArray(definition.tagName)?definition.tagName:[definition.tagName]).forEach(tag=>{(this.tags[tag]==null||definition.className==null)&&(this.tags[tag]=definition)}))),definition})}};_Registry.blots=new WeakMap;let Registry=_Registry;function match(node,prefix){return(node.getAttribute("class")||"").split(/\s+/).filter(name=>name.indexOf(`${prefix}-`)===0)}class ClassAttributor extends Attributor{static keys(node){return(node.getAttribute("class")||"").split(/\s+/).map(name=>name.split("-").slice(0,-1).join("-"))}add(node,value){return this.canAdd(node,value)?(this.remove(node),node.classList.add(`${this.keyName}-${value}`),!0):!1}remove(node){match(node,this.keyName).forEach(name=>{node.classList.remove(name)}),node.classList.length===0&&node.removeAttribute("class")}value(node){const value=(match(node,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(node,value)?value:""}}const ClassAttributor$1=ClassAttributor;function camelize(name){const parts=name.split("-"),rest=parts.slice(1).map(part=>part[0].toUpperCase()+part.slice(1)).join("");return parts[0]+rest}class StyleAttributor extends Attributor{static keys(node){return(node.getAttribute("style")||"").split(";").map(value=>value.split(":")[0].trim())}add(node,value){return this.canAdd(node,value)?(node.style[camelize(this.keyName)]=value,!0):!1}remove(node){node.style[camelize(this.keyName)]="",node.getAttribute("style")||node.removeAttribute("style")}value(node){const value=node.style[camelize(this.keyName)];return this.canAdd(node,value)?value:""}}const StyleAttributor$1=StyleAttributor;class AttributorStore{constructor(domNode){this.attributes={},this.domNode=domNode,this.build()}attribute(attribute,value){value?attribute.add(this.domNode,value)&&(attribute.value(this.domNode)!=null?this.attributes[attribute.attrName]=attribute:delete this.attributes[attribute.attrName]):(attribute.remove(this.domNode),delete this.attributes[attribute.attrName])}build(){this.attributes={};const blot=Registry.find(this.domNode);if(blot==null)return;const attributes=Attributor.keys(this.domNode),classes=ClassAttributor$1.keys(this.domNode),styles=StyleAttributor$1.keys(this.domNode);attributes.concat(classes).concat(styles).forEach(name=>{const attr=blot.scroll.query(name,Scope.ATTRIBUTE);attr instanceof Attributor&&(this.attributes[attr.attrName]=attr)})}copy(target){Object.keys(this.attributes).forEach(key=>{const value=this.attributes[key].value(this.domNode);target.format(key,value)})}move(target){this.copy(target),Object.keys(this.attributes).forEach(key=>{this.attributes[key].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((attributes,name)=>(attributes[name]=this.attributes[name].value(this.domNode),attributes),{})}}const AttributorStore$1=AttributorStore,_ShadowBlot=class _ShadowBlot{constructor(scroll,domNode){this.scroll=scroll,this.domNode=domNode,Registry.blots.set(domNode,this),this.prev=null,this.next=null}static create(rawValue){if(this.tagName==null)throw new ParchmentError("Blot definition missing tagName");let node,value;return Array.isArray(this.tagName)?(typeof rawValue=="string"?(value=rawValue.toUpperCase(),parseInt(value,10).toString()===value&&(value=parseInt(value,10))):typeof rawValue=="number"&&(value=rawValue),typeof value=="number"?node=document.createElement(this.tagName[value-1]):value&&this.tagName.indexOf(value)>-1?node=document.createElement(value):node=document.createElement(this.tagName[0])):node=document.createElement(this.tagName),this.className&&node.classList.add(this.className),node}get statics(){return this.constructor}attach(){}clone(){const domNode=this.domNode.cloneNode(!1);return this.scroll.create(domNode)}detach(){this.parent!=null&&this.parent.removeChild(this),Registry.blots.delete(this.domNode)}deleteAt(index,length){this.isolate(index,length).remove()}formatAt(index,length,name,value){const blot=this.isolate(index,length);if(this.scroll.query(name,Scope.BLOT)!=null&&value)blot.wrap(name,value);else if(this.scroll.query(name,Scope.ATTRIBUTE)!=null){const parent=this.scroll.create(this.statics.scope);blot.wrap(parent),parent.format(name,value)}}insertAt(index,value,def){const blot=def==null?this.scroll.create("text",value):this.scroll.create(value,def),ref=this.split(index);this.parent.insertBefore(blot,ref||void 0)}isolate(index,length){const target=this.split(index);if(target==null)throw new Error("Attempt to isolate at end");return target.split(length),target}length(){return 1}offset(root=this.parent){return this.parent==null||this===root?0:this.parent.children.offset(this)+this.parent.offset(root)}optimize(_context){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(name,value){const replacement=typeof name=="string"?this.scroll.create(name,value):name;return this.parent!=null&&(this.parent.insertBefore(replacement,this.next||void 0),this.remove()),replacement}split(index,_force){return index===0?this:this.next}update(_mutations,_context){}wrap(name,value){const wrapper=typeof name=="string"?this.scroll.create(name,value):name;if(this.parent!=null&&this.parent.insertBefore(wrapper,this.next||void 0),typeof wrapper.appendChild!="function")throw new ParchmentError(`Cannot wrap ${name}`);return wrapper.appendChild(this),wrapper}};_ShadowBlot.blotName="abstract";let ShadowBlot=_ShadowBlot;const _LeafBlot=class _LeafBlot extends ShadowBlot{static value(_domNode){return!0}index(node,offset){return this.domNode===node||this.domNode.compareDocumentPosition(node)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(offset,1):-1}position(index,_inclusive){let offset=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return index>0&&(offset+=1),[this.parent.domNode,offset]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};_LeafBlot.scope=Scope.INLINE_BLOT;let LeafBlot=_LeafBlot;const LeafBlot$1=LeafBlot;class LinkedList{constructor(){this.head=null,this.tail=null,this.length=0}append(...nodes){if(this.insertBefore(nodes[0],null),nodes.length>1){const rest=nodes.slice(1);this.append(...rest)}}at(index){const next=this.iterator();let cur=next();for(;cur&&index>0;)index-=1,cur=next();return cur}contains(node){const next=this.iterator();let cur=next();for(;cur;){if(cur===node)return!0;cur=next()}return!1}indexOf(node){const next=this.iterator();let cur=next(),index=0;for(;cur;){if(cur===node)return index;index+=1,cur=next()}return-1}insertBefore(node,refNode){node!=null&&(this.remove(node),node.next=refNode,refNode!=null?(node.prev=refNode.prev,refNode.prev!=null&&(refNode.prev.next=node),refNode.prev=node,refNode===this.head&&(this.head=node)):this.tail!=null?(this.tail.next=node,node.prev=this.tail,this.tail=node):(node.prev=null,this.head=this.tail=node),this.length+=1)}offset(target){let index=0,cur=this.head;for(;cur!=null;){if(cur===target)return index;index+=cur.length(),cur=cur.next}return-1}remove(node){this.contains(node)&&(node.prev!=null&&(node.prev.next=node.next),node.next!=null&&(node.next.prev=node.prev),node===this.head&&(this.head=node.next),node===this.tail&&(this.tail=node.prev),this.length-=1)}iterator(curNode=this.head){return()=>{const ret=curNode;return curNode!=null&&(curNode=curNode.next),ret}}find(index,inclusive=!1){const next=this.iterator();let cur=next();for(;cur;){const length=cur.length();if(index<length||inclusive&&index===length&&(cur.next==null||cur.next.length()!==0))return[cur,index];index-=length,cur=next()}return[null,0]}forEach(callback){const next=this.iterator();let cur=next();for(;cur;)callback(cur),cur=next()}forEachAt(index,length,callback){if(length<=0)return;const[startNode,offset]=this.find(index);let curIndex=index-offset;const next=this.iterator(startNode);let cur=next();for(;cur&&curIndex<index+length;){const curLength=cur.length();index>curIndex?callback(cur,index-curIndex,Math.min(length,curIndex+curLength-index)):callback(cur,0,Math.min(curLength,index+length-curIndex)),curIndex+=curLength,cur=next()}}map(callback){return this.reduce((memo,cur)=>(memo.push(callback(cur)),memo),[])}reduce(callback,memo){const next=this.iterator();let cur=next();for(;cur;)memo=callback(memo,cur),cur=next();return memo}}function makeAttachedBlot(node,scroll){const found=scroll.find(node);if(found)return found;try{return scroll.create(node)}catch{const blot=scroll.create(Scope.INLINE);return Array.from(node.childNodes).forEach(child=>{blot.domNode.appendChild(child)}),node.parentNode&&node.parentNode.replaceChild(blot.domNode,node),blot.attach(),blot}}const _ParentBlot=class _ParentBlot extends ShadowBlot{constructor(scroll,domNode){super(scroll,domNode),this.uiNode=null,this.build()}appendChild(other){this.insertBefore(other)}attach(){super.attach(),this.children.forEach(child=>{child.attach()})}attachUI(node){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=node,_ParentBlot.uiClass&&this.uiNode.classList.add(_ParentBlot.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new LinkedList,Array.from(this.domNode.childNodes).filter(node=>node!==this.uiNode).reverse().forEach(node=>{try{const child=makeAttachedBlot(node,this.scroll);this.insertBefore(child,this.children.head||void 0)}catch(err){if(err instanceof ParchmentError)return;throw err}})}deleteAt(index,length){if(index===0&&length===this.length())return this.remove();this.children.forEachAt(index,length,(child,offset,childLength)=>{child.deleteAt(offset,childLength)})}descendant(criteria,index=0){const[child,offset]=this.children.find(index);return criteria.blotName==null&&criteria(child)||criteria.blotName!=null&&child instanceof criteria?[child,offset]:child instanceof _ParentBlot?child.descendant(criteria,offset):[null,-1]}descendants(criteria,index=0,length=Number.MAX_VALUE){let descendants=[],lengthLeft=length;return this.children.forEachAt(index,length,(child,childIndex,childLength)=>{(criteria.blotName==null&&criteria(child)||criteria.blotName!=null&&child instanceof criteria)&&descendants.push(child),child instanceof _ParentBlot&&(descendants=descendants.concat(child.descendants(criteria,childIndex,lengthLeft))),lengthLeft-=childLength}),descendants}detach(){this.children.forEach(child=>{child.detach()}),super.detach()}enforceAllowedChildren(){let done=!1;this.children.forEach(child=>{done||this.statics.allowedChildren.some(def=>child instanceof def)||(child.statics.scope===Scope.BLOCK_BLOT?(child.next!=null&&this.splitAfter(child),child.prev!=null&&this.splitAfter(child.prev),child.parent.unwrap(),done=!0):child instanceof _ParentBlot?child.unwrap():child.remove())})}formatAt(index,length,name,value){this.children.forEachAt(index,length,(child,offset,childLength)=>{child.formatAt(offset,childLength,name,value)})}insertAt(index,value,def){const[child,offset]=this.children.find(index);if(child)child.insertAt(offset,value,def);else{const blot=def==null?this.scroll.create("text",value):this.scroll.create(value,def);this.appendChild(blot)}}insertBefore(childBlot,refBlot){childBlot.parent!=null&&childBlot.parent.children.remove(childBlot);let refDomNode=null;this.children.insertBefore(childBlot,refBlot||null),childBlot.parent=this,refBlot!=null&&(refDomNode=refBlot.domNode),(this.domNode.parentNode!==childBlot.domNode||this.domNode.nextSibling!==refDomNode)&&this.domNode.insertBefore(childBlot.domNode,refDomNode),childBlot.attach()}length(){return this.children.reduce((memo,child)=>memo+child.length(),0)}moveChildren(targetParent,refNode){this.children.forEach(child=>{targetParent.insertBefore(child,refNode)})}optimize(context){if(super.optimize(context),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const child=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(child)}else this.remove()}path(index,inclusive=!1){const[child,offset]=this.children.find(index,inclusive),position=[[this,index]];return child instanceof _ParentBlot?position.concat(child.path(offset,inclusive)):(child!=null&&position.push([child,offset]),position)}removeChild(child){this.children.remove(child)}replaceWith(name,value){const replacement=typeof name=="string"?this.scroll.create(name,value):name;return replacement instanceof _ParentBlot&&this.moveChildren(replacement),super.replaceWith(replacement)}split(index,force=!1){if(!force){if(index===0)return this;if(index===this.length())return this.next}const after=this.clone();return this.parent&&this.parent.insertBefore(after,this.next||void 0),this.children.forEachAt(index,this.length(),(child,offset,_length)=>{const split=child.split(offset,force);split!=null&&after.appendChild(split)}),after}splitAfter(child){const after=this.clone();for(;child.next!=null;)after.appendChild(child.next);return this.parent&&this.parent.insertBefore(after,this.next||void 0),after}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(mutations,_context){const addedNodes=[],removedNodes=[];mutations.forEach(mutation=>{mutation.target===this.domNode&&mutation.type==="childList"&&(addedNodes.push(...mutation.addedNodes),removedNodes.push(...mutation.removedNodes))}),removedNodes.forEach(node=>{if(node.parentNode!=null&&node.tagName!=="IFRAME"&&document.body.compareDocumentPosition(node)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const blot=this.scroll.find(node);blot!=null&&(blot.domNode.parentNode==null||blot.domNode.parentNode===this.domNode)&&blot.detach()}),addedNodes.filter(node=>node.parentNode===this.domNode&&node!==this.uiNode).sort((a,b)=>a===b?0:a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(node=>{let refBlot=null;node.nextSibling!=null&&(refBlot=this.scroll.find(node.nextSibling));const blot=makeAttachedBlot(node,this.scroll);(blot.next!==refBlot||blot.next==null)&&(blot.parent!=null&&blot.parent.removeChild(this),this.insertBefore(blot,refBlot||void 0))}),this.enforceAllowedChildren()}};_ParentBlot.uiClass="";let ParentBlot=_ParentBlot;const ParentBlot$1=ParentBlot;function isEqual(obj1,obj2){if(Object.keys(obj1).length!==Object.keys(obj2).length)return!1;for(const prop in obj1)if(obj1[prop]!==obj2[prop])return!1;return!0}const _InlineBlot=class _InlineBlot extends ParentBlot$1{static create(value){return super.create(value)}static formats(domNode,scroll){const match2=scroll.query(_InlineBlot.blotName);if(!(match2!=null&&domNode.tagName===match2.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return domNode.tagName.toLowerCase()}}constructor(scroll,domNode){super(scroll,domNode),this.attributes=new AttributorStore$1(this.domNode)}format(name,value){if(name===this.statics.blotName&&!value)this.children.forEach(child=>{child instanceof _InlineBlot||(child=child.wrap(_InlineBlot.blotName,!0)),this.attributes.copy(child)}),this.unwrap();else{const format=this.scroll.query(name,Scope.INLINE);if(format==null)return;format instanceof Attributor?this.attributes.attribute(format,value):value&&(name!==this.statics.blotName||this.formats()[name]!==value)&&this.replaceWith(name,value)}}formats(){const formats=this.attributes.values(),format=this.statics.formats(this.domNode,this.scroll);return format!=null&&(formats[this.statics.blotName]=format),formats}formatAt(index,length,name,value){this.formats()[name]!=null||this.scroll.query(name,Scope.ATTRIBUTE)?this.isolate(index,length).format(name,value):super.formatAt(index,length,name,value)}optimize(context){super.optimize(context);const formats=this.formats();if(Object.keys(formats).length===0)return this.unwrap();const next=this.next;next instanceof _InlineBlot&&next.prev===this&&isEqual(formats,next.formats())&&(next.moveChildren(this),next.remove())}replaceWith(name,value){const replacement=super.replaceWith(name,value);return this.attributes.copy(replacement),replacement}update(mutations,context){super.update(mutations,context),mutations.some(mutation=>mutation.target===this.domNode&&mutation.type==="attributes")&&this.attributes.build()}wrap(name,value){const wrapper=super.wrap(name,value);return wrapper instanceof _InlineBlot&&this.attributes.move(wrapper),wrapper}};_InlineBlot.allowedChildren=[_InlineBlot,LeafBlot$1],_InlineBlot.blotName="inline",_InlineBlot.scope=Scope.INLINE_BLOT,_InlineBlot.tagName="SPAN";let InlineBlot=_InlineBlot;const InlineBlot$1=InlineBlot,_BlockBlot=class _BlockBlot extends ParentBlot$1{static create(value){return super.create(value)}static formats(domNode,scroll){const match2=scroll.query(_BlockBlot.blotName);if(!(match2!=null&&domNode.tagName===match2.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return domNode.tagName.toLowerCase()}}constructor(scroll,domNode){super(scroll,domNode),this.attributes=new AttributorStore$1(this.domNode)}format(name,value){const format=this.scroll.query(name,Scope.BLOCK);format!=null&&(format instanceof Attributor?this.attributes.attribute(format,value):name===this.statics.blotName&&!value?this.replaceWith(_BlockBlot.blotName):value&&(name!==this.statics.blotName||this.formats()[name]!==value)&&this.replaceWith(name,value))}formats(){const formats=this.attributes.values(),format=this.statics.formats(this.domNode,this.scroll);return format!=null&&(formats[this.statics.blotName]=format),formats}formatAt(index,length,name,value){this.scroll.query(name,Scope.BLOCK)!=null?this.format(name,value):super.formatAt(index,length,name,value)}insertAt(index,value,def){if(def==null||this.scroll.query(value,Scope.INLINE)!=null)super.insertAt(index,value,def);else{const after=this.split(index);if(after!=null){const blot=this.scroll.create(value,def);after.parent.insertBefore(blot,after)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(name,value){const replacement=super.replaceWith(name,value);return this.attributes.copy(replacement),replacement}update(mutations,context){super.update(mutations,context),mutations.some(mutation=>mutation.target===this.domNode&&mutation.type==="attributes")&&this.attributes.build()}};_BlockBlot.blotName="block",_BlockBlot.scope=Scope.BLOCK_BLOT,_BlockBlot.tagName="P",_BlockBlot.allowedChildren=[InlineBlot$1,_BlockBlot,LeafBlot$1];let BlockBlot=_BlockBlot;const BlockBlot$1=BlockBlot,_ContainerBlot=class _ContainerBlot extends ParentBlot$1{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(index,length){super.deleteAt(index,length),this.enforceAllowedChildren()}formatAt(index,length,name,value){super.formatAt(index,length,name,value),this.enforceAllowedChildren()}insertAt(index,value,def){super.insertAt(index,value,def),this.enforceAllowedChildren()}optimize(context){super.optimize(context),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};_ContainerBlot.blotName="container",_ContainerBlot.scope=Scope.BLOCK_BLOT;let ContainerBlot=_ContainerBlot;const ContainerBlot$1=ContainerBlot;class EmbedBlot extends LeafBlot$1{static formats(_domNode,_scroll){}format(name,value){super.formatAt(0,this.length(),name,value)}formatAt(index,length,name,value){index===0&&length===this.length()?this.format(name,value):super.formatAt(index,length,name,value)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const EmbedBlot$1=EmbedBlot,OBSERVER_CONFIG={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},MAX_OPTIMIZE_ITERATIONS=100,_ScrollBlot=class _ScrollBlot extends ParentBlot$1{constructor(registry,node){super(null,node),this.registry=registry,this.scroll=this,this.build(),this.observer=new MutationObserver(mutations=>{this.update(mutations)}),this.observer.observe(this.domNode,OBSERVER_CONFIG),this.attach()}create(input,value){return this.registry.create(this,input,value)}find(node,bubble=!1){const blot=this.registry.find(node,bubble);return blot?blot.scroll===this?blot:bubble?this.find(blot.scroll.domNode.parentNode,!0):null:null}query(query,scope=Scope.ANY){return this.registry.query(query,scope)}register(...definitions){return this.registry.register(...definitions)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(index,length){this.update(),index===0&&length===this.length()?this.children.forEach(child=>{child.remove()}):super.deleteAt(index,length)}formatAt(index,length,name,value){this.update(),super.formatAt(index,length,name,value)}insertAt(index,value,def){this.update(),super.insertAt(index,value,def)}optimize(mutations=[],context={}){super.optimize(context);const mutationsMap=context.mutationsMap||new WeakMap;let records=Array.from(this.observer.takeRecords());for(;records.length>0;)mutations.push(records.pop());const mark=(blot,markParent=!0)=>{blot==null||blot===this||blot.domNode.parentNode!=null&&(mutationsMap.has(blot.domNode)||mutationsMap.set(blot.domNode,[]),markParent&&mark(blot.parent))},optimize=blot=>{mutationsMap.has(blot.domNode)&&(blot instanceof ParentBlot$1&&blot.children.forEach(optimize),mutationsMap.delete(blot.domNode),blot.optimize(context))};let remaining=mutations;for(let i=0;remaining.length>0;i+=1){if(i>=MAX_OPTIMIZE_ITERATIONS)throw new Error("[Parchment] Maximum optimize iterations reached");for(remaining.forEach(mutation=>{const blot=this.find(mutation.target,!0);blot!=null&&(blot.domNode===mutation.target&&(mutation.type==="childList"?(mark(this.find(mutation.previousSibling,!1)),Array.from(mutation.addedNodes).forEach(node=>{const child=this.find(node,!1);mark(child,!1),child instanceof ParentBlot$1&&child.children.forEach(grandChild=>{mark(grandChild,!1)})})):mutation.type==="attributes"&&mark(blot.prev)),mark(blot))}),this.children.forEach(optimize),remaining=Array.from(this.observer.takeRecords()),records=remaining.slice();records.length>0;)mutations.push(records.pop())}}update(mutations,context={}){mutations=mutations||this.observer.takeRecords();const mutationsMap=new WeakMap;mutations.map(mutation=>{const blot=this.find(mutation.target,!0);return blot==null?null:mutationsMap.has(blot.domNode)?(mutationsMap.get(blot.domNode).push(mutation),null):(mutationsMap.set(blot.domNode,[mutation]),blot)}).forEach(blot=>{blot!=null&&blot!==this&&mutationsMap.has(blot.domNode)&&blot.update(mutationsMap.get(blot.domNode)||[],context)}),context.mutationsMap=mutationsMap,mutationsMap.has(this.domNode)&&super.update(mutationsMap.get(this.domNode),context),this.optimize(mutations,context)}};_ScrollBlot.blotName="scroll",_ScrollBlot.defaultChild=BlockBlot$1,_ScrollBlot.allowedChildren=[BlockBlot$1,ContainerBlot$1],_ScrollBlot.scope=Scope.BLOCK_BLOT,_ScrollBlot.tagName="DIV";let ScrollBlot=_ScrollBlot;const ScrollBlot$1=ScrollBlot,_TextBlot=class _TextBlot extends LeafBlot$1{static create(value){return document.createTextNode(value)}static value(domNode){return domNode.data}constructor(scroll,node){super(scroll,node),this.text=this.statics.value(this.domNode)}deleteAt(index,length){this.domNode.data=this.text=this.text.slice(0,index)+this.text.slice(index+length)}index(node,offset){return this.domNode===node?offset:-1}insertAt(index,value,def){def==null?(this.text=this.text.slice(0,index)+value+this.text.slice(index),this.domNode.data=this.text):super.insertAt(index,value,def)}length(){return this.text.length}optimize(context){super.optimize(context),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof _TextBlot&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(index,_inclusive=!1){return[this.domNode,index]}split(index,force=!1){if(!force){if(index===0)return this;if(index===this.length())return this.next}const after=this.scroll.create(this.domNode.splitText(index));return this.parent.insertBefore(after,this.next||void 0),this.text=this.statics.value(this.domNode),after}update(mutations,_context){mutations.some(mutation=>mutation.type==="characterData"&&mutation.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};_TextBlot.blotName="text",_TextBlot.scope=Scope.INLINE_BLOT;let TextBlot=_TextBlot;const TextBlot$1=TextBlot;exports2.Attributor=Attributor,exports2.AttributorStore=AttributorStore$1,exports2.BlockBlot=BlockBlot$1,exports2.ClassAttributor=ClassAttributor$1,exports2.ContainerBlot=ContainerBlot$1,exports2.EmbedBlot=EmbedBlot$1,exports2.InlineBlot=InlineBlot$1,exports2.LeafBlot=LeafBlot$1,exports2.ParentBlot=ParentBlot$1,exports2.Registry=Registry,exports2.Scope=Scope,exports2.ScrollBlot=ScrollBlot$1,exports2.StyleAttributor=StyleAttributor$1,exports2.TextBlot=TextBlot$1,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
-
//# sourceMappingURL=parchment.umd.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parchment.umd.cjs","sources":["../src/scope.ts","../src/attributor/attributor.ts","../src/error.ts","../src/registry.ts","../src/attributor/class.ts","../src/attributor/style.ts","../src/attributor/store.ts","../src/blot/abstract/shadow.ts","../src/blot/abstract/leaf.ts","../src/collection/linked-list.ts","../src/blot/abstract/parent.ts","../src/blot/inline.ts","../src/blot/block.ts","../src/blot/abstract/container.ts","../src/blot/embed.ts","../src/blot/scroll.ts","../src/blot/text.ts"],"sourcesContent":["enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n","import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n","export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n","import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap<Node, Blot>();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n","import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n","import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n","import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n","import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n","import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n","import type LinkedNode from './linked-node.js';\n\nclass LinkedList<T extends LinkedNode> {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce<M>(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n","import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList<Blot>;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList<Blot>();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant<T extends Blot>(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants<T extends Blot>(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot | null): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n","import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record<string, unknown>,\n obj2: Record<string, unknown>,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n","import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n","import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n","import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n","import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n","import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n"],"names":["Scope","match","ClassAttributor","StyleAttributor","ParentBlot","AttributorStore","LeafBlot","InlineBlot","BlockBlot","ContainerBlot"],"mappings":"oRAAK,IAAA,OAAAA,SACHA,OAAAA,OAAA,KAAQ,CAAR,EAAA,OACAA,OAAAA,OAAA,MAAU,EAAV,EAAA,QAEAA,OAAAA,OAAA,UAAa,EAAb,EAAA,YACAA,OAAAA,OAAA,KAAQ,EAAR,EAAA,OACAA,OAAAA,OAAA,OAAU,CAAV,EAAA,SACAA,OAAAA,OAAA,MAAS,EAAT,EAAA,QAEAA,OAAAA,OAAA,WAAa,EAAb,EAAA,aACAA,OAAAA,OAAA,YAAc,CAAd,EAAA,cACAA,OAAAA,OAAA,gBAAkB,CAAlB,EAAA,kBACAA,OAAAA,OAAA,iBAAmB,CAAnB,EAAA,mBAEAA,OAAAA,OAAA,IAAM,EAAN,EAAA,MAdGA,SAAA,OAAA,CAAA,CAAA,ECOL,MAAqB,UAAW,CAQ9B,YACkB,SACA,QAChB,QAA6B,CAAA,EAC7B,CAHgB,KAAA,SAAA,SACA,KAAA,QAAA,QAGV,MAAA,aAAe,MAAM,KAAO,MAAM,UACnC,KAAA,MACH,QAAQ,OAAS,KAEZ,QAAQ,MAAQ,MAAM,MAAS,aAChC,MAAM,UACR,QAAQ,WAAa,OACvB,KAAK,UAAY,QAAQ,UAE7B,CArBA,OAAc,KAAK,KAA6B,CACvC,OAAA,MAAM,KAAK,KAAK,UAAU,EAAE,IAAK,MAAe,KAAK,IAAI,CAClE,CAqBO,IAAI,KAAmB,MAAqB,CACjD,OAAK,KAAK,OAAO,KAAM,KAAK,GAGvB,KAAA,aAAa,KAAK,QAAS,KAAK,EAC9B,IAHE,EAIX,CAEO,OAAO,MAAoB,MAAqB,CACjD,OAAA,KAAK,WAAa,KACb,GAEL,OAAO,OAAU,SACZ,KAAK,UAAU,QAAQ,MAAM,QAAQ,QAAS,EAAE,CAAC,EAAI,GAErD,KAAK,UAAU,QAAQ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,SAAW,EACvB,KAAK,OAAO,EACH,KAAK,gBAAgB,WAAY,KAAK,KAAK,OAAS,OAC7D,KAAK,SAAS,KAAK,OAAA,EAAW,KAAK,KAAkB,OAAO,EAC5D,KAAK,KAAK,SAEd,CAEO,SAAS,MAAe,WAAa,GAAuB,CAC1D,MAAA,CAAC,KAAK,QAAS,KAAK,CAC7B,CAEO,MAAM,MAAe,MAAQ,GAAoB,CACtD,GAAI,CAAC,MAAO,CACV,GAAI,QAAU,EACL,OAAA,KAEL,GAAA,QAAU,KAAK,SACjB,OAAO,KAAK,IAEhB,CACM,MAAA,MAAQ,KAAK,OAAO,OAAO,KAAK,QAAQ,UAAU,KAAK,CAAC,EAC9D,YAAK,OAAO,aAAa,MAAO,KAAK,MAAQ,MAAS,EACtD,KAAK,KAAO,KAAK,QAAQ,MAAM,KAAK,OAAO,EACpC,KACT,CAEO,OACL,UACA,SACM,CAEJ,UAAU,KAAM,UAEZ,SAAS,OAAS,iBAAmB,SAAS,SAAW,KAAK,OAEjE,IAED,KAAK,KAAO,KAAK,QAAQ,MAAM,KAAK,OAAO,EAE/C,CAEO,OAAgB,CACrB,OAAO,KAAK,IACd,CACF,EA5FE,UAAuB,SAAW,OAClC,UAAc,MAAQ,MAAM,YAF9B,IAAM,SAAN,UA+FA,MAAA,WAAe"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "parchment",
|
|
3
|
-
"version": "3.0.0",
|
|
4
|
-
"description": "A document model for rich text editors",
|
|
5
|
-
"author": "Jason Chen <jhchen7@gmail.com>",
|
|
6
|
-
"homepage": "http://quilljs.com/docs/parchment",
|
|
7
|
-
"main": "./dist/parchment.js",
|
|
8
|
-
"types": "./dist/parchment.d.ts",
|
|
9
|
-
"type": "module",
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"files": [
|
|
12
|
-
"tsconfig.json",
|
|
13
|
-
"dist",
|
|
14
|
-
"src"
|
|
15
|
-
],
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@arethetypeswrong/cli": "^0.15.1",
|
|
18
|
-
"@microsoft/api-extractor": "^7.42.3",
|
|
19
|
-
"@types/node": "^18.15.11",
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
21
|
-
"@typescript-eslint/parser": "^7.2.0",
|
|
22
|
-
"@vitest/browser": "^1.4.0",
|
|
23
|
-
"del-cli": "^5.1.0",
|
|
24
|
-
"eslint": "^8.46.0",
|
|
25
|
-
"eslint-config-prettier": "^9.1.0",
|
|
26
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
27
|
-
"eslint-plugin-require-extensions": "^0.1.3",
|
|
28
|
-
"eslint-plugin-tree-shaking": "^1.12.1",
|
|
29
|
-
"playwright": "1.42.1",
|
|
30
|
-
"prettier": "^3.2.5",
|
|
31
|
-
"typescript": "^5.4.2",
|
|
32
|
-
"vite": "^5.1.6",
|
|
33
|
-
"vitest": "^1.4.0"
|
|
34
|
-
},
|
|
35
|
-
"prettier": {
|
|
36
|
-
"singleQuote": true
|
|
37
|
-
},
|
|
38
|
-
"license": "BSD-3-Clause",
|
|
39
|
-
"repository": "github:quilljs/parchment",
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "npm run build:bundle && npm run build:types",
|
|
42
|
-
"build:bundle": "vite build",
|
|
43
|
-
"build:types": "tsc --emitDeclarationOnly && api-extractor run && del-cli dist/typings",
|
|
44
|
-
"lint": "eslint 'src/**/*.ts' 'tests/**/*.ts'",
|
|
45
|
-
"prepare": "npm run build",
|
|
46
|
-
"test": "npm run test:unit",
|
|
47
|
-
"test:unit": "vitest --typecheck",
|
|
48
|
-
"test:pkg": "attw $(npm pack)"
|
|
49
|
-
},
|
|
50
|
-
"bugs": {
|
|
51
|
-
"url": "https://github.com/quilljs/parchment/issues"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import Scope from '../scope.js';
|
|
2
|
-
|
|
3
|
-
export interface AttributorOptions {
|
|
4
|
-
scope?: Scope;
|
|
5
|
-
whitelist?: string[];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default class Attributor {
|
|
9
|
-
public static keys(node: HTMLElement): string[] {
|
|
10
|
-
return Array.from(node.attributes).map((item: Attr) => item.name);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public scope: Scope;
|
|
14
|
-
public whitelist: string[] | undefined;
|
|
15
|
-
|
|
16
|
-
constructor(
|
|
17
|
-
public readonly attrName: string,
|
|
18
|
-
public readonly keyName: string,
|
|
19
|
-
options: AttributorOptions = {},
|
|
20
|
-
) {
|
|
21
|
-
const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;
|
|
22
|
-
this.scope =
|
|
23
|
-
options.scope != null
|
|
24
|
-
? // Ignore type bits, force attribute bit
|
|
25
|
-
(options.scope & Scope.LEVEL) | attributeBit
|
|
26
|
-
: Scope.ATTRIBUTE;
|
|
27
|
-
if (options.whitelist != null) {
|
|
28
|
-
this.whitelist = options.whitelist;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
public add(node: HTMLElement, value: any): boolean {
|
|
33
|
-
if (!this.canAdd(node, value)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
node.setAttribute(this.keyName, value);
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public canAdd(_node: HTMLElement, value: any): boolean {
|
|
41
|
-
if (this.whitelist == null) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
if (typeof value === 'string') {
|
|
45
|
-
return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1;
|
|
46
|
-
} else {
|
|
47
|
-
return this.whitelist.indexOf(value) > -1;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public remove(node: HTMLElement): void {
|
|
52
|
-
node.removeAttribute(this.keyName);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public value(node: HTMLElement): any {
|
|
56
|
-
const value = node.getAttribute(this.keyName);
|
|
57
|
-
if (this.canAdd(node, value) && value) {
|
|
58
|
-
return value;
|
|
59
|
-
}
|
|
60
|
-
return '';
|
|
61
|
-
}
|
|
62
|
-
}
|