website-utilities 1.0.346 → 1.0.348
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/deploy.js +1 -1
- package/index.js +1 -1
- package/index.scss +1 -6
- package/package.json +16 -16
- package/readme.md +0 -5
package/deploy.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}(()=>{
|
|
2
|
+
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}(()=>{const e=require("child_process"),i=require("path"),n=(i,n={})=>(0,e.execSync)(i,{encoding:"utf-8",shell:"/bin/bash",...n});if(n("git branch").includes("* main")){console.info("Build new web page."),n("yarn build");const e=n("pwd"),a=(0,i.resolve)(e,"../",`${(0,i.basename)(e)}.github.io`);let l="./",u="./";n("git branch").includes("gh-pages")?(console.info("Checkout distribution branch."),n("git checkout gh-pages")):a?(l=`${a}/build/`,u=a):console.warn("No website target found."),console.info("Update page data."),n(`\n rsync './build/' '${l}' $ILU_RSYNC_DEFAULT_ARGUMENTS --exclude=CNAME --exclude='.*' --exclude=node_modules --exclude=readme.md --exclude=./build\n `),n("rm --recursive --force ./build"),console.info("Upload compiled webpage"),n("git pull",{cwd:u}),n("git add --all",{cwd:u}),n("git commit --message 'Automatic page build update.'",{cwd:u}),n("git push",{cwd:u}),n("git branch").includes("gh-pages")?console.info("Switch back to source directory."):(console.info("Switch back to main branch."),n("git checkout main"))}module.exports={}})();
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/regenerator","clientnode"],t);else{var n="object"==typeof exports?t(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):t(e["@babel/runtime/helpers/asyncToGenerator"],e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/inheritsLoose"],e["@babel/runtime/regenerator"],e.clientnode);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(function(e,t,n,o,i){return function(){var r=[,,,function(t){t.exports=e},function(e){e.exports=t},function(e){e.exports=n},function(e){e.exports=o},function(e){e.exports=i}],a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return r[e](n,n.exports,s),n.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return function(){s.r(l),s.d(l,{WebsiteUtilities:function(){return y},default:function(){return T}});var e=s(3),t=s.n(e),n=s(4),o=s.n(n),i=s(5),r=s.n(i),a=s(6),d=s.n(a),c=s(7),u=function(){return u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)},p={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},h=function(){function e(e){void 0===e&&(e={}),this.opts=u(u({},p),e)}return e.prototype.spin=function(e){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),m(this.el,{position:this.opts.position,width:0,zIndex:this.opts.zIndex,left:this.opts.left,top:this.opts.top,transform:"scale("+this.opts.scale+")"}),e&&e.insertBefore(this.el,e.firstChild||null),function(e,t){var n=Math.round(t.corners*t.width*500)/1e3+"px",o="none";!0===t.shadow?o="0 2px 4px #000":"string"==typeof t.shadow&&(o=t.shadow);for(var i=function(e){for(var t=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,n=[],o=0,i=e.split(",");o<i.length;o++){var r=i[o].match(t);if(null!==r){var a=+r[2],s=+r[5],l=r[4],d=r[7];0!==a||l||(l=d),0!==s||d||(d=l),l===d&&n.push({prefix:r[1]||"",x:a,y:s,xUnits:l,yUnits:d,end:r[8]})}}return n}(o),r=0;r<t.lines;r++){var a=~~(360/t.lines*r+t.rotate),s=m(document.createElement("div"),{position:"absolute",top:-t.width/2+"px",width:t.length+t.width+"px",height:t.width+"px",background:f(t.fadeColor,r),borderRadius:n,transformOrigin:"left",transform:"rotate("+a+"deg) translateX("+t.radius+"px)"}),l=r*t.direction/t.lines/t.speed;l-=1/t.speed;var d=m(document.createElement("div"),{width:"100%",height:"100%",background:f(t.color,r),borderRadius:n,boxShadow:g(i,a),animation:1/t.speed+"s linear "+l+"s infinite "+t.animation});s.appendChild(d),e.appendChild(s)}}(this.el,this.opts),this},e.prototype.stop=function(){return this.el&&("undefined"!=typeof requestAnimationFrame?cancelAnimationFrame(this.animateId):clearTimeout(this.animateId),this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},e}();function m(e,t){for(var n in t)e.style[n]=t[n];return e}function f(e,t){return"string"==typeof e?e:e[t%e.length]}function g(e,t){for(var n=[],o=0,i=e;o<i.length;o++){var r=i[o],a=w(r.x,r.y,t);n.push(r.prefix+a[0]+r.xUnits+" "+a[1]+r.yUnits+r.end)}return n.join(", ")}function w(e,t,n){var o=n*Math.PI/180,i=Math.sin(o),r=Math.cos(o);return[Math.round(1e3*(e*r+t*i))/1e3,Math.round(1e3*(-e*i+t*r))/1e3]}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var y=function(e){function n(){for(var t,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return(t=e.call.apply(e,[this].concat(o))||this).options=null,t.$domNodes=null,t.currentMediaQueryMode="",t.currentSectionName="home",t.languageHandler=null,t.startUpAnimationIsComplete=!1,t.viewportIsOnTop=!1,t.windowLoaded=!1,t.windowLoadingSpinner=null,t._onViewportMovesToTop=(0,c.debounce)((function(){"hidden"===t.$domNodes.scrollToTopButton.css("visibility")?t.$domNodes.scrollToTopButton.css("opacity",0):(t.options.scrollToTop.button.hideAnimationOptions.always=function(){return t.$domNodes.scrollToTopButton.css({bottom:"-="+t.options.scrollToTop.button.slideDistanceInPixel,display:"none"})},t.$domNodes.scrollToTopButton.finish().animate({bottom:"+="+String(t.options.scrollToTop.button.slideDistanceInPixel),opacity:0},t.options.scrollToTop.button.hideAnimationOptions))})),t._onViewportMovesAwayFromTop=(0,c.debounce)((function(){"hidden"===t.$domNodes.scrollToTopButton.css("visibility")?t.$domNodes.scrollToTopButton.css("opacity",1):t.$domNodes.scrollToTopButton.finish().css({bottom:"+="+String(t.options.scrollToTop.button.slideDistanceInPixel),display:"block",opacity:0}).animate({bottom:"-="+String(t.options.scrollToTop.button.slideDistanceInPixel),queue:!1,opacity:1},t.options.scrollToTop.button.showAnimationOptions)})),t}r()(n,e);var i=n.prototype;return i.initialize=function(t){var o=this;return void 0===t&&(t={}),e.prototype.initialize.call(this,(0,c.extend)(!0,{},n._defaultOptions,t)),this.$domNodes=this.grabDomNodes(this.options.domNodes),this.disableScrolling(),new Promise((function(e){o.$domNodes.windowLoadingSpinner.length&&(o.windowLoadingSpinner=new h(o.options.windowLoadingSpinner),o.windowLoadingSpinner.spin(o.$domNodes.windowLoadingSpinner[0])),o._bindScrollEvents(),o.$domNodes.parent.show();var t=function(){o.windowLoaded||(o.windowLoaded=!0,o._removeLoadingCover().then((function(){o._performStartUpEffects(),e(o)})))};(0,c.$)((function(){(0,c.timeout)(t,o.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),o.on(o.$domNodes.window,"load",t),o._bindClickTracking(),o.options.language.logging||(o.options.language.logging=o.options.logging),o.options.activateLanguageSupport&&!o.languageHandler&&(0,c.$)(o.$domNodes.parent).Internationalisation(o.options.language).then((function(e){o.languageHandler=e.data("Internationalisation")})),o._bindNavigationEvents(),o._bindMediaQueryChangeEvents(),o._triggerWindowResizeEvents()}))},i.scrollToTop=function(){return c.globalContext.document&&(0,c.$)("html, body").stop().animate({scrollTop:0},this.options.scrollToTop.options),this},i.disableScrolling=function(){return this.$domNodes.parent.addClass("disable-scrolling").on("touchmove",(function(e){return e.preventDefault()})),this},i.enableScrolling=function(){return this.$domNodes.parent.removeClass(["disable-scrolling","touchmove"]),this.off(this.$domNodes.parent),this},i.track=function(e){if(c.globalContext.window.location&&this.options.tracking){var t=o()({context:c.globalContext.window.location.pathname+"#"+this.currentSectionName},e);(isNaN(t.value)||"number"!=typeof t.value)&&(t.value=1),this.debug('Run tracking code: "event" with arguments:'),this.debug(t);try{this.options.tracking.track(t)}catch(e){this.warn('Problem in tracking "'+(0,c.represent)(t)+'": '+(0,c.represent)(e))}}return this},i._onChangeMediaQueryMode=function(e,t){},i._onChangeToLargeMode=function(e,t){},i._onChangeToMediumMode=function(e,t){},i._onChangeToSmallMode=function(e,t){},i._onChangeToExtraSmallMode=function(e,t){},i._onSwitchSection=function(e){var t;if(c.globalContext.window.location&&null!=(t=this.options.tracking)&&t.sectionSwitch&&this.currentSectionName!==e){this.currentSectionName=e,this.debug('Run section switch tracking on section "'+this.currentSectionName+'".');try{this.options.tracking.sectionSwitch.call(this,this.currentSectionName)}catch(e){this.warn('Problem due to track section switch to "'+this.currentSectionName+'": '+(0,c.represent)(e))}}},i._onStartUpAnimationComplete=function(){this.startUpAnimationIsComplete=!0},i._bindMediaQueryChangeEvents=function(){this.on(this.$domNodes.window,"resize",this._triggerWindowResizeEvents.bind(this))},i._triggerWindowResizeEvents=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var o,i=v(this.options.mediaQueryClassNameIndicator);!(o=i()).done;){var r=o.value;this.$domNodes.mediaQueryIndicator.prependTo(this.$domNodes.parent).addClass("hidden-"+r[1]),this.$domNodes.mediaQueryIndicator.is(":hidden")&&r[0]!==this.currentMediaQueryMode&&(this.fireEvent.apply(this,["changeMediaQueryMode",!1,this,this.currentMediaQueryMode,r[0]].concat(t)),this.fireEvent.apply(this,["changeTo"+(0,c.capitalize)(r[0])+"Mode",!1,this,this.currentMediaQueryMode,r[0]].concat(t)),this.currentMediaQueryMode=r[0]),this.$domNodes.mediaQueryIndicator.removeClass("hidden-"+r[1])}},i._bindScrollEvents=function(){for(var e=this,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];var i=(0,c.$)("body, html").add(this.$domNodes.window);i.on(this.options.knownScrollEventNames.join(" "),(function(t){e.options.switchToManualScrollingIndicator(t)&&i.stop(!0)})),this.on(this.$domNodes.window,"scroll",(function(){e.$domNodes.window.scrollTop()?e.viewportIsOnTop&&(e.viewportIsOnTop=!1,e.fireEvent.apply(e,["viewportMovesAwayFromTop",!1,e].concat(n))):e.viewportIsOnTop||(e.viewportIsOnTop=!0,e.fireEvent.apply(e,["viewportMovesToTop",!1,e].concat(n)))})),this.$domNodes.window.scrollTop()?(this.viewportIsOnTop=!1,this.fireEvent.apply(this,["viewportMovesAwayFromTop",!1,this].concat(n))):(this.viewportIsOnTop=!0,this.fireEvent.apply(this,["viewportMovesToTop",!1,this].concat(n)))},i._removeLoadingCover=function(){var e=t()(d().mark((function e(){var t=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.timeout)(this.options.additionalPageLoadingTimeInMilliseconds);case 2:return(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).css(this.options.startUpHide),e.next=5,new Promise((function(e){t.$domNodes.windowLoadingCover.length?(t.enableScrolling(),t.$domNodes.windowLoadingCover.animate(t.options.windowLoadingCoverHideAnimation,{always:function(){return e()}})):e()}));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),i._performStartUpEffects=function(){var e=t()(d().mark((function e(t){var n,o=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t&&(t=1),this.$domNodes.windowLoadingCover.hide(),this.windowLoadingSpinner&&this.windowLoadingSpinner.stop(),!(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).length){e.next=17;break}return e.next=6,(0,c.timeout)(this.options.startUpAnimationElementDelayInMiliseconds);case 6:if(n=!1,(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+t).animate(this.options.startUpShowAnimation,{always:function(){n&&o.fireEvent("startUpAnimationComplete")}}),!(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+(t+1)).length){e.next=14;break}return e.next=12,this._performStartUpEffects(t+1);case 12:e.next=15;break;case 14:n=!0;case 15:e.next=18;break;case 17:this.fireEvent("startUpAnimationComplete");case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),i._bindNavigationEvents=function(){var e=this;c.globalContext.window.addEventListener("hashchange",(function(t){e.startUpAnimationIsComplete&&e.fireEvent("switchSection",!1,e,location.hash.substring(1),t)}),!1),this._bindScrollToTopButton()},i._bindScrollToTopButton=function(){var e=this;this.on(this.$domNodes.scrollToTopButton,"click",(function(t){t.preventDefault(),e.scrollToTop()}))},i._bindClickTracking=function(){var e=this;this.options.tracking&&(this.options.tracking.linkClick&&this.on(this.$domNodes.parent.find("a"),"click",(function(t){return e.options.tracking.linkClick.call(e,(0,c.$)(t.target),t)})),this.options.tracking.buttonClick&&this.on(this.$domNodes.parent.find("button"),"click",(function(t){return e.options.tracking.buttonClick.call(e,(0,c.$)(t.target),t)})))},n}(c.Tools);y._defaultOptions={activateLanguageSupport:!0,additionalPageLoadingTimeInMilliseconds:0,domain:"auto",domNodes:{mediaQueryIndicator:'<div class="wu-media-query-indicator">',scrollToTopButton:'a[href="#top"]',startUpAnimationClassPrefix:".wu-start-up-animation-number-",top:"header",windowLoadingCover:".window-loading-cover, .wu-window-loading-cover",windowLoadingSpinner:".window-loading-cover > div, .wu-window-loading-cover > div"},domNodeSelectorInfix:"wu",domNodeSelectorPrefix:"body.{1}",initialSectionName:"home",knownScrollEventNames:["DOMMouseScroll","keyup","mousedown","mousewheel","scroll","touchmove","wheel"],language:{},mediaQueryClassNameIndicator:[["extraSmall","xs"],["small","sm"],["medium","md"],["large","lg"]],name:"WebsiteUtilities",onChangeMediaQueryMode:c.NOOP,onChangeToExtraSmallMode:c.NOOP,onChangeToLargeMode:c.NOOP,onChangeToMediumMode:c.NOOP,onChangeToSmallMode:c.NOOP,onViewportMovesAwayFromTop:c.NOOP,onViewportMovesToTop:c.NOOP,onSwitchSection:c.NOOP,onStartUpAnimationComplete:c.NOOP,scrollToTop:{button:{hideAnimationOptions:{},showAnimationOptions:{},slideDistanceInPixel:30},options:{duration:"fast"}},startUpAnimationElementDelayInMiliseconds:100,startUpHide:{opacity:0},startUpShowAnimation:{opacity:1},switchToManualScrollingIndicator:function(e){return"number"==typeof e.which&&e.which>0||"mousedown"===e.type||"mousewheel"===e.type||"touchmove"===e.type},tracking:{buttonClick:function(e,t){this.track({event:"buttonClick",eventType:"click",label:e.text(),reference:e.attr("action")||e.attr("target")||e.attr("type")||e.text(),subject:"button",value:parseInt(e.attr("website-analytics-value")),userInteraction:!0})},linkClick:function(e,t){this.track({event:"linkClick",eventType:"click",label:e.text(),reference:e.attr("href")||e.attr("action")||e.attr("target")||e.attr("type")||e.text(),subject:"link",value:parseInt(e.attr("website-analytics-value")),userInteraction:!0})},sectionSwitch:function(e){this.track({event:"sectionSwitch",eventType:"sectionSwitch",label:e,reference:c.globalContext.window.location.pathname+"#"+e,subject:"url",userInteraction:!1})},track:function(e){var t;null==(t=c.globalContext.dataLayer)||t.push(e)}},windowLoadingCoverHideAnimation:{opacity:0},windowLoadingSpinner:{animation:"spinner-line-fade-quick",className:"spinner",color:"#000",corners:1,direction:1,fadeColor:"transparent",left:"auto",length:23,lines:9,position:"absolute",radius:40,rotate:0,scale:1,shadow:!1,speed:1.1,top:"auto",width:11,zIndex:2e9},windowLoadedTimeoutAfterDocLoadedInMSec:2e3};var T=y;c.$.WebsiteUtilities=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.Tools.controller(y,t)},c.$.WebsiteUtilities.class=y}(),l}()}));
|
|
1
|
+
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/regenerator","clientnode"],e);else{var o="object"==typeof exports?e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):e(t["@babel/runtime/helpers/asyncToGenerator"],t["@babel/runtime/helpers/extends"],t["@babel/runtime/helpers/inheritsLoose"],t["@babel/runtime/regenerator"],t.clientnode);for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(this,(function(t,e,o,n,i){return function(){var r=[,,,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=o},function(t){t.exports=n},function(t){t.exports=i}],a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var o=a[t]={exports:{}};return r[t](o,o.exports,s),o.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var l={};return function(){s.r(l),s.d(l,{WebsiteUtilities:function(){return b},default:function(){return y}});var t=s(3),e=s.n(t),o=s(4),n=s.n(o),i=s(5),r=s.n(i),a=s(6),d=s.n(a),c=s(7),u=function(){return u=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},p={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},h=function(){function t(t){void 0===t&&(t={}),this.opts=u(u({},p),t)}return t.prototype.spin=function(t){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),t&&t.insertBefore(this.el,t.firstChild||null),function(t,e){var o=Math.round(e.corners*e.width*500)/1e3+"px",n="none";!0===e.shadow?n="0 2px 4px #000":"string"==typeof e.shadow&&(n=e.shadow);for(var i=function(t){for(var e=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,o=[],n=0,i=t.split(",");n<i.length;n++){var r=i[n].match(e);if(null!==r){var a=+r[2],s=+r[5],l=r[4],d=r[7];0!==a||l||(l=d),0!==s||d||(d=l),l===d&&o.push({prefix:r[1]||"",x:a,y:s,xUnits:l,yUnits:d,end:r[8]})}}return o}(n),r=0;r<e.lines;r++){var a=~~(360/e.lines*r+e.rotate),s=document.createElement("div");s.style.position="absolute",s.style.top="".concat(-e.width/2,"px"),s.style.width=e.length+e.width+"px",s.style.height=e.width+"px",s.style.background=m(e.fadeColor,r),s.style.borderRadius=o,s.style.transformOrigin="left",s.style.transform="rotate(".concat(a,"deg) translateX(").concat(e.radius,"px)");var l=r*e.direction/e.lines/e.speed;l-=1/e.speed;var d=document.createElement("div");d.style.width="100%",d.style.height="100%",d.style.background=m(e.color,r),d.style.borderRadius=o,d.style.boxShadow=f(i,a),d.style.animation="".concat(1/e.speed,"s linear ").concat(l,"s infinite ").concat(e.animation),s.appendChild(d),t.appendChild(s)}}(this.el,this.opts),this},t.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},t}();function m(t,e){return"string"==typeof t?t:t[e%t.length]}function f(t,e){for(var o=[],n=0,i=t;n<i.length;n++){var r=i[n],a=g(r.x,r.y,e);o.push(r.prefix+a[0]+r.xUnits+" "+a[1]+r.yUnits+r.end)}return o.join(", ")}function g(t,e,o){var n=o*Math.PI/180,i=Math.sin(n),r=Math.cos(n);return[Math.round(1e3*(t*r+e*i))/1e3,Math.round(1e3*(-t*i+e*r))/1e3]}function w(t,e){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(o)return(o=o.call(t)).next.bind(o);if(Array.isArray(t)||(o=function(t,e){if(t){if("string"==typeof t)return v(t,e);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?v(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){o&&(t=o);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=Array(e);o<e;o++)n[o]=t[o];return n}var b=function(t){function o(){for(var e,o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).options=null,e.$domNodes=null,e.currentMediaQueryMode="",e.currentSectionName="home",e.languageHandler=null,e.startUpAnimationIsComplete=!1,e.viewportIsOnTop=!1,e.windowLoaded=!1,e.windowLoadingSpinner=null,e._onViewportMovesToTop=(0,c.debounce)((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",0):(e.options.scrollToTop.button.hideAnimationOptions.always=function(){return e.$domNodes.scrollToTopButton.css({bottom:"-="+e.options.scrollToTop.button.slideDistanceInPixel,display:"none"})},e.$domNodes.scrollToTopButton.finish().animate({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),opacity:0},e.options.scrollToTop.button.hideAnimationOptions))})),e._onViewportMovesAwayFromTop=(0,c.debounce)((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",1):e.$domNodes.scrollToTopButton.finish().css({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"block",opacity:0}).animate({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),queue:!1,opacity:1},e.options.scrollToTop.button.showAnimationOptions)})),e}r()(o,t);var i=o.prototype;return i.initialize=function(e){var n=this;return void 0===e&&(e={}),t.prototype.initialize.call(this,(0,c.extend)(!0,{},o._defaultOptions,e)),this.$domNodes=this.grabDomNodes(this.options.domNodes),this.disableScrolling(),new Promise((function(t){n.$domNodes.windowLoadingSpinner.length&&(n.windowLoadingSpinner=new h(n.options.windowLoadingSpinner),n.windowLoadingSpinner.spin(n.$domNodes.windowLoadingSpinner[0])),n._bindScrollEvents(),n.$domNodes.parent.show();var e=function(){n.windowLoaded||(n.windowLoaded=!0,n._removeLoadingCover().then((function(){n._performStartUpEffects(),t(n)})))};(0,c.$)((function(){(0,c.timeout)(e,n.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),n.on(n.$domNodes.window,"load",e),n._bindClickTracking(),n.options.language.logging||(n.options.language.logging=n.options.logging),n.options.activateLanguageSupport&&!n.languageHandler&&(0,c.$)(n.$domNodes.parent).Internationalisation(n.options.language).then((function(t){n.languageHandler=t.data("Internationalisation")})),n._bindNavigationEvents(),n._bindMediaQueryChangeEvents(),n._triggerWindowResizeEvents()}))},i.scrollToTop=function(){return c.globalContext.document&&(0,c.$)("html, body").stop().animate({scrollTop:0},this.options.scrollToTop.options),this},i.disableScrolling=function(){return this.$domNodes.parent.addClass("disable-scrolling").on("touchmove",(function(t){return t.preventDefault()})),this},i.enableScrolling=function(){return this.$domNodes.parent.removeClass(["disable-scrolling","touchmove"]),this.off(this.$domNodes.parent),this},i.track=function(t){if(c.globalContext.window.location&&this.options.tracking){var e=n()({context:c.globalContext.window.location.pathname+"#"+this.currentSectionName},t);(isNaN(e.value)||"number"!=typeof e.value)&&(e.value=1),this.debug('Run tracking code: "event" with arguments:'),this.debug(e);try{this.options.tracking.track(e)}catch(t){this.warn('Problem in tracking "'+(0,c.represent)(e)+'": '+(0,c.represent)(t))}}return this},i._onChangeMediaQueryMode=function(t,e){},i._onChangeToLargeMode=function(t,e){},i._onChangeToMediumMode=function(t,e){},i._onChangeToSmallMode=function(t,e){},i._onChangeToExtraSmallMode=function(t,e){},i._onSwitchSection=function(t){var e;if(c.globalContext.window.location&&null!=(e=this.options.tracking)&&e.sectionSwitch&&this.currentSectionName!==t){this.currentSectionName=t,this.debug('Run section switch tracking on section "'+this.currentSectionName+'".');try{this.options.tracking.sectionSwitch.call(this,this.currentSectionName)}catch(t){this.warn('Problem due to track section switch to "'+this.currentSectionName+'": '+(0,c.represent)(t))}}},i._onStartUpAnimationComplete=function(){this.startUpAnimationIsComplete=!0},i._bindMediaQueryChangeEvents=function(){this.on(this.$domNodes.window,"resize",this._triggerWindowResizeEvents.bind(this))},i._triggerWindowResizeEvents=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];for(var n,i=w(this.options.mediaQueryClassNameIndicator);!(n=i()).done;){var r=n.value;this.$domNodes.mediaQueryIndicator.prependTo(this.$domNodes.parent).addClass("hidden-"+r[1]),this.$domNodes.mediaQueryIndicator.is(":hidden")&&r[0]!==this.currentMediaQueryMode&&(this.fireEvent.apply(this,["changeMediaQueryMode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.fireEvent.apply(this,["changeTo"+(0,c.capitalize)(r[0])+"Mode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.currentMediaQueryMode=r[0]),this.$domNodes.mediaQueryIndicator.removeClass("hidden-"+r[1])}},i._bindScrollEvents=function(){for(var t=this,e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];var i=(0,c.$)("body, html").add(this.$domNodes.window);i.on(this.options.knownScrollEventNames.join(" "),(function(e){t.options.switchToManualScrollingIndicator(e)&&i.stop(!0)})),this.on(this.$domNodes.window,"scroll",(function(){t.$domNodes.window.scrollTop()?t.viewportIsOnTop&&(t.viewportIsOnTop=!1,t.fireEvent.apply(t,["viewportMovesAwayFromTop",!1,t].concat(o))):t.viewportIsOnTop||(t.viewportIsOnTop=!0,t.fireEvent.apply(t,["viewportMovesToTop",!1,t].concat(o)))})),this.$domNodes.window.scrollTop()?(this.viewportIsOnTop=!1,this.fireEvent.apply(this,["viewportMovesAwayFromTop",!1,this].concat(o))):(this.viewportIsOnTop=!0,this.fireEvent.apply(this,["viewportMovesToTop",!1,this].concat(o)))},i._removeLoadingCover=function(){var t=e()(d().mark((function t(){var e=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.timeout)(this.options.additionalPageLoadingTimeInMilliseconds);case 2:return(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).css(this.options.startUpHide),t.next=5,new Promise((function(t){e.$domNodes.windowLoadingCover.length?(e.enableScrolling(),e.$domNodes.windowLoadingCover.animate(e.options.windowLoadingCoverHideAnimation,{always:function(){return t()}})):t()}));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),i._performStartUpEffects=function(){var t=e()(d().mark((function t(e){var o,n=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=1),this.$domNodes.windowLoadingCover.hide(),this.windowLoadingSpinner&&this.windowLoadingSpinner.stop(),!(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).length){t.next=17;break}return t.next=6,(0,c.timeout)(this.options.startUpAnimationElementDelayInMiliseconds);case 6:if(o=!1,(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+e).animate(this.options.startUpShowAnimation,{always:function(){o&&n.fireEvent("startUpAnimationComplete")}}),!(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+(e+1)).length){t.next=14;break}return t.next=12,this._performStartUpEffects(e+1);case 12:t.next=15;break;case 14:o=!0;case 15:t.next=18;break;case 17:this.fireEvent("startUpAnimationComplete");case 18:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i._bindNavigationEvents=function(){var t=this;c.globalContext.window.addEventListener("hashchange",(function(e){t.startUpAnimationIsComplete&&t.fireEvent("switchSection",!1,t,location.hash.substring(1),e)}),!1),this._bindScrollToTopButton()},i._bindScrollToTopButton=function(){var t=this;this.on(this.$domNodes.scrollToTopButton,"click",(function(e){e.preventDefault(),t.scrollToTop()}))},i._bindClickTracking=function(){var t=this;this.options.tracking&&(this.options.tracking.linkClick&&this.on(this.$domNodes.parent.find("a"),"click",(function(e){return t.options.tracking.linkClick.call(t,(0,c.$)(e.target),e)})),this.options.tracking.buttonClick&&this.on(this.$domNodes.parent.find("button"),"click",(function(e){return t.options.tracking.buttonClick.call(t,(0,c.$)(e.target),e)})))},o}(c.Tools);b._defaultOptions={activateLanguageSupport:!0,additionalPageLoadingTimeInMilliseconds:0,domain:"auto",domNodes:{mediaQueryIndicator:'<div class="wu-media-query-indicator">',scrollToTopButton:'a[href="#top"]',startUpAnimationClassPrefix:".wu-start-up-animation-number-",top:"header",windowLoadingCover:".window-loading-cover, .wu-window-loading-cover",windowLoadingSpinner:".window-loading-cover > div, .wu-window-loading-cover > div"},domNodeSelectorInfix:"wu",domNodeSelectorPrefix:"body.{1}",initialSectionName:"home",knownScrollEventNames:["DOMMouseScroll","keyup","mousedown","mousewheel","scroll","touchmove","wheel"],language:{},mediaQueryClassNameIndicator:[["extraSmall","xs"],["small","sm"],["medium","md"],["large","lg"]],name:"WebsiteUtilities",onChangeMediaQueryMode:c.NOOP,onChangeToExtraSmallMode:c.NOOP,onChangeToLargeMode:c.NOOP,onChangeToMediumMode:c.NOOP,onChangeToSmallMode:c.NOOP,onViewportMovesAwayFromTop:c.NOOP,onViewportMovesToTop:c.NOOP,onSwitchSection:c.NOOP,onStartUpAnimationComplete:c.NOOP,scrollToTop:{button:{hideAnimationOptions:{},showAnimationOptions:{},slideDistanceInPixel:30},options:{duration:"fast"}},startUpAnimationElementDelayInMiliseconds:100,startUpHide:{opacity:0},startUpShowAnimation:{opacity:1},switchToManualScrollingIndicator:function(t){return"number"==typeof t.which&&t.which>0||"mousedown"===t.type||"mousewheel"===t.type||"touchmove"===t.type},tracking:{buttonClick:function(t,e){this.track({event:"buttonClick",eventType:"click",label:t.text(),reference:t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"button",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},linkClick:function(t,e){this.track({event:"linkClick",eventType:"click",label:t.text(),reference:t.attr("href")||t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"link",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},sectionSwitch:function(t){this.track({event:"sectionSwitch",eventType:"sectionSwitch",label:t,reference:c.globalContext.window.location.pathname+"#"+t,subject:"url",userInteraction:!1})},track:function(t){var e;null==(e=c.globalContext.dataLayer)||e.push(t)}},windowLoadingCoverHideAnimation:{opacity:0},windowLoadingSpinner:{animation:"spinner-line-fade-quick",className:"spinner",color:"#000",corners:1,direction:1,fadeColor:"transparent",left:"auto",length:23,lines:9,position:"absolute",radius:40,rotate:0,scale:1,shadow:!1,speed:1.1,top:"auto",width:11,zIndex:2e9},windowLoadedTimeoutAfterDocLoadedInMSec:2e3};var y=b;c.$.WebsiteUtilities=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return c.Tools.controller(b,e)},c.$.WebsiteUtilities.class=b}(),l}()}));
|
package/index.scss
CHANGED
|
@@ -23,8 +23,7 @@ endregion */
|
|
|
23
23
|
/*** region extra small dimension */
|
|
24
24
|
@custom-media --w-extra-extra-small
|
|
25
25
|
(min-width: #{v.$extra-extra-small-width});
|
|
26
|
-
@custom-media --w-extra-small
|
|
27
|
-
(min-width: #{v.$extra-small-width}));
|
|
26
|
+
@custom-media --w-extra-small (min-width: #{v.$extra-small-width});
|
|
28
27
|
/*** endregion */
|
|
29
28
|
/*** region default media query dimensions */
|
|
30
29
|
@custom-media --w-small (min-width: #{v.$small-width});
|
|
@@ -365,7 +364,3 @@ a.wu-a:visited,
|
|
|
365
364
|
}
|
|
366
365
|
}
|
|
367
366
|
/* endregion */
|
|
368
|
-
/* region vim modline
|
|
369
|
-
vim: set tabstop=4 shiftwidth=4 expandtab:
|
|
370
|
-
vim: foldmethod=marker foldmarker=region,endregion:
|
|
371
|
-
endregion */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "website-utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.348",
|
|
4
4
|
"description": "extend your web app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jquery",
|
|
@@ -62,24 +62,24 @@
|
|
|
62
62
|
"watch": "weboptimizer build --watch"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@babel/eslint-parser": "^7.24.
|
|
65
|
+
"@babel/eslint-parser": "^7.24.8",
|
|
66
66
|
"@babel/plugin-transform-proto-to-assign": "^7.24.7",
|
|
67
|
-
"@babel/runtime": "^7.24.
|
|
67
|
+
"@babel/runtime": "^7.24.8",
|
|
68
68
|
"@types/ejs": "^3.1.5",
|
|
69
69
|
"@types/html-minifier": "^4.0.5",
|
|
70
70
|
"@types/jquery": "^3.5.30",
|
|
71
71
|
"@types/jsdom": "^21.1.7",
|
|
72
|
-
"@types/node": "^20.14.
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^7.16.
|
|
74
|
-
"@typescript-eslint/parser": "^7.16.
|
|
75
|
-
"clientnode": "^3.0.
|
|
72
|
+
"@types/node": "^20.14.11",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^7.16.1",
|
|
74
|
+
"@typescript-eslint/parser": "^7.16.1",
|
|
75
|
+
"clientnode": "^3.0.1167",
|
|
76
76
|
"css-loader": "^7.1.2",
|
|
77
77
|
"cssnano": "^7.0.4",
|
|
78
|
-
"documentation-website": "^1.0.
|
|
79
|
-
"eslint": "^9.
|
|
78
|
+
"documentation-website": "^1.0.329",
|
|
79
|
+
"eslint": "^9.7.0",
|
|
80
80
|
"eslint-config-google": "^0.14.0",
|
|
81
|
-
"eslint-plugin-jsdoc": "^48.
|
|
82
|
-
"internationalisation": "^1.0.
|
|
81
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
82
|
+
"internationalisation": "^1.0.318",
|
|
83
83
|
"jest": "^29.7.0",
|
|
84
84
|
"jquery": "^3.7.1",
|
|
85
85
|
"jsdoc": "^4.0.3",
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
"postcss-scss": "^4.0.9",
|
|
93
93
|
"postcss-sprites": "^4.2.1",
|
|
94
94
|
"postcss-url": "^10.1.3",
|
|
95
|
-
"sass": "^1.77.
|
|
95
|
+
"sass": "^1.77.8",
|
|
96
96
|
"sass-loader": "^14.2.1",
|
|
97
|
-
"spin.js": "^4.1.
|
|
97
|
+
"spin.js": "^4.1.2",
|
|
98
98
|
"style-loader": "^4.0.0",
|
|
99
|
-
"stylelint": "^16.
|
|
99
|
+
"stylelint": "^16.7.0",
|
|
100
100
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
101
|
-
"typescript-eslint": "^7.16.
|
|
102
|
-
"weboptimizer": "^2.0.
|
|
101
|
+
"typescript-eslint": "^7.16.1",
|
|
102
|
+
"weboptimizer": "^2.0.1491",
|
|
103
103
|
"webpack-dev-server": "^5.0.4"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
package/readme.md
CHANGED