MCPcopy
hub / github.com/greensock/GSAP / _getLineWrapper

Function _getLineWrapper

esm/SplitText.js:61–72  ·  view source on GitHub ↗
(element, nodes, config, collection)

Source from the content-addressed store, hash-verified

59 wrapper.collection = collection;
60 return wrapper;
61}, _getLineWrapper = (element, nodes, config, collection) => {
62 let lineWrapper = _getWrapper("line", config, collection), textAlign = window.getComputedStyle(element).textAlign || "left";
63 return (startIndex, endIndex) => {
64 let newLine = lineWrapper("");
65 newLine.style.textAlign = textAlign;
66 element.insertBefore(newLine, nodes[startIndex]);
67 for (; startIndex < endIndex; startIndex++) {
68 newLine.appendChild(nodes[startIndex]);
69 }
70 newLine.normalize();
71 };
72}, _splitWordsAndCharsRecursively = (element, config, wordWrapper, charWrapper, prepForCharsOnly, deepSlice, ignore, charSplitRegEx, specialCharsRegEx, isNested) => {
73 var _a;
74 let nodes = Array.from(element.childNodes), i = 0, { wordDelimiter, reduceWhiteSpace = true, prepareText } = config, elementBounds = element.getBoundingClientRect(), lastBounds = elementBounds, isPreformatted = !reduceWhiteSpace && window.getComputedStyle(element).whiteSpace.substring(0, 3) === "pre", ignoredPreviousSibling = 0, wordsCollection = wordWrapper.collection, wordDelimIsNotSpace, wordDelimString, wordDelimSplitter, curNode, words, curWordEl, startsWithSpace, endsWithSpace, j, bounds, curWordChars, clonedNode, curSubNode, tempSubNode, curTextContent, wordText, lastWordText, k;
75 if (typeof wordDelimiter === "object") {

Callers 1

splitMethod · 0.70

Calls 1

_getWrapperFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…