@react-hive/honey-layout 10.7.0 → 11.0.0

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.
@@ -7932,93 +7932,96 @@ function rectToClientRect(rect) {
7932
7932
  "use strict";
7933
7933
  __webpack_require__.r(__webpack_exports__);
7934
7934
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7935
- /* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */ ke),
7936
- /* harmony export */ applyInertiaStep: () => (/* binding */ Ae),
7935
+ /* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */ Ee),
7936
+ /* harmony export */ applyInertiaStep: () => (/* binding */ ke),
7937
7937
  /* harmony export */ assert: () => (/* binding */ t),
7938
- /* harmony export */ blobToFile: () => (/* binding */ pe),
7939
- /* harmony export */ calculateCenterOffset: () => (/* binding */ de),
7940
- /* harmony export */ calculateEuclideanDistance: () => (/* binding */ ee),
7941
- /* harmony export */ calculateMovingSpeed: () => (/* binding */ te),
7942
- /* harmony export */ calculatePercentage: () => (/* binding */ ne),
7938
+ /* harmony export */ blobToFile: () => (/* binding */ Me),
7939
+ /* harmony export */ calculateCenterOffset: () => (/* binding */ ge),
7940
+ /* harmony export */ calculateEuclideanDistance: () => (/* binding */ re),
7941
+ /* harmony export */ calculateMovingSpeed: () => (/* binding */ le),
7942
+ /* harmony export */ calculatePercentage: () => (/* binding */ ae),
7943
7943
  /* harmony export */ camelToDashCase: () => (/* binding */ Z),
7944
7944
  /* harmony export */ camelToWords: () => (/* binding */ G),
7945
- /* harmony export */ centerElementInContainer: () => (/* binding */ me),
7945
+ /* harmony export */ centerElementInContainer: () => (/* binding */ we),
7946
7946
  /* harmony export */ chunk: () => (/* binding */ O),
7947
- /* harmony export */ cloneBlob: () => (/* binding */ ae),
7948
- /* harmony export */ compact: () => (/* binding */ A),
7949
- /* harmony export */ compose: () => (/* binding */ X),
7950
- /* harmony export */ definedProps: () => (/* binding */ Se),
7951
- /* harmony export */ delay: () => (/* binding */ U),
7952
- /* harmony export */ difference: () => (/* binding */ E),
7953
- /* harmony export */ downloadFile: () => (/* binding */ se),
7947
+ /* harmony export */ cloneBlob: () => (/* binding */ oe),
7948
+ /* harmony export */ compact: () => (/* binding */ v),
7949
+ /* harmony export */ compose: () => (/* binding */ E),
7950
+ /* harmony export */ definedProps: () => (/* binding */ Ae),
7951
+ /* harmony export */ delay: () => (/* binding */ H),
7952
+ /* harmony export */ difference: () => (/* binding */ C),
7953
+ /* harmony export */ downloadFile: () => (/* binding */ fe),
7954
7954
  /* harmony export */ everyAsync: () => (/* binding */ I),
7955
- /* harmony export */ fileListToFiles: () => (/* binding */ ge),
7956
- /* harmony export */ filterParallel: () => (/* binding */ j),
7957
- /* harmony export */ filterSequential: () => (/* binding */ N),
7958
- /* harmony export */ findAsync: () => (/* binding */ H),
7959
- /* harmony export */ getDOMRectIntersectionRatio: () => (/* binding */ Me),
7960
- /* harmony export */ getElementOffsetRect: () => (/* binding */ le),
7961
- /* harmony export */ getFocusableHtmlElements: () => (/* binding */ Te),
7962
- /* harmony export */ getLocalStorageCapabilities: () => (/* binding */ Pe),
7963
- /* harmony export */ getXOverflowWidth: () => (/* binding */ ue),
7964
- /* harmony export */ getYOverflowHeight: () => (/* binding */ he),
7965
- /* harmony export */ hasXOverflow: () => (/* binding */ ce),
7966
- /* harmony export */ hasYOverflow: () => (/* binding */ fe),
7967
- /* harmony export */ hashString: () => (/* binding */ re),
7955
+ /* harmony export */ fileListToFiles: () => (/* binding */ xe),
7956
+ /* harmony export */ filterParallel: () => (/* binding */ N),
7957
+ /* harmony export */ filterSequential: () => (/* binding */ j),
7958
+ /* harmony export */ findAsync: () => (/* binding */ $),
7959
+ /* harmony export */ findCharIndices: () => (/* binding */ Q),
7960
+ /* harmony export */ forEachChar: () => (/* binding */ ee),
7961
+ /* harmony export */ getDOMRectIntersectionRatio: () => (/* binding */ Ce),
7962
+ /* harmony export */ getElementOffsetRect: () => (/* binding */ se),
7963
+ /* harmony export */ getFocusableHtmlElements: () => (/* binding */ Xe),
7964
+ /* harmony export */ getLocalStorageCapabilities: () => (/* binding */ Le),
7965
+ /* harmony export */ getWordsInitials: () => (/* binding */ te),
7966
+ /* harmony export */ getXOverflowWidth: () => (/* binding */ de),
7967
+ /* harmony export */ getYOverflowHeight: () => (/* binding */ ye),
7968
+ /* harmony export */ hasXOverflow: () => (/* binding */ he),
7969
+ /* harmony export */ hasYOverflow: () => (/* binding */ me),
7970
+ /* harmony export */ hashString: () => (/* binding */ ie),
7968
7971
  /* harmony export */ intersection: () => (/* binding */ k),
7969
- /* harmony export */ invokeIfFunction: () => (/* binding */ Q),
7970
- /* harmony export */ isAnchorHtmlElement: () => (/* binding */ ie),
7971
- /* harmony export */ isArray: () => (/* binding */ S),
7972
+ /* harmony export */ invokeIfFunction: () => (/* binding */ ne),
7973
+ /* harmony export */ isAnchorHtmlElement: () => (/* binding */ ce),
7974
+ /* harmony export */ isArray: () => (/* binding */ M),
7972
7975
  /* harmony export */ isBlob: () => (/* binding */ f),
7973
7976
  /* harmony export */ isBool: () => (/* binding */ o),
7974
- /* harmony export */ isContentEditableHtmlElement: () => (/* binding */ oe),
7977
+ /* harmony export */ isContentEditableHtmlElement: () => (/* binding */ ue),
7975
7978
  /* harmony export */ isDate: () => (/* binding */ u),
7976
7979
  /* harmony export */ isDecimal: () => (/* binding */ x),
7977
- /* harmony export */ isDefined: () => (/* binding */ a),
7978
- /* harmony export */ isEmptyArray: () => (/* binding */ v),
7980
+ /* harmony export */ isDefined: () => (/* binding */ l),
7981
+ /* harmony export */ isEmptyArray: () => (/* binding */ S),
7979
7982
  /* harmony export */ isEmptyObject: () => (/* binding */ c),
7980
7983
  /* harmony export */ isError: () => (/* binding */ h),
7981
- /* harmony export */ isFile: () => (/* binding */ we),
7984
+ /* harmony export */ isFile: () => (/* binding */ be),
7982
7985
  /* harmony export */ isFiniteNumber: () => (/* binding */ p),
7983
- /* harmony export */ isFunction: () => (/* binding */ P),
7984
- /* harmony export */ isHtmlElementFocusable: () => (/* binding */ Ee),
7986
+ /* harmony export */ isFunction: () => (/* binding */ X),
7987
+ /* harmony export */ isHtmlElementFocusable: () => (/* binding */ Te),
7985
7988
  /* harmony export */ isInteger: () => (/* binding */ b),
7986
- /* harmony export */ isLocalStorageReadable: () => (/* binding */ _e),
7989
+ /* harmony export */ isLocalStorageReadable: () => (/* binding */ ze),
7987
7990
  /* harmony export */ isMap: () => (/* binding */ y),
7988
7991
  /* harmony export */ isNil: () => (/* binding */ r),
7989
7992
  /* harmony export */ isNilOrEmptyString: () => (/* binding */ J),
7990
7993
  /* harmony export */ isNull: () => (/* binding */ n),
7991
7994
  /* harmony export */ isNumber: () => (/* binding */ i),
7992
7995
  /* harmony export */ isObject: () => (/* binding */ s),
7993
- /* harmony export */ isPromise: () => (/* binding */ Y),
7996
+ /* harmony export */ isPromise: () => (/* binding */ L),
7994
7997
  /* harmony export */ isRegExp: () => (/* binding */ m),
7995
- /* harmony export */ isSet: () => (/* binding */ w),
7998
+ /* harmony export */ isSet: () => (/* binding */ g),
7996
7999
  /* harmony export */ isString: () => (/* binding */ D),
7997
- /* harmony export */ isSymbol: () => (/* binding */ g),
7998
- /* harmony export */ isUndefined: () => (/* binding */ l),
8000
+ /* harmony export */ isSymbol: () => (/* binding */ w),
8001
+ /* harmony export */ isUndefined: () => (/* binding */ a),
7999
8002
  /* harmony export */ isValidDate: () => (/* binding */ d),
8000
- /* harmony export */ moveFocusWithinContainer: () => (/* binding */ Xe),
8001
- /* harmony export */ noop: () => (/* binding */ _),
8002
- /* harmony export */ not: () => (/* binding */ z),
8003
- /* harmony export */ once: () => (/* binding */ L),
8004
- /* harmony export */ parse2DMatrix: () => (/* binding */ ye),
8003
+ /* harmony export */ moveFocusWithinContainer: () => (/* binding */ _e),
8004
+ /* harmony export */ noop: () => (/* binding */ T),
8005
+ /* harmony export */ not: () => (/* binding */ _),
8006
+ /* harmony export */ once: () => (/* binding */ z),
8007
+ /* harmony export */ parse2DMatrix: () => (/* binding */ pe),
8005
8008
  /* harmony export */ parseFileName: () => (/* binding */ K),
8006
- /* harmony export */ pipe: () => (/* binding */ T),
8007
- /* harmony export */ readFilesFromDataTransfer: () => (/* binding */ xe),
8008
- /* harmony export */ reduceAsync: () => (/* binding */ $),
8009
- /* harmony export */ resolveAxisDelta: () => (/* binding */ Oe),
8010
- /* harmony export */ resolveBoundedDelta: () => (/* binding */ ve),
8009
+ /* harmony export */ pipe: () => (/* binding */ P),
8010
+ /* harmony export */ readFilesFromDataTransfer: () => (/* binding */ ve),
8011
+ /* harmony export */ reduceAsync: () => (/* binding */ U),
8012
+ /* harmony export */ resolveAxisDelta: () => (/* binding */ Pe),
8013
+ /* harmony export */ resolveBoundedDelta: () => (/* binding */ Oe),
8011
8014
  /* harmony export */ retry: () => (/* binding */ B),
8012
8015
  /* harmony export */ runParallel: () => (/* binding */ R),
8013
- /* harmony export */ runSequential: () => (/* binding */ C),
8016
+ /* harmony export */ runSequential: () => (/* binding */ Y),
8014
8017
  /* harmony export */ someAsync: () => (/* binding */ F),
8015
8018
  /* harmony export */ splitStringIntoWords: () => (/* binding */ q),
8016
8019
  /* harmony export */ timeout: () => (/* binding */ W),
8017
8020
  /* harmony export */ toKebabCase: () => (/* binding */ V),
8018
- /* harmony export */ traverseFileSystemDirectory: () => (/* binding */ be),
8019
- /* harmony export */ unique: () => (/* binding */ M)
8021
+ /* harmony export */ traverseFileSystemDirectory: () => (/* binding */ Se),
8022
+ /* harmony export */ unique: () => (/* binding */ A)
8020
8023
  /* harmony export */ });
8021
- var e={};function t(e,t){if(!e)throw new Error(t)}e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=e=>null===e,r=e=>null==e,a=e=>null!=e,l=e=>void 0===e,i=e=>"number"==typeof e,o=e=>"boolean"==typeof e,s=e=>"object"==typeof e,c=e=>s(e)&&!n(e)&&0===Object.keys(e).length,u=e=>e instanceof Date,f=e=>e instanceof Blob,h=e=>e instanceof Error,d=e=>u(e)&&!isNaN(e.getTime()),m=e=>e instanceof RegExp,y=e=>e instanceof Map,w=e=>e instanceof Set,g=e=>"symbol"==typeof e,p=e=>i(e)&&isFinite(e),b=e=>i(e)&&Number.isInteger(e),x=e=>p(e)&&!Number.isInteger(e),S=e=>Array.isArray(e),v=e=>S(e)&&0===e.length,A=e=>e.filter(Boolean),M=e=>[...new Set(e)],O=(e,n)=>(t(n>0,"Chunk size must be greater than 0"),Array.from({length:Math.ceil(e.length/n)},(t,r)=>e.slice(r*n,(r+1)*n))),k=(...e)=>{if(0===e.length)return[];if(1===e.length)return[...e[0]];const[t,...n]=e;return M(t).filter(e=>n.every(t=>t.includes(e)))},E=(e,t)=>e.filter(e=>!t.includes(e)),T=(...e)=>t=>e.reduce((e,t)=>t(e),t),X=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),_=()=>{},P=e=>"function"==typeof e,z=e=>(...t)=>!e(...t),L=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},Y=e=>P(e?.then),C=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(await t(e[r],r,e));return n},R=async(e,t)=>Promise.all(e.map(t)),N=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const a=e[r];await t(a,r,e)&&n.push(a)}return n},j=async(e,t)=>{const n=await R(e,async(e,n,r)=>!!await t(e,n,r)&&e);return A(n)},F=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return!0;return!1},I=async(e,t)=>{for(let n=0;n<e.length;n++)if(!await t(e[n],n,e))return!1;return!0},$=async(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++)r=await t(r,e[n],n,e);return r},H=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return e[n];return null},U=e=>new Promise(t=>setTimeout(t,e)),W=async(e,t,n="Operation timed out")=>{try{return await Promise.race([e,U(t).then(()=>Promise.reject(new Error(n)))])}finally{}},B=(e,{maxAttempts:t=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...l)=>{let i;for(let o=1;o<=t;o++)try{return await e(...l)}catch(e){if(i=e,o<t){a?.(o,e);const t=r?n*2**(o-1):n;await U(t)}}throw i},D=e=>"string"==typeof e,V=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Z=e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)},G=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),q=e=>e.split(" ").filter(Boolean),J=e=>""===e||r(e),K=e=>{const t=e.lastIndexOf(".");return t<=0||t===e.length-1?[e,""]:[e.slice(0,t),e.slice(t+1).toLowerCase()]},Q=(e,...t)=>"function"==typeof e?e(...t):e,ee=(e,t,n,r)=>{const a=n-e,l=r-t;return Math.hypot(a,l)},te=(e,t)=>Math.abs(e/t),ne=(e,t)=>e*t/100,re=e=>{let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)},ae=e=>new Blob([e],{type:e.type}),le=e=>new DOMRect(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight),ie=e=>"A"===e.tagName,oe=e=>"true"===e.getAttribute("contenteditable"),se=(e,{fileName:n,target:r}={})=>{if(l(document))return;const a=document.createElement("a");let i=null;try{const t=D(e)?e:i=URL.createObjectURL(e);a.href=t,n&&(a.download=n),r&&(a.target=r),document.body.appendChild(a),a.click()}finally{a.remove(),i&&setTimeout(()=>{t(i,"Object URL should not be null"),URL.revokeObjectURL(i)},0)}},ce=e=>e.scrollWidth>e.clientWidth,ue=e=>Math.max(0,e.scrollWidth-e.clientWidth),fe=e=>e.scrollHeight>e.clientHeight,he=e=>Math.max(0,e.scrollHeight-e.clientHeight),de=({overflowSize:e,containerSize:t,elementOffset:n,elementSize:r})=>{if(e<=0)return 0;const a=n+r/2-t/2;return-Math.max(0,Math.min(a,e))},me=(e,t,{axis:n="both"}={})=>{let r=0,a=0;"x"!==n&&"both"!==n||(r=de({overflowSize:ue(e),containerSize:e.clientWidth,elementOffset:t.offsetLeft,elementSize:t.clientWidth})),"y"!==n&&"both"!==n||(a=de({overflowSize:he(e),containerSize:e.clientHeight,elementOffset:t.offsetTop,elementSize:t.clientHeight})),e.style.transform=`translate(${r}px, ${a}px)`},ye=e=>{const t=window.getComputedStyle(e).getPropertyValue("transform").match(/^matrix\((.+)\)$/);if(!t)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,l,i,o]=t[1].split(", ").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:l,skewX:a,skewY:r}},we=e=>e instanceof File,ge=e=>{if(!e)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},pe=(e,t)=>new File([e],t,{type:e.type}),be=async(e,{skipFiles:t=[".DS_Store","Thumbs.db","desktop.ini","ehthumbs.db",".Spotlight-V100",".Trashes",".fseventsd","__MACOSX"]}={})=>{const n=new Set(t),r=await(async e=>{const t=e.createReader(),n=async()=>new Promise((e,r)=>{t.readEntries(async t=>{if(t.length)try{const r=await n();e([...t,...r])}catch(e){r(e)}else e([])},r)});return n()})(e);return(await R(r,async e=>e.isDirectory?be(e,{skipFiles:t}):n.has(e.name)?[]:[await new Promise((t,n)=>{e.file(t,n)})])).flat()},xe=async(e,t={})=>{const n=e?.items;if(!n)return[];const r=[];for(let e=0;e<n.length;e++){const a=n[e];if("webkitGetAsEntry"in a){const e=a.webkitGetAsEntry?.();if(e?.isDirectory){r.push(be(e,t));continue}if(e?.isFile){r.push(new Promise((t,n)=>e.file(e=>t([e]),n)));continue}}const l=a.getAsFile();l&&r.push(Promise.resolve([l]))}return(await Promise.all(r)).flat()},Se=e=>Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}),ve=({delta:e,value:t,min:n,max:r})=>{if(0===e)return null;const a=t+e;return e<0?t<=n?null:Math.max(a,n):e>0?t>=r?null:Math.min(a,r):null},Ae=({value:e,min:t,max:n,velocity:r,deltaTime:a,friction:l=.002,minVelocity:i=.01})=>{if(Math.abs(r)<i)return null;const o=ve({delta:r*a,value:e,min:t,max:n});return null===o?null:{value:o,velocity:r*Math.exp(-l*a)}},Me=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height),Oe=(e,t,{allowFallback:n=!0,invert:r=!0}={})=>{const a=r?-1:1;switch(t){case"x":return{deltaX:a*(0!==e.deltaX?e.deltaX:n?e.deltaY:0),deltaY:0};case"y":return{deltaX:0,deltaY:a*e.deltaY};default:return{deltaX:a*e.deltaX,deltaY:a*e.deltaY}}},ke=["INPUT","SELECT","TEXTAREA","BUTTON","A"],Ee=e=>{if(!e)return!1;const t=window.getComputedStyle(e);if("hidden"===t.visibility||"none"===t.display)return!1;if("disabled"in e&&e.disabled)return!1;const n=e.getAttribute("tabindex");return"-1"!==n&&(ke.includes(e.tagName)?!ie(e)||""!==e.href:!!oe(e)||null!==n)},Te=e=>Array.from(e.querySelectorAll("*")).filter(Ee),Xe=(e,t=null,{wrap:n=!0,getNextIndex:r}={})=>{const a=document.activeElement,l=t??a?.parentElement;if(!a||!l)return;const i=Te(l);if(0===i.length)return;const o=i.indexOf(a);if(-1===o)return;let s;r?s=r(o,e,i):"next"===e?(s=o+1,s>=i.length&&(s=n?0:null)):(s=o-1,s<0&&(s=n?i.length-1:null)),null!==s&&i[s]?.focus()},_e=()=>{if("undefined"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem("__non_existing_key__"),!0}catch{return!1}},Pe=()=>{if(!_e())return{readable:!1,writable:!1};try{const e="__test_write__";return window.localStorage.setItem(e,"1"),window.localStorage.removeItem(e),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}};
8024
+ var e={};function t(e,t){if(!e)throw new Error(t)}e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=e=>null===e,r=e=>null==e,l=e=>null!=e,a=e=>void 0===e,i=e=>"number"==typeof e,o=e=>"boolean"==typeof e,s=e=>"object"==typeof e,c=e=>s(e)&&!n(e)&&0===Object.keys(e).length,u=e=>e instanceof Date,f=e=>e instanceof Blob,h=e=>e instanceof Error,d=e=>u(e)&&!isNaN(e.getTime()),m=e=>e instanceof RegExp,y=e=>e instanceof Map,g=e=>e instanceof Set,w=e=>"symbol"==typeof e,p=e=>i(e)&&isFinite(e),b=e=>i(e)&&Number.isInteger(e),x=e=>p(e)&&!Number.isInteger(e),M=e=>Array.isArray(e),S=e=>M(e)&&0===e.length,v=e=>e.filter(Boolean),A=e=>[...new Set(e)],O=(e,n)=>(t(n>0,"Chunk size must be greater than 0"),Array.from({length:Math.ceil(e.length/n)},(t,r)=>e.slice(r*n,(r+1)*n))),k=(...e)=>{if(0===e.length)return[];if(1===e.length)return[...e[0]];const[t,...n]=e;return A(t).filter(e=>n.every(t=>t.includes(e)))},C=(e,t)=>e.filter(e=>!t.includes(e)),P=(...e)=>t=>e.reduce((e,t)=>t(e),t),E=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),T=()=>{},X=e=>"function"==typeof e,_=e=>(...t)=>!e(...t),z=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},L=e=>X(e?.then),Y=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(await t(e[r],r,e));return n},R=async(e,t)=>Promise.all(e.map(t)),j=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const l=e[r];await t(l,r,e)&&n.push(l)}return n},N=async(e,t)=>{const n=await R(e,async(e,n,r)=>!!await t(e,n,r)&&e);return v(n)},F=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return!0;return!1},I=async(e,t)=>{for(let n=0;n<e.length;n++)if(!await t(e[n],n,e))return!1;return!0},U=async(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++)r=await t(r,e[n],n,e);return r},$=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return e[n];return null},H=e=>new Promise(t=>setTimeout(t,e)),W=async(e,t,n="Operation timed out")=>{try{return await Promise.race([e,H(t).then(()=>Promise.reject(new Error(n)))])}finally{}},B=(e,{maxAttempts:t=3,delayMs:n=300,backoff:r=!0,onRetry:l}={})=>async(...a)=>{let i;for(let o=1;o<=t;o++)try{return await e(...a)}catch(e){if(i=e,o<t){l?.(o,e);const t=r?n*2**(o-1):n;await H(t)}}throw i},D=e=>"string"==typeof e,V=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Z=e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)},G=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),q=e=>0===e.length?[]:e.split(" ").filter(Boolean),J=e=>""===e||r(e),K=e=>{const t=e.lastIndexOf(".");return t<=0||t===e.length-1?[e,""]:[e.slice(0,t),e.slice(t+1).toLowerCase()]},Q=(e,t)=>{if(0===e.length)return[];const n=t.charCodeAt(0),r=[];for(let t=0;t<e.length;t++)e.charCodeAt(t)===n&&r.push(t);return r},ee=(e,t,n)=>{if(0===e.length)return;const r=e.length;for(let l=0;l<r;l++){const a=e[l],i={charIndex:l,prevChar:l>0?e[l-1]:null,nextChar:l<r-1?e[l+1]:null};n?.(a,i)||t(a,i)}},te=(e,t=1/0)=>0===e.length?"":q(e).slice(0,t).map(e=>e[0]).join("").toUpperCase(),ne=(e,...t)=>"function"==typeof e?e(...t):e,re=(e,t,n,r)=>{const l=n-e,a=r-t;return Math.hypot(l,a)},le=(e,t)=>Math.abs(e/t),ae=(e,t)=>e*t/100,ie=e=>{let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)},oe=e=>new Blob([e],{type:e.type}),se=e=>new DOMRect(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight),ce=e=>"A"===e.tagName,ue=e=>"true"===e.getAttribute("contenteditable"),fe=(e,{fileName:n,target:r}={})=>{if(a(document))return;const l=document.createElement("a");let i=null;try{const t=D(e)?e:i=URL.createObjectURL(e);l.href=t,n&&(l.download=n),r&&(l.target=r),document.body.appendChild(l),l.click()}finally{l.remove(),i&&setTimeout(()=>{t(i,"Object URL should not be null"),URL.revokeObjectURL(i)},0)}},he=e=>e.scrollWidth>e.clientWidth,de=e=>Math.max(0,e.scrollWidth-e.clientWidth),me=e=>e.scrollHeight>e.clientHeight,ye=e=>Math.max(0,e.scrollHeight-e.clientHeight),ge=({overflowSize:e,containerSize:t,elementOffset:n,elementSize:r})=>{if(e<=0)return 0;const l=n+r/2-t/2;return-Math.max(0,Math.min(l,e))},we=(e,t,{axis:n="both"}={})=>{let r=0,l=0;"x"!==n&&"both"!==n||(r=ge({overflowSize:de(e),containerSize:e.clientWidth,elementOffset:t.offsetLeft,elementSize:t.clientWidth})),"y"!==n&&"both"!==n||(l=ge({overflowSize:ye(e),containerSize:e.clientHeight,elementOffset:t.offsetTop,elementSize:t.clientHeight})),e.style.transform=`translate(${r}px, ${l}px)`},pe=e=>{const t=window.getComputedStyle(e).getPropertyValue("transform").match(/^matrix\((.+)\)$/);if(!t)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,l,a,i,o]=t[1].split(", ").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:a,skewX:l,skewY:r}},be=e=>e instanceof File,xe=e=>{if(!e)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},Me=(e,t)=>new File([e],t,{type:e.type}),Se=async(e,{skipFiles:t=[".DS_Store","Thumbs.db","desktop.ini","ehthumbs.db",".Spotlight-V100",".Trashes",".fseventsd","__MACOSX"]}={})=>{const n=new Set(t),r=await(async e=>{const t=e.createReader(),n=async()=>new Promise((e,r)=>{t.readEntries(async t=>{if(t.length)try{const r=await n();e([...t,...r])}catch(e){r(e)}else e([])},r)});return n()})(e);return(await R(r,async e=>e.isDirectory?Se(e,{skipFiles:t}):n.has(e.name)?[]:[await new Promise((t,n)=>{e.file(t,n)})])).flat()},ve=async(e,t={})=>{const n=e?.items;if(!n)return[];const r=[];for(let e=0;e<n.length;e++){const l=n[e];if("webkitGetAsEntry"in l){const e=l.webkitGetAsEntry?.();if(e?.isDirectory){r.push(Se(e,t));continue}if(e?.isFile){r.push(new Promise((t,n)=>e.file(e=>t([e]),n)));continue}}const a=l.getAsFile();a&&r.push(Promise.resolve([a]))}return(await Promise.all(r)).flat()},Ae=e=>Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}),Oe=({delta:e,value:t,min:n,max:r})=>{if(0===e)return null;const l=t+e;return e<0?t<=n?null:Math.max(l,n):e>0?t>=r?null:Math.min(l,r):null},ke=({value:e,min:t,max:n,velocityPxMs:r,deltaTimeMs:l,friction:a=.002,minVelocityPxMs:i=.01})=>{if(Math.abs(r)<i)return null;const o=Oe({delta:r*l,value:e,min:t,max:n});return null===o?null:{value:o,velocityPxMs:r*Math.exp(-a*l)}},Ce=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height),Pe=(e,t,{allowFallback:n=!0,invert:r=!0}={})=>{const l=r?-1:1;switch(t){case"x":return{deltaX:l*(0!==e.deltaX?e.deltaX:n?e.deltaY:0),deltaY:0};case"y":return{deltaX:0,deltaY:l*e.deltaY};default:return{deltaX:l*e.deltaX,deltaY:l*e.deltaY}}},Ee=["INPUT","SELECT","TEXTAREA","BUTTON","A"],Te=e=>{if(!e)return!1;const t=window.getComputedStyle(e);if("hidden"===t.visibility||"none"===t.display)return!1;if("disabled"in e&&e.disabled)return!1;const n=e.getAttribute("tabindex");return"-1"!==n&&(Ee.includes(e.tagName)?!ce(e)||""!==e.href:!!ue(e)||null!==n)},Xe=e=>Array.from(e.querySelectorAll("*")).filter(Te),_e=(e,t=null,{wrap:n=!0,getNextIndex:r}={})=>{const l=document.activeElement,a=t??l?.parentElement;if(!l||!a)return;const i=Xe(a);if(0===i.length)return;const o=i.indexOf(l);if(-1===o)return;let s;r?s=r(o,e,i):"next"===e?(s=o+1,s>=i.length&&(s=n?0:null)):(s=o-1,s<0&&(s=n?i.length-1:null)),null!==s&&i[s]?.focus()},ze=()=>{if("undefined"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem("__non_existing_key__"),!0}catch{return!1}},Le=()=>{if(!ze())return{readable:!1,writable:!1};try{const e="__test_write__";return window.localStorage.setItem(e,"1"),window.localStorage.removeItem(e),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}};
8022
8025
  //# sourceMappingURL=index.mjs.map
8023
8026
 
8024
8027
  /***/ },
@@ -13719,6 +13722,7 @@ const mergeRefs = (...refs) => value => {
13719
13722
  __webpack_require__.r(__webpack_exports__);
13720
13723
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13721
13724
  /* harmony export */ resolveAxisTranslate: () => (/* reexport safe */ _use_honey_synthetic_scroll__WEBPACK_IMPORTED_MODULE_8__.resolveAxisTranslate),
13725
+ /* harmony export */ useHoneyDecay: () => (/* reexport safe */ _use_honey_decay__WEBPACK_IMPORTED_MODULE_13__.useHoneyDecay),
13722
13726
  /* harmony export */ useHoneyDocumentKeyUpHandler: () => (/* reexport safe */ _use_honey_document_key_up_handler__WEBPACK_IMPORTED_MODULE_3__.useHoneyDocumentKeyUpHandler),
13723
13727
  /* harmony export */ useHoneyDrag: () => (/* reexport safe */ _use_honey_drag__WEBPACK_IMPORTED_MODULE_2__.useHoneyDrag),
13724
13728
  /* harmony export */ useHoneyLayout: () => (/* reexport safe */ _use_honey_layout__WEBPACK_IMPORTED_MODULE_4__.useHoneyLayout),
@@ -13746,6 +13750,7 @@ __webpack_require__.r(__webpack_exports__);
13746
13750
  /* harmony import */ var _use_honey_synthetic_scroll_y__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./use-honey-synthetic-scroll-y */ "./src/hooks/use-honey-synthetic-scroll-y.ts");
13747
13751
  /* harmony import */ var _use_honey_raf_loop__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./use-honey-raf-loop */ "./src/hooks/use-honey-raf-loop.ts");
13748
13752
  /* harmony import */ var _use_honey_timer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./use-honey-timer */ "./src/hooks/use-honey-timer.ts");
13753
+ /* harmony import */ var _use_honey_decay__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./use-honey-decay */ "./src/hooks/use-honey-decay.ts");
13749
13754
 
13750
13755
 
13751
13756
 
@@ -13761,6 +13766,134 @@ __webpack_require__.r(__webpack_exports__);
13761
13766
 
13762
13767
 
13763
13768
 
13769
+
13770
+ /***/ },
13771
+
13772
+ /***/ "./src/hooks/use-honey-decay.ts"
13773
+ /*!**************************************!*\
13774
+ !*** ./src/hooks/use-honey-decay.ts ***!
13775
+ \**************************************/
13776
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13777
+
13778
+ "use strict";
13779
+ __webpack_require__.r(__webpack_exports__);
13780
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13781
+ /* harmony export */ useHoneyDecay: () => (/* binding */ useHoneyDecay)
13782
+ /* harmony export */ });
13783
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13784
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13785
+ /* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
13786
+ /* harmony import */ var _use_honey_raf_loop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./use-honey-raf-loop */ "./src/hooks/use-honey-raf-loop.ts");
13787
+
13788
+
13789
+
13790
+ /**
13791
+ * A bounded, velocity-based inertia (decay) hook built on top of {@link useHoneyRafLoop} and {@link applyInertiaStep}.
13792
+ *
13793
+ * This hook models **momentum-driven motion** where:
13794
+ * - Motion starts with an initial velocity
13795
+ * - Velocity decays exponentially over time
13796
+ * - Movement is constrained by hard numeric bounds
13797
+ * - Inertia stops naturally when velocity becomes negligible
13798
+ *
13799
+ * Unlike spring-based motion, this hook has **no target value**.
13800
+ * Motion continues purely based on momentum until it decays
13801
+ * or is blocked by a boundary.
13802
+ *
13803
+ * ---
13804
+ *
13805
+ * ### Key characteristics
13806
+ * - Frame-rate independent (delta-time based)
13807
+ * - Deterministic and interruptible
13808
+ * - Direction-aware and bound-safe (no overshoot or jitter)
13809
+ * - Closely matches native scroll and drag inertia behavior
13810
+ *
13811
+ * ---
13812
+ *
13813
+ * ### Visibility behavior
13814
+ * This hook is a **simulation-based system**:
13815
+ * - Inertia automatically pauses when the document becomes hidden
13816
+ * - No time elapses while hidden
13817
+ * - Motion resumes only when explicitly restarted
13818
+ *
13819
+ * This behavior is inherited from {@link useHoneyRafLoop} and is intentional.
13820
+ *
13821
+ * ---
13822
+ *
13823
+ * ### Common use cases
13824
+ * - Scroll containers with momentum
13825
+ * - Drag-to-scroll interactions
13826
+ * - Carousels and sliders
13827
+ * - Timelines and scrubbers
13828
+ * - Kinetic panning and flinging
13829
+ *
13830
+ * ---
13831
+ *
13832
+ * @example
13833
+ * ```ts
13834
+ * const decay = useHoneyDecay({
13835
+ * initialValue: 0,
13836
+ * min: -maxOverflow,
13837
+ * max: 0,
13838
+ * });
13839
+ *
13840
+ * const onRelease = (velocityPxMs: number) => {
13841
+ * decay.start(velocityPxMs);
13842
+ * };
13843
+ *
13844
+ * return (
13845
+ * <div style={{ transform: `translateX(${decay.value}px)` }} />
13846
+ * );
13847
+ * ```
13848
+ */
13849
+ const useHoneyDecay = ({ initialValue, min, max, friction, minVelocityPxMs, }) => {
13850
+ const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialValue);
13851
+ const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(initialValue);
13852
+ const velocityPxMsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0);
13853
+ const onFrameHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((deltaTimeMs, frameContext) => {
13854
+ const result = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.applyInertiaStep)({
13855
+ value: valueRef.current,
13856
+ velocityPxMs: velocityPxMsRef.current,
13857
+ min,
13858
+ max,
13859
+ deltaTimeMs,
13860
+ friction,
13861
+ minVelocityPxMs,
13862
+ });
13863
+ if (!result) {
13864
+ velocityPxMsRef.current = 0;
13865
+ frameContext.stop();
13866
+ return;
13867
+ }
13868
+ valueRef.current = result.value;
13869
+ velocityPxMsRef.current = result.velocityPxMs;
13870
+ setValue(result.value);
13871
+ }, [min, max, friction, minVelocityPxMs]);
13872
+ const rafLoop = (0,_use_honey_raf_loop__WEBPACK_IMPORTED_MODULE_2__.useHoneyRafLoop)(onFrameHandler);
13873
+ const start = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((velocityPxMs) => {
13874
+ velocityPxMsRef.current = velocityPxMs;
13875
+ rafLoop.start();
13876
+ }, [rafLoop.start]);
13877
+ const stop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
13878
+ velocityPxMsRef.current = 0;
13879
+ rafLoop.stop();
13880
+ }, [rafLoop.stop]);
13881
+ const snapTo = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((nextValue) => {
13882
+ velocityPxMsRef.current = 0;
13883
+ valueRef.current = nextValue;
13884
+ rafLoop.stop();
13885
+ setValue(nextValue);
13886
+ }, [rafLoop.stop]);
13887
+ return {
13888
+ value,
13889
+ isRunning: rafLoop.isRunning,
13890
+ start,
13891
+ stop,
13892
+ snapTo,
13893
+ };
13894
+ };
13895
+
13896
+
13764
13897
  /***/ },
13765
13898
 
13766
13899
  /***/ "./src/hooks/use-honey-document-key-up-handler.ts"
@@ -13834,21 +13967,25 @@ __webpack_require__.r(__webpack_exports__);
13834
13967
  /* harmony export */ });
13835
13968
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13836
13969
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13837
- /* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/@react-hive/honey-utils/dist/index.mjs");
13838
-
13839
13970
 
13840
13971
  /**
13841
- * A hook that provides touch and mouse-based dragging functionality for an element.
13842
- * It enables the ability to drag an element on both mouse and touch interfaces,
13843
- * with customizable handlers for different stages of the drag.
13972
+ * Enables high-precision mouse and touch dragging for an element.
13973
+ *
13974
+ * This hook:
13975
+ * - Tracks pointer movement using `performance.now()`
13976
+ * - Computes **instantaneous release velocity** (px/ms)
13977
+ * - Emits deterministic drag lifecycle events
13978
+ * - Supports both mouse and touch input
13844
13979
  *
13845
- * @template Element - The type of the HTML element that is being dragged.
13980
+ * Architectural notes:
13981
+ * - Velocity is computed **during movement**, not at drag end
13982
+ * - Release velocity is suitable for inertia / decay systems
13983
+ * - No layout reads or writes are performed internally
13846
13984
  *
13847
- * @param draggableElementRef - A reference to the element that can be dragged.
13848
- * @param options - Handlers for different stages of the drag operation and configuration options
13849
- * for controlling drag behavior.
13985
+ * @template Element - The draggable HTML element type.
13850
13986
  *
13851
- * @returns A cleanup function to remove event listeners when the component is unmounted.
13987
+ * @param draggableElementRef - Ref pointing to the draggable element.
13988
+ * @param options - Drag lifecycle handlers and configuration flags.
13852
13989
  */
13853
13990
  const useHoneyDrag = (draggableElementRef, { skipOnEndDragWhenStopped = false, enabled = true, onMoveDrag, onStartDrag, onEndDrag, }) => {
13854
13991
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
@@ -13862,19 +13999,22 @@ const useHoneyDrag = (draggableElementRef, { skipOnEndDragWhenStopped = false, e
13862
13999
  let startY = 0;
13863
14000
  let lastX = 0;
13864
14001
  let lastY = 0;
13865
- // Store the start time of the drag to calculate speed later.
13866
- let startTime = 0;
14002
+ let lastMoveTimeMs = 0;
14003
+ let velocityXPxMs = 0;
14004
+ let velocityYPxMs = 0;
13867
14005
  const startDrag = async (clientX, clientY, e) => {
13868
14006
  if (onStartDrag && !(await onStartDrag(draggableElement, e))) {
13869
14007
  // Exit when `onStartDrag` returns false, preventing the dragging
13870
14008
  return;
13871
14009
  }
14010
+ lastMoveTimeMs = performance.now();
13872
14011
  isDragging = true;
13873
14012
  startX = clientX;
13874
14013
  startY = clientY;
13875
14014
  lastX = clientX;
13876
14015
  lastY = clientY;
13877
- startTime = Date.now();
14016
+ velocityXPxMs = 0;
14017
+ velocityYPxMs = 0;
13878
14018
  };
13879
14019
  const stopDrag = async (isTriggerOnEndDrag, e) => {
13880
14020
  if (!isDragging) {
@@ -13882,19 +14022,13 @@ const useHoneyDrag = (draggableElementRef, { skipOnEndDragWhenStopped = false, e
13882
14022
  }
13883
14023
  isDragging = false;
13884
14024
  if (isTriggerOnEndDrag && onEndDrag) {
13885
- // Calculate the elapsed time for speed calculations.
13886
- const elapsedTime = Date.now() - startTime;
13887
14025
  const deltaX = lastX - startX;
13888
14026
  const deltaY = lastY - startY;
13889
14027
  const endContext = {
13890
14028
  deltaX,
13891
14029
  deltaY,
13892
- get movingSpeedX() {
13893
- return (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.calculateMovingSpeed)(deltaX, elapsedTime);
13894
- },
13895
- get movingSpeedY() {
13896
- return (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.calculateMovingSpeed)(deltaY, elapsedTime);
13897
- },
14030
+ velocityXPxMs,
14031
+ velocityYPxMs,
13898
14032
  };
13899
14033
  await onEndDrag(endContext, draggableElement, e);
13900
14034
  }
@@ -13914,21 +14048,28 @@ const useHoneyDrag = (draggableElementRef, { skipOnEndDragWhenStopped = false, e
13914
14048
  if (!isDragging) {
13915
14049
  return;
13916
14050
  }
13917
- const moveContext = {
13918
- deltaX: clientX - lastX,
13919
- deltaY: clientY - lastY,
13920
- distanceX: clientX - startX,
13921
- distanceY: clientY - startY,
13922
- euclideanDistance: (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.calculateEuclideanDistance)(startX, startY, clientX, clientY),
13923
- };
13924
- if (!(await onMove(moveContext))) {
13925
- lastX = clientX;
13926
- lastY = clientY;
13927
- await releaseDrag(!skipOnEndDragWhenStopped, e);
13928
- return;
14051
+ const nowMs = performance.now();
14052
+ const deltaTimeMs = nowMs - lastMoveTimeMs;
14053
+ const deltaX = clientX - lastX;
14054
+ const deltaY = clientY - lastY;
14055
+ if (deltaTimeMs > 0) {
14056
+ velocityXPxMs = deltaX / deltaTimeMs;
14057
+ velocityYPxMs = deltaY / deltaTimeMs;
13929
14058
  }
14059
+ const distanceX = clientX - startX;
14060
+ const distanceY = clientY - startY;
14061
+ const isContinue = await onMove({
14062
+ deltaX,
14063
+ deltaY,
14064
+ distanceX,
14065
+ distanceY,
14066
+ });
13930
14067
  lastX = clientX;
13931
14068
  lastY = clientY;
14069
+ lastMoveTimeMs = nowMs;
14070
+ if (!isContinue) {
14071
+ await releaseDrag(!skipOnEndDragWhenStopped, e);
14072
+ }
13932
14073
  };
13933
14074
  const mouseMoveHandler = async (e) => {
13934
14075
  await moveHandler(e.clientX, e.clientY, e);
@@ -14194,7 +14335,7 @@ __webpack_require__.r(__webpack_exports__);
14194
14335
  *
14195
14336
  * Features:
14196
14337
  * - Explicit RAF lifecycle control (`start` / `stop`)
14197
- * - Delta time (`dt`) calculation with frame clamping
14338
+ * - Delta time calculation with frame clamping
14198
14339
  * - Automatic cleanup on unmounting
14199
14340
  * - Conservative handling of tab visibility changes (mobile-safe)
14200
14341
  * - Safe error handling (stops loop on exception)
@@ -14248,7 +14389,7 @@ onError, } = {}) => {
14248
14389
  const onFrameRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(onFrame);
14249
14390
  // Always keep the latest callback without restarting RAF
14250
14391
  onFrameRef.current = onFrame;
14251
- const [isRafLoopRunning, setIsRafLoopRunning] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
14392
+ const [isRunning, setIsRunning] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
14252
14393
  const loop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(timeMs => {
14253
14394
  if (lastTimeMsRef.current === null) {
14254
14395
  lastTimeMsRef.current = timeMs;
@@ -14261,57 +14402,57 @@ onError, } = {}) => {
14261
14402
  }
14262
14403
  try {
14263
14404
  onFrameRef.current(deltaTimeMs, {
14264
- stopRafLoop,
14405
+ stop,
14265
14406
  });
14266
14407
  rafIdRef.current = requestAnimationFrame(loop);
14267
14408
  }
14268
14409
  catch (e) {
14269
- stopRafLoop();
14410
+ stop();
14270
14411
  onError?.(e);
14271
14412
  }
14272
14413
  }, [maxDeltaMs, onError]);
14273
- const startRafLoop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14414
+ const start = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14274
14415
  if (rafIdRef.current !== null) {
14275
14416
  return;
14276
14417
  }
14277
14418
  lastTimeMsRef.current = null;
14278
- setIsRafLoopRunning(true);
14419
+ setIsRunning(true);
14279
14420
  rafIdRef.current = requestAnimationFrame(loop);
14280
14421
  }, [loop]);
14281
- const stopRafLoop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14422
+ const stop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14282
14423
  if (rafIdRef.current === null) {
14283
14424
  return;
14284
14425
  }
14285
14426
  cancelAnimationFrame(rafIdRef.current);
14286
14427
  rafIdRef.current = null;
14287
14428
  lastTimeMsRef.current = null;
14288
- setIsRafLoopRunning(false);
14429
+ setIsRunning(false);
14289
14430
  }, []);
14290
14431
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
14291
14432
  if (autoStart) {
14292
- startRafLoop();
14433
+ start();
14293
14434
  }
14294
- return stopRafLoop;
14295
- }, [autoStart, startRafLoop, stopRafLoop]);
14435
+ return stop;
14436
+ }, [autoStart, start, stop]);
14296
14437
  // Pause when a tab is hidden (important for mobile)
