Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pull-update

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-update - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

dist/index.esm.js

@@ -281,3 +281,3 @@ var _shared = {

var _ptrStyles = "\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n padding-top: 20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n";
var _ptrStyles = "\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n margin-top: -20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n";

@@ -284,0 +284,0 @@ var _defaults = {

@@ -283,3 +283,3 @@ 'use strict';

var _ptrStyles = "\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n padding-top: 20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n";
var _ptrStyles = "\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n margin-top: -20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n";

@@ -286,0 +286,0 @@ var _defaults = {

/*!
* pull-update v1.0.2
* pull-update v1.0.3
* (c) Rafael Soto

@@ -292,3 +292,3 @@ * Released under the MIT License.

var _ptrStyles = "\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n padding-top: 20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n";
var _ptrStyles = "\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n margin-top: -20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n";

@@ -295,0 +295,0 @@ var _defaults = {

/*!
* pull-update v1.0.2
* pull-update v1.0.3
* (c) Rafael Soto

@@ -7,7 +7,7 @@ * Released under the MIT License.

/*!
* pull-update v1.0.2
* pull-update v1.0.3
* (c) Rafael Soto
* Released under the MIT License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).PullToRefresh=t()}(this,(function(){"use strict";var e={pullStartY:null,pullMoveY:null,handlers:[],styleEl:null,events:null,dist:0,state:"pending",timeout:null,distResisted:0,supportsPassive:!1,supportsPointerEvents:"undefined"!=typeof window&&!!window.PointerEvent};try{window.addEventListener("test",null,{get passive(){e.supportsPassive=!0}})}catch(e){}var t,n={setupDOM:function(t){if(!t.ptrElement){var n=document.createElement("div");t.mainElement!==document.body?t.mainElement.parentNode.insertBefore(n,t.mainElement):document.body.insertBefore(n,document.body.firstChild),n.classList.add(t.classPrefix+"ptr"),n.innerHTML=t.getMarkup().replace(/__PREFIX__/g,t.classPrefix),t.ptrElement=n,"function"==typeof t.onInit&&t.onInit(t),e.styleEl||(e.styleEl=document.createElement("style"),e.styleEl.setAttribute("id","pull-to-refresh-js-style"),document.head.appendChild(e.styleEl)),e.styleEl.textContent=t.getStyles().replace(/__PREFIX__/g,t.classPrefix).replace(/\s+/g," ")}return t},onReset:function(t){t.ptrElement&&(t.ptrElement.classList.remove(t.classPrefix+"refresh"),t.ptrElement.style[t.cssProp]="0px",setTimeout((function(){t.ptrElement&&t.ptrElement.parentNode&&(t.ptrElement.parentNode.removeChild(t.ptrElement),t.ptrElement=null),e.state="pending"}),t.refreshTimeout))},update:function(t){var n=t.ptrElement.querySelector("."+t.classPrefix+"icon");n&&"refreshing"===e.state&&(n.innerHTML="<div style='margin: 0 auto; text-align: center'><svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' style='margin: auto'><path d='M10 3.70968C9.45164 3.70968 9.03229 3.29032 9.03229 2.74194V0.967742C9.03229 0.419355 9.45164 0 10 0C10.5484 0 10.9678 0.419355 10.9678 0.967742V2.74194C10.9678 3.25806 10.5484 3.70968 10 3.70968Z' fill='#1886F8' fill-opacity='0.22'/><path d='M10 20C9.45164 20 9.03229 19.5806 9.03229 19.0322V17.258C9.03229 16.7096 9.45164 16.2903 10 16.2903C10.5484 16.2903 10.9678 16.7096 10.9678 17.258V19.0322C10.9678 19.5806 10.5484 20 10 20Z' fill='#1886F8' fill-opacity='0.8'/><path d='M6.35481 4.67743C6.03223 4.67743 5.70965 4.51614 5.5161 4.19356L4.64513 2.67743C4.38707 2.22582 4.54836 1.61291 4.99997 1.35485C5.45159 1.09679 6.06449 1.25808 6.32255 1.70969L7.19352 3.22582C7.45159 3.67743 7.2903 4.29033 6.83868 4.5484C6.70965 4.61292 6.5161 4.67743 6.35481 4.67743Z' fill='#1886F8' fill-opacity='0.14'/><path d='M14.5161 18.7741C14.1935 18.7741 13.871 18.6128 13.6774 18.2902L12.8064 16.7741C12.5484 16.3225 12.7097 15.7096 13.1613 15.4515C13.6129 15.1935 14.2258 15.3548 14.4839 15.8064L15.3548 17.3225C15.6129 17.7741 15.4516 18.387 15 18.6451C14.8387 18.7419 14.6774 18.7741 14.5161 18.7741Z' fill='#1886F8' fill-opacity='0.7'/><path d='M3.70969 7.32256C3.5484 7.32256 3.38711 7.2903 3.22582 7.19352L1.70969 6.32256C1.25808 6.06449 1.09679 5.45159 1.35485 4.99997C1.61291 4.54836 2.22582 4.38707 2.67743 4.64513L4.19356 5.5161C4.64517 5.77417 4.80646 6.38707 4.5484 6.83868C4.35485 7.16127 4.03227 7.32256 3.70969 7.32256Z' fill='#1886F8' fill-opacity='0.08'/><path d='M17.8387 15.4839C17.6775 15.4839 17.5162 15.4517 17.3549 15.3549L15.8065 14.4839C15.3549 14.2259 15.1936 13.613 15.4517 13.1613C15.7097 12.7097 16.3226 12.5484 16.7742 12.8065L18.2904 13.6775C18.742 13.9355 18.9033 14.5484 18.6452 15.0001C18.4839 15.3226 18.1613 15.4839 17.8387 15.4839Z' fill='#1886F8' fill-opacity='0.6'/><path d='M2.74194 10.9677H0.967742C0.419355 10.9677 0 10.5484 0 9.99997C0 9.45158 0.419355 9.03223 0.967742 9.03223H2.74194C3.29032 9.03223 3.70968 9.45158 3.70968 9.99997C3.70968 10.5484 3.25806 10.9677 2.74194 10.9677Z' fill='#1886F8' fill-opacity='0.05'/><path d='M19.0322 10.9677H17.258C16.7096 10.9677 16.2903 10.5484 16.2903 9.99997C16.2903 9.45158 16.7096 9.03223 17.258 9.03223H19.0322C19.5806 9.03223 20 9.45158 20 9.99997C20 10.5484 19.5806 10.9677 19.0322 10.9677Z' fill='#1886F8' fill-opacity='0.5'/><path d='M2.16133 15.4839C1.83875 15.4839 1.51617 15.3226 1.32262 15.0001C1.06456 14.5484 1.22585 13.9355 1.67746 13.6775L3.19359 12.8065C3.6452 12.5484 4.25811 12.7097 4.51617 13.1613C4.77424 13.613 4.61295 14.2259 4.16133 14.4839L2.6452 15.3549C2.51617 15.4517 2.35488 15.4839 2.16133 15.4839Z' fill='#1886F8'/><path d='M16.2904 7.32256C15.9678 7.32256 15.6452 7.16127 15.4517 6.83868C15.1936 6.38707 15.3549 5.77417 15.8065 5.5161L17.3226 4.64513C17.7742 4.38707 18.3871 4.54836 18.6452 4.99997C18.9033 5.45159 18.742 6.06449 18.2904 6.32256L16.7742 7.19352C16.6129 7.2903 16.4516 7.32256 16.2904 7.32256Z' fill='#1886F8' fill-opacity='0.4'/><path d='M5.48384 18.7741C5.32255 18.7741 5.16126 18.7419 4.99997 18.6451C4.54836 18.387 4.38707 17.7741 4.64513 17.3225L5.5161 15.8064C5.77417 15.3548 6.38707 15.1935 6.83868 15.4515C7.2903 15.7096 7.45159 16.3225 7.19352 16.7741L6.32255 18.2902C6.129 18.6128 5.80642 18.7741 5.48384 18.7741Z' fill='#1886F8' fill-opacity='0.9'/><path d='M13.6452 4.67743C13.4839 4.67743 13.3226 4.64517 13.1613 4.5484C12.7097 4.29033 12.5484 3.67743 12.8064 3.22582L13.6774 1.70969C13.9355 1.25808 14.5484 1.09679 15 1.35485C15.4516 1.61291 15.6129 2.22582 15.3548 2.67743L14.4839 4.19356C14.2903 4.48388 13.9677 4.67743 13.6452 4.67743Z' fill='#1886F8' fill-opacity='0.3'/></svg></div>")}},s=function(t){return e.pointerEventsEnabled&&e.supportsPointerEvents?t.screenY:t.touches[0].screenY},i=function(){var i;function r(t){var r=e.handlers.filter((function(e){return e.contains(t.target)}))[0];e.enable=!!r,r&&"pending"===e.state&&(i=n.setupDOM(r),r.shouldPullToRefresh()&&(e.pullStartY=s(t)),clearTimeout(e.timeout),n.update(r))}function l(t){i&&i.ptrElement&&e.enable&&(e.pullStartY?e.pullMoveY=s(t):i.shouldPullToRefresh()&&(e.pullStartY=s(t)),"refreshing"!==e.state?("pending"===e.state&&(i.ptrElement.classList.add(i.classPrefix+"pull"),e.state="pulling",n.update(i)),e.pullStartY&&e.pullMoveY&&(e.dist=e.pullMoveY-e.pullStartY),e.distExtra=e.dist-i.distIgnore,e.distExtra>0&&(t.cancelable&&t.preventDefault(),i.ptrElement.style[i.cssProp]=e.distResisted+"px",e.distResisted=i.resistanceFunction(e.distExtra/i.distThreshold)*Math.min(i.distMax,e.distExtra),"pulling"===e.state&&e.distResisted>i.distThreshold&&(i.ptrElement.classList.add(i.classPrefix+"release"),e.state="releasing",n.update(i)),"releasing"===e.state&&e.distResisted<i.distThreshold&&(i.ptrElement.classList.remove(i.classPrefix+"release"),e.state="pulling",n.update(i)))):t.cancelable&&i.shouldPullToRefresh()&&e.pullStartY<e.pullMoveY&&t.preventDefault())}function o(){if(i&&i.ptrElement&&e.enable){if(clearTimeout(t),t=setTimeout((function(){i&&i.ptrElement&&"pending"===e.state&&n.onReset(i)}),500),"releasing"===e.state&&e.distResisted>i.distThreshold)e.state="refreshing",i.ptrElement.style[i.cssProp]=i.distReload+"px",i.ptrElement.classList.add(i.classPrefix+"refresh"),e.timeout=setTimeout((function(){var e=i.onRefresh((function(){return n.onReset(i)}));e&&"function"==typeof e.then&&e.then((function(){return n.onReset(i)})),e||i.onRefresh.length||n.onReset(i)}),i.refreshTimeout);else{if("refreshing"===e.state)return;i.ptrElement.style[i.cssProp]="0px",e.state="pending"}n.update(i),i.ptrElement.classList.remove(i.classPrefix+"release"),i.ptrElement.classList.remove(i.classPrefix+"pull"),e.pullStartY=e.pullMoveY=null,e.dist=e.distResisted=0}}function a(){i&&i.mainElement.classList.toggle(i.classPrefix+"top",i.shouldPullToRefresh())}var d=e.supportsPassive?{passive:e.passive||!1}:void 0;return e.pointerEventsEnabled&&e.supportsPointerEvents?(window.addEventListener("pointerup",o),window.addEventListener("pointerdown",r),window.addEventListener("pointermove",l,d)):(window.addEventListener("touchend",o),window.addEventListener("touchstart",r),window.addEventListener("touchmove",l,d)),window.addEventListener("scroll",a),{onTouchEnd:o,onTouchStart:r,onTouchMove:l,onScroll:a,destroy:function(){e.pointerEventsEnabled&&e.supportsPointerEvents?(window.removeEventListener("pointerdown",r),window.removeEventListener("pointerup",o),window.removeEventListener("pointermove",l,d)):(window.removeEventListener("touchstart",r),window.removeEventListener("touchend",o),window.removeEventListener("touchmove",l,d)),window.removeEventListener("scroll",a)}}},r={distThreshold:60,distMax:80,distReload:50,distIgnore:0,mainElement:"body",triggerElement:"body",ptrElement:".ptr",classPrefix:"ptr--",cssProp:"min-height",iconArrow:"&#8675;",iconRefreshing:"&hellip;",instructionsPullToRefresh:"Pull down to refresh",instructionsReleaseToRefresh:"Release to refresh",instructionsRefreshing:"Refreshing",refreshTimeout:500,getMarkup:function(){return'\n<div class="__PREFIX__box">\n <div class="__PREFIX__content">\n <div class="__PREFIX__icon"></div>\n <div class="__PREFIX__text"></div>\n </div>\n</div>\n'},getStyles:function(){return"\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n padding-top: 20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n"},onInit:function(){},onRefresh:function(){return location.reload()},resistanceFunction:function(e){return Math.min(1,e/2.5)},shouldPullToRefresh:function(){return!window.scrollY}},l=["mainElement","ptrElement","triggerElement"],o=function(t){var n={};return Object.keys(r).forEach((function(e){n[e]=t[e]||r[e]})),n.refreshTimeout="number"==typeof t.refreshTimeout?t.refreshTimeout:r.refreshTimeout,l.forEach((function(e){"string"==typeof n[e]&&(n[e]=document.querySelector(n[e]))})),e.events||(e.events=i()),n.contains=function(e){return n.triggerElement.contains(e)},n.destroy=function(){clearTimeout(e.timeout);var t=e.handlers.indexOf(n);e.handlers.splice(t,1)},n};return{setPassiveMode:function(t){e.passive=t},setPointerEventsMode:function(t){e.pointerEventsEnabled=t},destroyAll:function(){e.events&&(e.events.destroy(),e.events=null),e.handlers.forEach((function(e){e.destroy()}))},init:function(t){void 0===t&&(t={});var n=o(t);return e.handlers.push(n),n},_:{setupHandler:o,setupEvents:i,setupDOM:n.setupDOM,onReset:n.onReset,update:n.update}}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).PullToRefresh=t()}(this,(function(){"use strict";var e={pullStartY:null,pullMoveY:null,handlers:[],styleEl:null,events:null,dist:0,state:"pending",timeout:null,distResisted:0,supportsPassive:!1,supportsPointerEvents:"undefined"!=typeof window&&!!window.PointerEvent};try{window.addEventListener("test",null,{get passive(){e.supportsPassive=!0}})}catch(e){}var t,n={setupDOM:function(t){if(!t.ptrElement){var n=document.createElement("div");t.mainElement!==document.body?t.mainElement.parentNode.insertBefore(n,t.mainElement):document.body.insertBefore(n,document.body.firstChild),n.classList.add(t.classPrefix+"ptr"),n.innerHTML=t.getMarkup().replace(/__PREFIX__/g,t.classPrefix),t.ptrElement=n,"function"==typeof t.onInit&&t.onInit(t),e.styleEl||(e.styleEl=document.createElement("style"),e.styleEl.setAttribute("id","pull-to-refresh-js-style"),document.head.appendChild(e.styleEl)),e.styleEl.textContent=t.getStyles().replace(/__PREFIX__/g,t.classPrefix).replace(/\s+/g," ")}return t},onReset:function(t){t.ptrElement&&(t.ptrElement.classList.remove(t.classPrefix+"refresh"),t.ptrElement.style[t.cssProp]="0px",setTimeout((function(){t.ptrElement&&t.ptrElement.parentNode&&(t.ptrElement.parentNode.removeChild(t.ptrElement),t.ptrElement=null),e.state="pending"}),t.refreshTimeout))},update:function(t){var n=t.ptrElement.querySelector("."+t.classPrefix+"icon");n&&"refreshing"===e.state&&(n.innerHTML="<div style='margin: 0 auto; text-align: center'><svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' style='margin: auto'><path d='M10 3.70968C9.45164 3.70968 9.03229 3.29032 9.03229 2.74194V0.967742C9.03229 0.419355 9.45164 0 10 0C10.5484 0 10.9678 0.419355 10.9678 0.967742V2.74194C10.9678 3.25806 10.5484 3.70968 10 3.70968Z' fill='#1886F8' fill-opacity='0.22'/><path d='M10 20C9.45164 20 9.03229 19.5806 9.03229 19.0322V17.258C9.03229 16.7096 9.45164 16.2903 10 16.2903C10.5484 16.2903 10.9678 16.7096 10.9678 17.258V19.0322C10.9678 19.5806 10.5484 20 10 20Z' fill='#1886F8' fill-opacity='0.8'/><path d='M6.35481 4.67743C6.03223 4.67743 5.70965 4.51614 5.5161 4.19356L4.64513 2.67743C4.38707 2.22582 4.54836 1.61291 4.99997 1.35485C5.45159 1.09679 6.06449 1.25808 6.32255 1.70969L7.19352 3.22582C7.45159 3.67743 7.2903 4.29033 6.83868 4.5484C6.70965 4.61292 6.5161 4.67743 6.35481 4.67743Z' fill='#1886F8' fill-opacity='0.14'/><path d='M14.5161 18.7741C14.1935 18.7741 13.871 18.6128 13.6774 18.2902L12.8064 16.7741C12.5484 16.3225 12.7097 15.7096 13.1613 15.4515C13.6129 15.1935 14.2258 15.3548 14.4839 15.8064L15.3548 17.3225C15.6129 17.7741 15.4516 18.387 15 18.6451C14.8387 18.7419 14.6774 18.7741 14.5161 18.7741Z' fill='#1886F8' fill-opacity='0.7'/><path d='M3.70969 7.32256C3.5484 7.32256 3.38711 7.2903 3.22582 7.19352L1.70969 6.32256C1.25808 6.06449 1.09679 5.45159 1.35485 4.99997C1.61291 4.54836 2.22582 4.38707 2.67743 4.64513L4.19356 5.5161C4.64517 5.77417 4.80646 6.38707 4.5484 6.83868C4.35485 7.16127 4.03227 7.32256 3.70969 7.32256Z' fill='#1886F8' fill-opacity='0.08'/><path d='M17.8387 15.4839C17.6775 15.4839 17.5162 15.4517 17.3549 15.3549L15.8065 14.4839C15.3549 14.2259 15.1936 13.613 15.4517 13.1613C15.7097 12.7097 16.3226 12.5484 16.7742 12.8065L18.2904 13.6775C18.742 13.9355 18.9033 14.5484 18.6452 15.0001C18.4839 15.3226 18.1613 15.4839 17.8387 15.4839Z' fill='#1886F8' fill-opacity='0.6'/><path d='M2.74194 10.9677H0.967742C0.419355 10.9677 0 10.5484 0 9.99997C0 9.45158 0.419355 9.03223 0.967742 9.03223H2.74194C3.29032 9.03223 3.70968 9.45158 3.70968 9.99997C3.70968 10.5484 3.25806 10.9677 2.74194 10.9677Z' fill='#1886F8' fill-opacity='0.05'/><path d='M19.0322 10.9677H17.258C16.7096 10.9677 16.2903 10.5484 16.2903 9.99997C16.2903 9.45158 16.7096 9.03223 17.258 9.03223H19.0322C19.5806 9.03223 20 9.45158 20 9.99997C20 10.5484 19.5806 10.9677 19.0322 10.9677Z' fill='#1886F8' fill-opacity='0.5'/><path d='M2.16133 15.4839C1.83875 15.4839 1.51617 15.3226 1.32262 15.0001C1.06456 14.5484 1.22585 13.9355 1.67746 13.6775L3.19359 12.8065C3.6452 12.5484 4.25811 12.7097 4.51617 13.1613C4.77424 13.613 4.61295 14.2259 4.16133 14.4839L2.6452 15.3549C2.51617 15.4517 2.35488 15.4839 2.16133 15.4839Z' fill='#1886F8'/><path d='M16.2904 7.32256C15.9678 7.32256 15.6452 7.16127 15.4517 6.83868C15.1936 6.38707 15.3549 5.77417 15.8065 5.5161L17.3226 4.64513C17.7742 4.38707 18.3871 4.54836 18.6452 4.99997C18.9033 5.45159 18.742 6.06449 18.2904 6.32256L16.7742 7.19352C16.6129 7.2903 16.4516 7.32256 16.2904 7.32256Z' fill='#1886F8' fill-opacity='0.4'/><path d='M5.48384 18.7741C5.32255 18.7741 5.16126 18.7419 4.99997 18.6451C4.54836 18.387 4.38707 17.7741 4.64513 17.3225L5.5161 15.8064C5.77417 15.3548 6.38707 15.1935 6.83868 15.4515C7.2903 15.7096 7.45159 16.3225 7.19352 16.7741L6.32255 18.2902C6.129 18.6128 5.80642 18.7741 5.48384 18.7741Z' fill='#1886F8' fill-opacity='0.9'/><path d='M13.6452 4.67743C13.4839 4.67743 13.3226 4.64517 13.1613 4.5484C12.7097 4.29033 12.5484 3.67743 12.8064 3.22582L13.6774 1.70969C13.9355 1.25808 14.5484 1.09679 15 1.35485C15.4516 1.61291 15.6129 2.22582 15.3548 2.67743L14.4839 4.19356C14.2903 4.48388 13.9677 4.67743 13.6452 4.67743Z' fill='#1886F8' fill-opacity='0.3'/></svg></div>")}},s=function(t){return e.pointerEventsEnabled&&e.supportsPointerEvents?t.screenY:t.touches[0].screenY},i=function(){var i;function r(t){var r=e.handlers.filter((function(e){return e.contains(t.target)}))[0];e.enable=!!r,r&&"pending"===e.state&&(i=n.setupDOM(r),r.shouldPullToRefresh()&&(e.pullStartY=s(t)),clearTimeout(e.timeout),n.update(r))}function l(t){i&&i.ptrElement&&e.enable&&(e.pullStartY?e.pullMoveY=s(t):i.shouldPullToRefresh()&&(e.pullStartY=s(t)),"refreshing"!==e.state?("pending"===e.state&&(i.ptrElement.classList.add(i.classPrefix+"pull"),e.state="pulling",n.update(i)),e.pullStartY&&e.pullMoveY&&(e.dist=e.pullMoveY-e.pullStartY),e.distExtra=e.dist-i.distIgnore,e.distExtra>0&&(t.cancelable&&t.preventDefault(),i.ptrElement.style[i.cssProp]=e.distResisted+"px",e.distResisted=i.resistanceFunction(e.distExtra/i.distThreshold)*Math.min(i.distMax,e.distExtra),"pulling"===e.state&&e.distResisted>i.distThreshold&&(i.ptrElement.classList.add(i.classPrefix+"release"),e.state="releasing",n.update(i)),"releasing"===e.state&&e.distResisted<i.distThreshold&&(i.ptrElement.classList.remove(i.classPrefix+"release"),e.state="pulling",n.update(i)))):t.cancelable&&i.shouldPullToRefresh()&&e.pullStartY<e.pullMoveY&&t.preventDefault())}function o(){if(i&&i.ptrElement&&e.enable){if(clearTimeout(t),t=setTimeout((function(){i&&i.ptrElement&&"pending"===e.state&&n.onReset(i)}),500),"releasing"===e.state&&e.distResisted>i.distThreshold)e.state="refreshing",i.ptrElement.style[i.cssProp]=i.distReload+"px",i.ptrElement.classList.add(i.classPrefix+"refresh"),e.timeout=setTimeout((function(){var e=i.onRefresh((function(){return n.onReset(i)}));e&&"function"==typeof e.then&&e.then((function(){return n.onReset(i)})),e||i.onRefresh.length||n.onReset(i)}),i.refreshTimeout);else{if("refreshing"===e.state)return;i.ptrElement.style[i.cssProp]="0px",e.state="pending"}n.update(i),i.ptrElement.classList.remove(i.classPrefix+"release"),i.ptrElement.classList.remove(i.classPrefix+"pull"),e.pullStartY=e.pullMoveY=null,e.dist=e.distResisted=0}}function a(){i&&i.mainElement.classList.toggle(i.classPrefix+"top",i.shouldPullToRefresh())}var d=e.supportsPassive?{passive:e.passive||!1}:void 0;return e.pointerEventsEnabled&&e.supportsPointerEvents?(window.addEventListener("pointerup",o),window.addEventListener("pointerdown",r),window.addEventListener("pointermove",l,d)):(window.addEventListener("touchend",o),window.addEventListener("touchstart",r),window.addEventListener("touchmove",l,d)),window.addEventListener("scroll",a),{onTouchEnd:o,onTouchStart:r,onTouchMove:l,onScroll:a,destroy:function(){e.pointerEventsEnabled&&e.supportsPointerEvents?(window.removeEventListener("pointerdown",r),window.removeEventListener("pointerup",o),window.removeEventListener("pointermove",l,d)):(window.removeEventListener("touchstart",r),window.removeEventListener("touchend",o),window.removeEventListener("touchmove",l,d)),window.removeEventListener("scroll",a)}}},r={distThreshold:60,distMax:80,distReload:50,distIgnore:0,mainElement:"body",triggerElement:"body",ptrElement:".ptr",classPrefix:"ptr--",cssProp:"min-height",iconArrow:"&#8675;",iconRefreshing:"&hellip;",instructionsPullToRefresh:"Pull down to refresh",instructionsReleaseToRefresh:"Release to refresh",instructionsRefreshing:"Refreshing",refreshTimeout:500,getMarkup:function(){return'\n<div class="__PREFIX__box">\n <div class="__PREFIX__content">\n <div class="__PREFIX__icon"></div>\n <div class="__PREFIX__text"></div>\n </div>\n</div>\n'},getStyles:function(){return"\n.__PREFIX__ptr {\n pointer-events: none;\n font-size: 0.85em;\n font-weight: bold;\n top: 0;\n height: 0;\n transition: height 0.3s, min-height 0.3s;\n text-align: center;\n width: 100%;\n overflow: hidden;\n display: flex;\n align-items: flex-end;\n align-content: stretch;\n}\n\n.__PREFIX__box {\n flex-basis: 100%;\n margin-top: -20px;\n}\n\n.__PREFIX__pull {\n transition: none;\n}\n\n/*\nWhen at the top of the page, disable vertical overscroll so passive touch\nlisteners can take over.\n*/\n.__PREFIX__top {\n touch-action: pan-x pan-down pinch-zoom;\n}\n"},onInit:function(){},onRefresh:function(){return location.reload()},resistanceFunction:function(e){return Math.min(1,e/2.5)},shouldPullToRefresh:function(){return!window.scrollY}},l=["mainElement","ptrElement","triggerElement"],o=function(t){var n={};return Object.keys(r).forEach((function(e){n[e]=t[e]||r[e]})),n.refreshTimeout="number"==typeof t.refreshTimeout?t.refreshTimeout:r.refreshTimeout,l.forEach((function(e){"string"==typeof n[e]&&(n[e]=document.querySelector(n[e]))})),e.events||(e.events=i()),n.contains=function(e){return n.triggerElement.contains(e)},n.destroy=function(){clearTimeout(e.timeout);var t=e.handlers.indexOf(n);e.handlers.splice(t,1)},n};return{setPassiveMode:function(t){e.passive=t},setPointerEventsMode:function(t){e.pointerEventsEnabled=t},destroyAll:function(){e.events&&(e.events.destroy(),e.events=null),e.handlers.forEach((function(e){e.destroy()}))},init:function(t){void 0===t&&(t={});var n=o(t);return e.handlers.push(n),n},_:{setupHandler:o,setupEvents:i,setupDOM:n.setupDOM,onReset:n.onReset,update:n.update}}}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "pull-update",
"version": "1.0.2",
"version": "1.0.3",
"description": "Pull To Refresh",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc