PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.0.4
UiCore Elements – Free widgets and templates for Elementor v1.0.4
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
uicore-elements / assets / js / elements / splitting.js

splitting.js in UiCore Elements – Free widgets and templates for Elementor 1.0.4, at assets/js/elements/splitting.js

1 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}!function(n){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(void 0).Splitting=n()}(function(){var i=document,a=i.createTextNode.bind(i);function f(n,t,e){n.style.setProperty(t,e)}function p(n,t){return n.appendChild(t)}function d(n,t,e,r){var o=i.createElement("span");return t&&(o.className=t),e&&(r||o.setAttribute("data-"+t,e),o.textContent=e),n&&p(n,o)||o}function m(n,t){return n.getAttribute("data-"+t)}function h(n,t){return n&&0!=n.length?n.nodeName?[n]:[].slice.call(n[0].nodeName?n:(t||i).querySelectorAll(n)):[]}function u(n){for(var t=[];n--;)t[n]=[];return t}function g(n,t){n&&n.some(t)}function o(t){return function(n){return t[n]}}var y={};function n(n,t,e,r){return{by:n,depends:t,key:e,split:r}}function t(n){y[n.by]=n}function v(n,r,o,i,u){n.normalize();var c=[],s=document.createDocumentFragment(),l=(i&&c.push(n.previousSibling),[]);return h(n.childNodes).some(function(n){var t,e;1===n.nodeType&&(n.classList.contains("ui-e-highlight-image")||n.classList.contains("ui-e-highlight-icon")||"IMG"==n.nodeName)&&(c.push(n),console.log("yes")),!n.tagName||n.hasChildNodes()?n.childNodes&&n.childNodes.length?(l.push(n),c.push.apply(c,v(n,r,o,i,u))):(e=(t=n.wholeText||"").trim()).length&&(" "===t[0]&&l.push(a(" ")),g(e.split(o),function(n,t){t&&u&&l.push(d(s,"whitespace"," ",u));t=d(s,r,n);c.push(t),l.push(t)})," "===t[t.length-1])&&l.push(a(" ")):l.push(n)}),g(l,function(n){p(s,n)}),n.innerHTML="",p(n,s),c}var c="words",e=n(c,0,"word",function(n){return v(n,"word",/\s+/,0,1)}),r="chars",s=n(r,[c],"char",function(n,e,t){var r=[];return g(t[c],function(n,t){r.push.apply(r,v(n,"char","",e.whitespace&&t))}),r});function l(t){var l=(t=t||{}).key;return h(t.target||"[data-splitting]").map(function(u){var n,c,s=u["🍌"];return!t.force&&s||(s=u["🍌"]={el:u},n=function t(e,n,r){var o=r.indexOf(e);if(-1==o){r.unshift(e);var i=y[e];if(!i)throw new Error("plugin not loaded: "+e);g(i.depends,function(n){t(n,e,r)})}else{i=r.indexOf(n);r.splice(o,1),r.splice(i,0,e)}return r}(n=(n=t.by||m(u,"splitting"))&&"true"!=n?n:r,0,[]).map(o(y)),c=function(n,t){for(var e in t)n[e]=t[e];return n}({},t),g(n,function(n){var t,e,r,o,i;n.split&&(t=n.by,o=(l?"-"+l:"")+n.key,n=n.split(u,c,s),o&&(e=u,i=(o="--"+o)+"-index",g(r=n,function(n,t){Array.isArray(n)?g(n,function(n){f(n,i,t)}):f(n,i,t)}),f(e,o+"-total",r.length)),s[t]=n,u.classList.add(t))}),u.classList.add("splitting")),s})}function b(n,t,e){var t=h(t.matching||n.children,n),r={};return g(t,function(n){var t=Math.round(n[e]);(r[t]||(r[t]=[])).push(n)}),Object.keys(r).map(Number).sort(w).map(o(r))}function w(n,t){return n-t}l.html=function(n){var t=(n=n||{}).target=d();return t.innerHTML=n.content,l(n),t.outerHTML};var N=n("lines",[c],"line",function(n,t,e){return b(n,{matching:e[c]},"offsetTop")}),S=n("items",0,"item",function(n,t){return h(t.matching||n.children,n)}),x=n("rows",0,"row",function(n,t){return b(n,t,"offsetTop")}),L=n("cols",0,"col",function(n,t){return b(n,t,"offsetLeft")}),T=n("grid",["rows","cols"]),M="layout",k=n(M,0,0,function(n,t){var e,r=t.rows=+(t.rows||m(n,"rows")||1),o=t.columns=+(t.columns||m(n,"columns")||1);t.image=t.image||m(n,"image")||n.currentSrc||n.src,t.image&&(e=h("img",n)[0],t.image=e&&(e.currentSrc||e.src)),t.image&&f(n,"background-image","url("+t.image+")");for(var i=r*o,u=[],c=d(0,"cell-grid");i--;){var s=d(c,"cell");d(s,"cell-inner"),u.push(s)}return p(n,c),u}),A=n("cellRows",[M],"row",function(n,t,e){var r=t.rows,o=u(r);return g(e[M],function(n,t,e){o[Math.floor(t/(e.length/r))].push(n)}),o}),C=n("cellColumns",[M],"col",function(n,t,e){var r=t.columns,o=u(r);return g(e[M],function(n,t){o[t%r].push(n)}),o}),H=n("cells",["cellRows","cellColumns"],"cell",function(n,t,e){return e[M]});return(l.add=t)(e),t(s),t(N),t(S),t(x),t(L),t(T),t(k),t(A),t(C),t(H),l});