colette-kss-builder
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -14,3 +14,3 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,function(){return function(t){function e(e){for(var n,o,s=e[0],a=e[1],r=0,c=[];r<s.length;r++)o=s[r],i[o]&&c.push(i[o][0]),i[o]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(l&&l(e);c.length;)c.shift()()}var n={},i={2:0};function o(e){if(n[e])return n[e].exports;var i=n[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.e=function(t){var e=[],n=i[t];if(0!==n)if(n)e.push(n[2]);else{var s=new Promise(function(e,o){n=i[t]=[e,o]});e.push(n[2]=s);var a=document.getElementsByTagName("head")[0],r=document.createElement("script");r.charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.src=function(t){return o.p+""+({0:"vendors~kssHighlightCode",1:"kssHighlightCode"}[t]||t)+".bundle.js"}(t);var l=setTimeout(function(){c({type:"timeout",target:r})},12e4);function c(e){r.onerror=r.onload=null,clearTimeout(l);var n=i[t];if(0!==n){if(n){var o=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src,a=new Error("Loading chunk "+t+" failed.\n("+o+": "+s+")");a.type=o,a.request=s,n[1](a)}i[t]=void 0}}r.onerror=r.onload=c,a.appendChild(r)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},o.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="./kss-assets/",o.oe=function(t){throw console.error(t),t};var s=window.webpackJsonp=window.webpackJsonp||[],a=s.push.bind(s);s.push=e,s=s.slice();for(var r=0;r<s.length;r++)e(s[r]);var l=a;return o(o.s=131)}({125:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return new o(t)};var i={openBtnId:"trigger",sidebarId:"sidebar",overlayId:"overlay",closeBtnId:"close"};function o(t){this.config=Object.assign({},i,t),this.sidebar=document.getElementById(this.config.sidebarId),this.overlay=document.getElementById(this.config.overlayId),this.openBtn=document.getElementById(this.config.openBtnId),this.closeBtn=document.getElementById(this.config.closeBtnId),this.bindEvents()}o.prototype.close=function(){document.body.style.overflow=null,this.sidebar.classList.remove("co_sidebar-open"),this.overlay.setAttribute("aria-hidden",!0)},o.prototype.open=function(){document.body.style.overflow="hidden",this.sidebar.classList.add("co_sidebar-open"),this.overlay.removeAttribute("aria-hidden")},o.prototype.bindEvents=function(){this.openBtn.addEventListener("click",this.open.bind(this)),this.closeBtn.addEventListener("click",this.close.bind(this)),this.sidebar.addEventListener("click",this.close.bind(this)),this.overlay.addEventListener("click",this.close.bind(this))}},126:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return new o};var i=["hover","enabled","disabled","active","visited","focus","target","checked","empty","first-of-type","last-of-type","first-child","last-child"];function o(){try{for(var t=void 0,e=void 0,n=void 0,o=void 0,s=void 0,a=new RegExp("(\\:"+i.join("|\\:")+")","g"),r=document.styleSheets,l=0,c=r.length;l<c;l+=1)if((n=r[l]).href&&n.href.indexOf(document.domain)>=0)for(t=0,o=(s=n.cssRules).length;t<o;t+=1)(e=s[t]).type===CSSRule.STYLE_RULE&&a.test(e.selectorText)&&this.insertRule(e.cssText.replace(a,function(t){return t.replace(/:/g,".pseudo-class-")})),a.lastIndex=0}catch(t){}}o.prototype.insertRule=function(t){var e=document.getElementsByTagName("head")[0],n=document.createElement("style");return n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n)}},127:function(t,e,n){"use strict";var i; | ||
*/ | ||
!function(o,s,a){var r=function(t,e){var n=t;return this.closeTabs=function(t){var i;n.openedTab.length&&null!==n.multiselectable&&((i=Array.prototype.slice.call(n.openedTab)).forEach(function(e){t?this.toggleDisplay(e):e.click()}.bind(this)),t||null===n.multiselectable||e.closeAll(i))},this.firstActiveTab=function(){for(var t,e=0;e<n.tabs.length;e++)if(!n.tabs[e].disabled){t=e;break}return t},this.getOpenedTabs=function(){return n.openedTab.slice()},this.handleDisplay=function(t){t.preventDefault();var e=t.currentTarget;e.disabled||(e!==s.activeElement&&e.focus(),this.toggleDisplay(e))},this.handleFocus=function(t){var e=t.currentTarget;e.disabled||(n.currentTabIndex=n.tabs.indexOf(e),this.select(n.tabs[n.currentTabIndex]))},this.handlePanel=function(t){switch(void 0===n.currentTabIndex&&this.handlePanelFocus(t),t.keyCode){case 33:t.ctrlKey&&(t.preventDefault(),this.switchTab(n.currentTabIndex-1));break;case 34:t.ctrlKey&&(t.preventDefault(),this.switchTab(n.currentTabIndex+1));break;case 38:t.ctrlKey&&(t.preventDefault(),this.switchTab(n.currentTabIndex))}},this.handlePanelFocus=function(t){if(t.target.doubleFocus)return t.preventDefault(),void delete t.target.doubleFocus;var e;e=t.currentTarget.tab,n.currentTabIndex=n.tabs.indexOf(e),["radio","checkbox"].indexOf(t.target.type)>=0&&(t.target.doubleFocus=!0)},this.handleTab=function(t){switch(void 0===n.currentTabIndex&&this.handleFocus(t),t.keyCode){case 32:case 13:this.handleDisplay(t);break;case 35:t.preventDefault(),this.switchTab(n.tabs.length-1);break;case 36:t.preventDefault(),this.switchTab(this.firstActiveTab());break;case 37:case 38:t.preventDefault(),this.switchTab(n.currentTabIndex-1);break;case 39:case 40:t.preventDefault(),this.switchTab(n.currentTabIndex+1)}},this.init=function(){if(!t||!t.nodeName)throw new Error("No DOM node provided. Abort.");e={closeAll:e&&e.closeAll||this.noop,closeTab:e&&e.closeTab||this.noop,openTab:e&&e.openTab||this.noop},this.setTablist()},this.noop=function(){},this.select=function(t){var e;n.tabs.forEach(function(i){e=t===i,i.setAttribute("aria-selected",e),i.setAttribute("tabindex",e?0:-1),e&&null===n.multiselectable&&this.toggleDisplay(i)}.bind(this))},this.setTablist=function(){var t,e,i;n.tabs=[],n.tabPanels=[],n.openedTab=[],n.multiselectable=n.attributes["aria-multiselectable"]?"true"===n.attributes["aria-multiselectable"].value:null,Array.prototype.forEach.call(n.querySelectorAll("[role=tab]"),function(o){if(e=!1,(t=o.getAttribute("aria-controls"))?o.tabPanel=s.getElementById(t):o.nextElementSibling&&o.nextElementSibling.getAttribute("aria-labelledby")===o.id&&(o.tabPanel=o.nextElementSibling),!o.tabPanel)throw new Error("Could not find associated tabpanel for tab "+o.id+'. Use [aria-controls="tabpanelId"] on the [role=tab] element to link them together');o.tabPanel.tab=o,o.tabList=n,o.disabled=o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled"),o.hasAttribute("data-tab-open")&&!o.disabled&&(!n.multiselectable&&!n.openedTab.length||n.multiselectable)&&(n.openedTab.push(o),e=!0),o.removeAttribute("data-tab-open"),i||o.disabled||(i=o),o.setAttribute("tabindex",-1),o.setAttribute("aria-expanded",e),o.tabPanel.setAttribute("aria-hidden",!e),n.tabs.push(o),n.tabPanels.push(o.tabPanel),o.addEventListener("click",this.handleDisplay.bind(this)),o.addEventListener("focus",this.handleFocus.bind(this)),o.addEventListener("keydown",this.handleTab.bind(this)),o.tabPanel.addEventListener("focus",this.handlePanelFocus.bind(this)),o.tabPanel.addEventListener("keydown",this.handlePanel.bind(this))}.bind(this)),n.tabsLength=n.tabs.length,n.tabPanelsLength=n.tabPanels.length,n.openedTab.length?n.openedTab[0].setAttribute("tabindex",0):n.openedTab.length||null!==n.multiselectable?i.setAttribute("tabindex",0):(i.setAttribute("tabindex",0),i.setAttribute("aria-expanded",!0),i.tabPanel.setAttribute("aria-hidden",!1),n.openedTab.push(i))},this.switchTab=function(t){var e;if(n.tabs[t]&&n.tabs[t].disabled)return e=t>n.currentTabIndex?t+1:t-1,void this.switchTab(e);n.currentTabIndex=t,n.currentTabIndex<this.firstActiveTab()?n.currentTabIndex=n.tabsLength-1:n.currentTabIndex>=n.tabsLength&&(n.currentTabIndex=this.firstActiveTab()),n.tabs[n.currentTabIndex].focus()},this.toggleDisplay=function(t){var i,o,s;if(i=t.tabPanel,o="true"===t.getAttribute("aria-expanded"),null===n.multiselectable){if(o)return;e.closeTab(n.openedTab[0])}o?(s=n.openedTab.indexOf(t),n.openedTab.splice(s,1),e.closeTab(t)):(n.multiselectable||(n.openedTab.forEach(function(t){t.setAttribute("aria-expanded",!1),t.tabPanel.setAttribute("aria-hidden",!0),e.closeTab(t)}),n.openedTab.length=0),n.openedTab.push(t),e.openTab(t)),t.setAttribute("aria-expanded",!o),i.setAttribute("aria-hidden",o)},this.init(),{closeAll:this.closeTabs,openedTab:this.getOpenedTabs}};void 0===(i=function(){return r}.call(e,n,e,t))||(t.exports=i)}(window,document)},128:function(t,e,n){"use strict";var i,o,s,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};o=[],void 0===(s="function"==typeof(i=function(){var t={bind:!!function(){}.bind,classList:"classList"in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};function e(t){this.callback=t,this.ticking=!1}function n(t,e){var i;e=function t(e){if(arguments.length<=0)throw new Error("Missing arguments in extend function");var n,i,o,s=e||{};for(i=1;i<arguments.length;i++){var r=arguments[i]||{};for(n in r)"object"!==a(s[n])||(o=s[n])&&"undefined"!=typeof window&&(o===window||o.nodeType)?s[n]=s[n]||r[n]:s[n]=t(s[n],r[n])}return s}(e,n.options),this.lastKnownScrollY=0,this.elem=t,this.tolerance=(i=e.tolerance)===Object(i)?i:{down:i,up:i},this.classes=e.classes,this.offset=e.offset,this.scroller=e.scroller,this.initialised=!1,this.onPin=e.onPin,this.onUnpin=e.onUnpin,this.onTop=e.onTop,this.onNotTop=e.onNotTop,this.onBottom=e.onBottom,this.onNotBottom=e.onNotBottom}return window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,e.prototype={constructor:e,update:function(){this.callback&&this.callback(),this.ticking=!1},requestTick:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)},handleEvent:function(){this.requestTick()}},n.prototype={constructor:n,init:function(){if(n.cutsTheMustard)return this.debouncer=new e(this.update.bind(this)),this.elem.classList.add(this.classes.initial),setTimeout(this.attachEvent.bind(this),100),this},destroy:function(){var t=this.classes;for(var e in this.initialised=!1,t)t.hasOwnProperty(e)&&this.elem.classList.remove(t[e]);this.scroller.removeEventListener("scroll",this.debouncer,!1)},attachEvent:function(){this.initialised||(this.lastKnownScrollY=this.getScrollY(),this.initialised=!0,this.scroller.addEventListener("scroll",this.debouncer,!1),this.debouncer.handleEvent())},unpin:function(){var t=this.elem.classList,e=this.classes;!t.contains(e.pinned)&&t.contains(e.unpinned)||(t.add(e.unpinned),t.remove(e.pinned),this.onUnpin&&this.onUnpin.call(this))},pin:function(){var t=this.elem.classList,e=this.classes;t.contains(e.unpinned)&&(t.remove(e.unpinned),t.add(e.pinned),this.onPin&&this.onPin.call(this))},top:function(){var t=this.elem.classList,e=this.classes;t.contains(e.top)||(t.add(e.top),t.remove(e.notTop),this.onTop&&this.onTop.call(this))},notTop:function(){var t=this.elem.classList,e=this.classes;t.contains(e.notTop)||(t.add(e.notTop),t.remove(e.top),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){var t=this.elem.classList,e=this.classes;t.contains(e.bottom)||(t.add(e.bottom),t.remove(e.notBottom),this.onBottom&&this.onBottom.call(this))},notBottom:function(){var t=this.elem.classList,e=this.classes;t.contains(e.notBottom)||(t.add(e.notBottom),t.remove(e.bottom),this.onNotBottom&&this.onNotBottom.call(this))},getScrollY:function(){return void 0!==this.scroller.pageYOffset?this.scroller.pageYOffset:void 0!==this.scroller.scrollTop?this.scroller.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop},getViewportHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},getElementPhysicalHeight:function(t){return Math.max(t.offsetHeight,t.clientHeight)},getScrollerPhysicalHeight:function(){return this.scroller===window||this.scroller===document.body?this.getViewportHeight():this.getElementPhysicalHeight(this.scroller)},getDocumentHeight:function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,t.clientHeight,e.clientHeight)},getElementHeight:function(t){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},getScrollerHeight:function(){return this.scroller===window||this.scroller===document.body?this.getDocumentHeight():this.getElementHeight(this.scroller)},isOutOfBounds:function(t){var e=t<0,n=t+this.getScrollerPhysicalHeight()>this.getScrollerHeight();return e||n},toleranceExceeded:function(t,e){return Math.abs(t-this.lastKnownScrollY)>=this.tolerance[e]},shouldUnpin:function(t,e){var n=t>this.lastKnownScrollY,i=t>=this.offset;return n&&i&&e},shouldPin:function(t,e){var n=t<this.lastKnownScrollY,i=t<=this.offset;return n&&e||i},update:function(){var t=this.getScrollY(),e=t>this.lastKnownScrollY?"down":"up",n=this.toleranceExceeded(t,e);this.isOutOfBounds(t)||(t<=this.offset?this.top():this.notTop(),t+this.getViewportHeight()>=this.getScrollerHeight()?this.bottom():this.notBottom(),this.shouldUnpin(t,n)?this.unpin():this.shouldPin(t,n)&&this.pin(),this.lastKnownScrollY=t)}},n.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},n.cutsTheMustard=void 0!==t&&t.rAF&&t.bind&&t.classList,n})?i.apply(e,o):i)||(t.exports=s)},129:function(t,e,n){"use strict";function i(t,e){this.doc=document,this.wrapper="string"==typeof t?this.doc.querySelector(t):t,this.nav=this.wrapper.querySelectorAll(e.nav),this.contents=[],this.win=window,this.winH=this.win.innerHeight,this.className=e.className,this.callback=e.callback,this.init()}i.prototype.init=function(){this.contents=this.getContents(),this.attachEvent()},i.prototype.getContents=function(){for(var t=[],e=0,n=this.nav.length;e<n;e++){var i=this.nav[e].href;t.push(this.doc.getElementById(i.split("#")[1]))}return t},i.prototype.attachEvent=function(){var t,e;this.win.addEventListener("load",function(){this.spy(this.callback)}.bind(this)),this.win.addEventListener("scroll",function(){t&&clearTimeout(t);var e=this;t=setTimeout(function(){e.spy(e.callback)},10)}.bind(this)),this.win.addEventListener("resize",function(){e&&clearTimeout(e);var t=this;e=setTimeout(function(){t.spy(t.callback)},10)}.bind(this))},i.prototype.spy=function(t){var e=this.getElemsViewState();this.markNav(e),"function"==typeof t&&t(e)},i.prototype.getElemsViewState=function(){for(var t=[],e=[],n=[],i=0,o=this.contents.length;i<o;i++){var s=this.contents[i],a=this.isInView(s);a?t.push(s):e.push(s),n.push(a)}return{inView:t,outView:e,viewStatusList:n}},i.prototype.isInView=function(t){var e=this.winH,n=this.doc.documentElement.scrollTop||this.doc.body.scrollTop,i=n+e,o=t.getBoundingClientRect().top+n,s=o+t.offsetHeight;return o<i&&s>n},i.prototype.markNav=function(t){for(var e=this.nav,n=!1,i=0,o=e.length;i<o;i++)t.viewStatusList[i]&&!n?(n=!0,e[i].classList.add(this.className)):e[i].classList.remove(this.className)},t.exports=i},130:function(t,e,n){"use strict";(function(e){var i=n(129);e.ScrollSpy=t.exports=i}).call(this,n(63))},131:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.kss=void 0;var i=l(n(130)),o=l(n(128)),s=l(n(127)),a=l(n(126)),r=l(n(125));function l(t){return t&&t.__esModule?t:{default:t}}var c={};c.stateGenerator=(0,a.default)(),c.scrollSpy=new i.default("body",{nav:".co_sidebar-active .co_sidebar-children > li > a",className:"co_sidebar-active"}),c.headroom=new o.default(document.querySelector(".co_navbar"),{offset:50,tolerance:5,classes:{initial:"co_navbar-animated",pinned:"co_navbar-pinned",unpinned:"co_navbar-unpinned"}}),c.headroom.init(),Promise.all([n.e(0),n.e(1)]).then(function(){var t=n(335);return"object"==typeof t&&t&&t.__esModule?t:Object.assign({},"object"==typeof t&&t,{default:t})}).then(function(t){c.highlightCode=t});var d=[];Array.prototype.forEach.call(document.querySelectorAll(".co_tabpanel-list"),function(t){d.push(new s.default(t))}),c.nav=(0,r.default)(),e.kss=c},63:function(t,e,n){"use strict";var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(i=window)}t.exports=i}})}); | ||
!function(o,s,a){var r=function(t,e){var n=t;return this.closeTabs=function(t){var i;n.openedTab.length&&null!==n.multiselectable&&((i=Array.prototype.slice.call(n.openedTab)).forEach(function(e){t?this.toggleDisplay(e):e.click()}.bind(this)),t||null===n.multiselectable||e.closeAll(i))},this.firstActiveTab=function(){for(var t,e=0;e<n.tabs.length;e++)if(!n.tabs[e].disabled){t=e;break}return t},this.getOpenedTabs=function(){return n.openedTab.slice()},this.handleDisplay=function(t){t.preventDefault();var e=t.currentTarget;e.disabled||(e!==s.activeElement&&e.focus(),this.toggleDisplay(e))},this.handleFocus=function(t){var e=t.currentTarget;e.disabled||(n.currentTabIndex=n.tabs.indexOf(e),this.select(n.tabs[n.currentTabIndex]))},this.handlePanel=function(t){switch(void 0===n.currentTabIndex&&this.handlePanelFocus(t),t.keyCode){case 33:t.ctrlKey&&(t.preventDefault(),this.switchTab(n.currentTabIndex-1));break;case 34:t.ctrlKey&&(t.preventDefault(),this.switchTab(n.currentTabIndex+1));break;case 38:t.ctrlKey&&(t.preventDefault(),this.switchTab(n.currentTabIndex))}},this.handlePanelFocus=function(t){if(t.target.doubleFocus)return t.preventDefault(),void delete t.target.doubleFocus;var e;e=t.currentTarget.tab,n.currentTabIndex=n.tabs.indexOf(e),["radio","checkbox"].indexOf(t.target.type)>=0&&(t.target.doubleFocus=!0)},this.handleTab=function(t){switch(void 0===n.currentTabIndex&&this.handleFocus(t),t.keyCode){case 32:case 13:this.handleDisplay(t);break;case 35:t.preventDefault(),this.switchTab(n.tabs.length-1);break;case 36:t.preventDefault(),this.switchTab(this.firstActiveTab());break;case 37:case 38:t.preventDefault(),this.switchTab(n.currentTabIndex-1);break;case 39:case 40:t.preventDefault(),this.switchTab(n.currentTabIndex+1)}},this.init=function(){if(!t||!t.nodeName)throw new Error("No DOM node provided. Abort.");e={closeAll:e&&e.closeAll||this.noop,closeTab:e&&e.closeTab||this.noop,openTab:e&&e.openTab||this.noop},this.setTablist()},this.noop=function(){},this.select=function(t){var e;n.tabs.forEach(function(i){e=t===i,i.setAttribute("aria-selected",e),i.setAttribute("tabindex",e?0:-1),e&&null===n.multiselectable&&this.toggleDisplay(i)}.bind(this))},this.setTablist=function(){var t,e,i;n.tabs=[],n.tabPanels=[],n.openedTab=[],n.multiselectable=n.attributes["aria-multiselectable"]?"true"===n.attributes["aria-multiselectable"].value:null,Array.prototype.forEach.call(n.querySelectorAll("[role=tab]"),function(o){if(e=!1,(t=o.getAttribute("aria-controls"))?o.tabPanel=s.getElementById(t):o.nextElementSibling&&o.nextElementSibling.getAttribute("aria-labelledby")===o.id&&(o.tabPanel=o.nextElementSibling),!o.tabPanel)throw new Error("Could not find associated tabpanel for tab "+o.id+'. Use [aria-controls="tabpanelId"] on the [role=tab] element to link them together');o.tabPanel.tab=o,o.tabList=n,o.disabled=o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled"),o.hasAttribute("data-tab-open")&&!o.disabled&&(!n.multiselectable&&!n.openedTab.length||n.multiselectable)&&(n.openedTab.push(o),e=!0),o.removeAttribute("data-tab-open"),i||o.disabled||(i=o),o.setAttribute("tabindex",-1),o.setAttribute("aria-expanded",e),o.tabPanel.setAttribute("aria-hidden",!e),n.tabs.push(o),n.tabPanels.push(o.tabPanel),o.addEventListener("click",this.handleDisplay.bind(this)),o.addEventListener("focus",this.handleFocus.bind(this)),o.addEventListener("keydown",this.handleTab.bind(this)),o.tabPanel.addEventListener("focus",this.handlePanelFocus.bind(this)),o.tabPanel.addEventListener("keydown",this.handlePanel.bind(this))}.bind(this)),n.tabsLength=n.tabs.length,n.tabPanelsLength=n.tabPanels.length,n.openedTab.length?n.openedTab[0].setAttribute("tabindex",0):n.openedTab.length||null!==n.multiselectable?i.setAttribute("tabindex",0):(i.setAttribute("tabindex",0),i.setAttribute("aria-expanded",!0),i.tabPanel.setAttribute("aria-hidden",!1),n.openedTab.push(i))},this.switchTab=function(t){var e;if(n.tabs[t]&&n.tabs[t].disabled)return e=t>n.currentTabIndex?t+1:t-1,void this.switchTab(e);n.currentTabIndex=t,n.currentTabIndex<this.firstActiveTab()?n.currentTabIndex=n.tabsLength-1:n.currentTabIndex>=n.tabsLength&&(n.currentTabIndex=this.firstActiveTab()),n.tabs[n.currentTabIndex].focus()},this.toggleDisplay=function(t){var i,o,s;if(i=t.tabPanel,o="true"===t.getAttribute("aria-expanded"),null===n.multiselectable){if(o)return;e.closeTab(n.openedTab[0])}o?(s=n.openedTab.indexOf(t),n.openedTab.splice(s,1),e.closeTab(t)):(n.multiselectable||(n.openedTab.forEach(function(t){t.setAttribute("aria-expanded",!1),t.tabPanel.setAttribute("aria-hidden",!0),e.closeTab(t)}),n.openedTab.length=0),n.openedTab.push(t),e.openTab(t)),t.setAttribute("aria-expanded",!o),i.setAttribute("aria-hidden",o)},this.init(),{closeAll:this.closeTabs,openedTab:this.getOpenedTabs}};void 0===(i=function(){return r}.call(e,n,e,t))||(t.exports=i)}(window,document)},128:function(t,e,n){"use strict";var i,o,s,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};o=[],void 0===(s="function"==typeof(i=function(){var t={bind:!!function(){}.bind,classList:"classList"in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};function e(t){this.callback=t,this.ticking=!1}function n(t,e){var i;e=function t(e){if(arguments.length<=0)throw new Error("Missing arguments in extend function");var n,i,o,s=e||{};for(i=1;i<arguments.length;i++){var r=arguments[i]||{};for(n in r)"object"!==a(s[n])||(o=s[n])&&"undefined"!=typeof window&&(o===window||o.nodeType)?s[n]=s[n]||r[n]:s[n]=t(s[n],r[n])}return s}(e,n.options),this.lastKnownScrollY=0,this.elem=t,this.tolerance=(i=e.tolerance)===Object(i)?i:{down:i,up:i},this.classes=e.classes,this.offset=e.offset,this.scroller=e.scroller,this.initialised=!1,this.onPin=e.onPin,this.onUnpin=e.onUnpin,this.onTop=e.onTop,this.onNotTop=e.onNotTop,this.onBottom=e.onBottom,this.onNotBottom=e.onNotBottom}return window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,e.prototype={constructor:e,update:function(){this.callback&&this.callback(),this.ticking=!1},requestTick:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)},handleEvent:function(){this.requestTick()}},n.prototype={constructor:n,init:function(){if(n.cutsTheMustard)return this.debouncer=new e(this.update.bind(this)),this.elem.classList.add(this.classes.initial),setTimeout(this.attachEvent.bind(this),100),this},destroy:function(){var t=this.classes;for(var e in this.initialised=!1,t)t.hasOwnProperty(e)&&this.elem.classList.remove(t[e]);this.scroller.removeEventListener("scroll",this.debouncer,!1)},attachEvent:function(){this.initialised||(this.lastKnownScrollY=this.getScrollY(),this.initialised=!0,this.scroller.addEventListener("scroll",this.debouncer,!1),this.debouncer.handleEvent())},unpin:function(){var t=this.elem.classList,e=this.classes;!t.contains(e.pinned)&&t.contains(e.unpinned)||(t.add(e.unpinned),t.remove(e.pinned),this.onUnpin&&this.onUnpin.call(this))},pin:function(){var t=this.elem.classList,e=this.classes;t.contains(e.unpinned)&&(t.remove(e.unpinned),t.add(e.pinned),this.onPin&&this.onPin.call(this))},top:function(){var t=this.elem.classList,e=this.classes;t.contains(e.top)||(t.add(e.top),t.remove(e.notTop),this.onTop&&this.onTop.call(this))},notTop:function(){var t=this.elem.classList,e=this.classes;t.contains(e.notTop)||(t.add(e.notTop),t.remove(e.top),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){var t=this.elem.classList,e=this.classes;t.contains(e.bottom)||(t.add(e.bottom),t.remove(e.notBottom),this.onBottom&&this.onBottom.call(this))},notBottom:function(){var t=this.elem.classList,e=this.classes;t.contains(e.notBottom)||(t.add(e.notBottom),t.remove(e.bottom),this.onNotBottom&&this.onNotBottom.call(this))},getScrollY:function(){return void 0!==this.scroller.pageYOffset?this.scroller.pageYOffset:void 0!==this.scroller.scrollTop?this.scroller.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop},getViewportHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},getElementPhysicalHeight:function(t){return Math.max(t.offsetHeight,t.clientHeight)},getScrollerPhysicalHeight:function(){return this.scroller===window||this.scroller===document.body?this.getViewportHeight():this.getElementPhysicalHeight(this.scroller)},getDocumentHeight:function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,t.clientHeight,e.clientHeight)},getElementHeight:function(t){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},getScrollerHeight:function(){return this.scroller===window||this.scroller===document.body?this.getDocumentHeight():this.getElementHeight(this.scroller)},isOutOfBounds:function(t){var e=t<0,n=t+this.getScrollerPhysicalHeight()>this.getScrollerHeight();return e||n},toleranceExceeded:function(t,e){return Math.abs(t-this.lastKnownScrollY)>=this.tolerance[e]},shouldUnpin:function(t,e){var n=t>this.lastKnownScrollY,i=t>=this.offset;return n&&i&&e},shouldPin:function(t,e){var n=t<this.lastKnownScrollY,i=t<=this.offset;return n&&e||i},update:function(){var t=this.getScrollY(),e=t>this.lastKnownScrollY?"down":"up",n=this.toleranceExceeded(t,e);this.isOutOfBounds(t)||(t<=this.offset?this.top():this.notTop(),t+this.getViewportHeight()>=this.getScrollerHeight()?this.bottom():this.notBottom(),this.shouldUnpin(t,n)?this.unpin():this.shouldPin(t,n)&&this.pin(),this.lastKnownScrollY=t)}},n.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},n.cutsTheMustard=void 0!==t&&t.rAF&&t.bind&&t.classList,n})?i.apply(e,o):i)||(t.exports=s)},129:function(t,e,n){"use strict";function i(t,e){this.doc=document,this.wrapper="string"==typeof t?this.doc.querySelector(t):t,this.nav=this.wrapper.querySelectorAll(e.nav),this.contents=[],this.win=window,this.winH=this.win.innerHeight,this.className=e.className,this.callback=e.callback,this.init()}i.prototype.init=function(){this.contents=this.getContents(),this.attachEvent()},i.prototype.getContents=function(){for(var t=[],e=0,n=this.nav.length;e<n;e++){var i=this.nav[e].href;t.push(this.doc.getElementById(i.split("#")[1]))}return t},i.prototype.attachEvent=function(){var t,e;this.win.addEventListener("load",function(){this.spy(this.callback)}.bind(this)),this.win.addEventListener("scroll",function(){t&&clearTimeout(t);var e=this;t=setTimeout(function(){e.spy(e.callback)},10)}.bind(this)),this.win.addEventListener("resize",function(){e&&clearTimeout(e);var t=this;e=setTimeout(function(){t.spy(t.callback)},10)}.bind(this))},i.prototype.spy=function(t){var e=this.getElemsViewState();this.markNav(e),"function"==typeof t&&t(e)},i.prototype.getElemsViewState=function(){for(var t=[],e=[],n=[],i=0,o=this.contents.length;i<o;i++){var s=this.contents[i],a=this.isInView(s);a?t.push(s):e.push(s),n.push(a)}return{inView:t,outView:e,viewStatusList:n}},i.prototype.isInView=function(t){var e=this.winH,n=this.doc.documentElement.scrollTop||this.doc.body.scrollTop,i=n+e,o=t.getBoundingClientRect().top+n,s=o+t.offsetHeight;return o<i&&s>n},i.prototype.markNav=function(t){for(var e=this.nav,n=!1,i=0,o=e.length;i<o;i++)t.viewStatusList[i]&&!n?(n=!0,e[i].classList.add(this.className)):e[i].classList.remove(this.className)},t.exports=i},130:function(t,e,n){"use strict";(function(e){var i=n(129);e.ScrollSpy=t.exports=i}).call(this,n(64))},131:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.kss=void 0;var i=l(n(130)),o=l(n(128)),s=l(n(127)),a=l(n(126)),r=l(n(125));function l(t){return t&&t.__esModule?t:{default:t}}var c={};c.stateGenerator=(0,a.default)(),c.scrollSpy=new i.default("body",{nav:".co_sidebar-active .co_sidebar-children > li > a",className:"co_sidebar-active"}),c.headroom=new o.default(document.querySelector(".co_navbar"),{offset:50,tolerance:5,classes:{initial:"co_navbar-animated",pinned:"co_navbar-pinned",unpinned:"co_navbar-unpinned"}}),c.headroom.init(),Promise.all([n.e(0),n.e(1)]).then(function(){var t=n(335);return"object"==typeof t&&t&&t.__esModule?t:Object.assign({},"object"==typeof t&&t,{default:t})}).then(function(t){c.highlightCode=t});var d=[];Array.prototype.forEach.call(document.querySelectorAll(".co_tabpanel-list"),function(t){d.push(new s.default(t))}),c.nav=(0,r.default)(),e.kss=c},64:function(t,e,n){"use strict";var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(i=window)}t.exports=i}})}); | ||
//# sourceMappingURL=kss.bundle.js.map |
{ | ||
"name": "colette-kss-builder", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "The Colette’s Twig.js builder for kss-node.", | ||
@@ -5,0 +5,0 @@ "author": "20 Minutes <web-tech@20minutes.fr>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2178971
2859