14297
14438
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
14298
14439
  const onVisibilityChange = () => {
14299
14440
  if (document.hidden) {
14300
- stopRafLoop();
14441
+ stop();
14301
14442
  }
14302
14443
  else if (resumeOnVisibility && autoStart) {
14303
- startRafLoop();
14444
+ start();
14304
14445
  }
14305
14446
  };
14306
14447
  document.addEventListener('visibilitychange', onVisibilityChange);
14307
14448
  return () => {
14308
14449
  document.removeEventListener('visibilitychange', onVisibilityChange);
14309
14450
  };
14310
- }, [autoStart, resumeOnVisibility, startRafLoop, stopRafLoop]);
14451
+ }, [autoStart, resumeOnVisibility, start, stop]);
14311
14452
  return {
14312
- isRafLoopRunning,
14313
- startRafLoop,
14314
- stopRafLoop,
14453
+ isRunning,
14454
+ start,
14455
+ stop,
14315
14456
  };
14316
14457
  };
14317
14458
 
@@ -14678,7 +14819,7 @@ const useHoneyTimer = ({ initialTimeMs, targetTimeMs = 0, mode = 'countdown', au
14678
14819
  * - Detects completion and stops the RAF loop
14679
14820
  * - Updates React state with the derived value
14680
14821
  */
14681
- const onFrameHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((deltaTimeMs, { stopRafLoop }) => {
14822
+ const onFrameHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((deltaTimeMs, frameContext) => {
14682
14823
  let nextTime = mode === 'countdown' ? timeRef.current - deltaTimeMs : timeRef.current + deltaTimeMs;
14683
14824
  let finished = false;
14684
14825
  if (mode === 'countdown') {
@@ -14694,43 +14835,41 @@ const useHoneyTimer = ({ initialTimeMs, targetTimeMs = 0, mode = 'countdown', au
14694
14835
  timeRef.current = nextTime;
14695
14836
  setTimeMs(nextTime);
14696
14837
  if (finished) {
14697
- stopRafLoop();
14838
+ frameContext.stop();
14698
14839
  onEndRef.current?.();
14699
14840
  }
14700
14841
  }, [mode, targetTimeMs]);
14701
- const { startRafLoop, stopRafLoop, isRafLoopRunning } = (0,_use_honey_raf_loop__WEBPACK_IMPORTED_MODULE_1__.useHoneyRafLoop)(onFrameHandler, {
14702
- autoStart,
14703
- });
14704
- const startTimer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14842
+ const rafLoop = (0,_use_honey_raf_loop__WEBPACK_IMPORTED_MODULE_1__.useHoneyRafLoop)(onFrameHandler);
14843
+ const start = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14705
14844
  timeRef.current = initialTimeMs;
14706
14845
  setTimeMs(initialTimeMs);
14707
- startRafLoop();
14708
- }, [initialTimeMs, startRafLoop]);
14709
- const pauseTimer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14710
- stopRafLoop();
14711
- }, [stopRafLoop]);
14712
- const resumeTimer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14713
- if (!isRafLoopRunning) {
14714
- startRafLoop();
14846
+ rafLoop.start();
14847
+ }, [initialTimeMs, rafLoop.start]);
14848
+ const pause = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14849
+ rafLoop.stop();
14850
+ }, [rafLoop.stop]);
14851
+ const resume = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
14852
+ if (!rafLoop.isRunning) {
14853
+ rafLoop.start();
14715
14854
  }
14716
- }, [isRafLoopRunning, startRafLoop]);
14717
- const resetTimer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((nextTimeMs = initialTimeMs) => {
14718
- stopRafLoop();
14855
+ }, [rafLoop.isRunning, rafLoop.start]);
14856
+ const reset = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((nextTimeMs = initialTimeMs) => {
14857
+ rafLoop.stop();
14719
14858
  timeRef.current = nextTimeMs;
14720
14859
  setTimeMs(nextTimeMs);
14721
- }, [initialTimeMs, stopRafLoop]);
14860
+ }, [initialTimeMs, rafLoop.stop]);
14722
14861
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
14723
14862
  if (autoStart) {
14724
- startTimer();
14863
+ start();
14725
14864
  }
14726
- }, [autoStart, startTimer]);
14865
+ }, [autoStart, start]);
14727
14866
  return {
14728
- timerTimeMs: timeMs,
14729
- isTimerRunning: isRafLoopRunning,
14730
- startTimer,
14731
- pauseTimer,
14732
- resumeTimer,
14733
- resetTimer,
14867
+ timeMs,
14868
+ isRunning: rafLoop.isRunning,
14869
+ start,
14870
+ pause,
14871
+ resume,
14872
+ reset,
14734
14873
  };
14735
14874
  };
14736
14875
 
@@ -15515,6 +15654,7 @@ __webpack_require__.r(__webpack_exports__);
15515
15654
  /* harmony export */ resolveScreenState: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_7__.resolveScreenState),
15516
15655
  /* harmony export */ resolveSpacing: () => (/* binding */ resolveSpacing),
15517
15656
  /* harmony export */ searchFlattenedItems: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.searchFlattenedItems),
15657
+ /* harmony export */ useHoneyDecay: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyDecay),
15518
15658
  /* harmony export */ useHoneyDocumentKeyUpHandler: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyDocumentKeyUpHandler),
15519
15659
  /* harmony export */ useHoneyDrag: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_5__.useHoneyDrag),
15520
15660
  /* harmony export */ useHoneyGridContext: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.useHoneyGridContext),