@kushagradhawan/kookie-ui 0.1.123 → 0.1.125

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.
Files changed (66) hide show
  1. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  2. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  3. package/dist/cjs/components/_internal/shell-bottom.js.map +2 -2
  4. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  5. package/dist/cjs/components/_internal/shell-handles.js.map +2 -2
  6. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  7. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  8. package/dist/cjs/components/_internal/shell-inspector.js.map +2 -2
  9. package/dist/cjs/components/_internal/shell-prop-helpers.js.map +2 -2
  10. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  11. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  12. package/dist/cjs/components/_internal/shell-sidebar.js.map +2 -2
  13. package/dist/cjs/components/combobox.d.ts.map +1 -1
  14. package/dist/cjs/components/combobox.js +1 -1
  15. package/dist/cjs/components/combobox.js.map +3 -3
  16. package/dist/cjs/components/shell.context.d.ts +2 -0
  17. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  18. package/dist/cjs/components/shell.context.js +1 -1
  19. package/dist/cjs/components/shell.context.js.map +2 -2
  20. package/dist/cjs/components/shell.d.ts.map +1 -1
  21. package/dist/cjs/components/shell.js +1 -1
  22. package/dist/cjs/components/shell.js.map +3 -3
  23. package/dist/cjs/components/shell.types.d.ts +11 -0
  24. package/dist/cjs/components/shell.types.d.ts.map +1 -1
  25. package/dist/cjs/components/shell.types.js +1 -1
  26. package/dist/cjs/components/shell.types.js.map +1 -1
  27. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  28. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  29. package/dist/esm/components/_internal/shell-bottom.js.map +2 -2
  30. package/dist/esm/components/_internal/shell-handles.js +1 -1
  31. package/dist/esm/components/_internal/shell-handles.js.map +2 -2
  32. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  33. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  34. package/dist/esm/components/_internal/shell-inspector.js.map +2 -2
  35. package/dist/esm/components/_internal/shell-prop-helpers.js.map +2 -2
  36. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  37. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  38. package/dist/esm/components/_internal/shell-sidebar.js.map +2 -2
  39. package/dist/esm/components/combobox.d.ts.map +1 -1
  40. package/dist/esm/components/combobox.js +1 -1
  41. package/dist/esm/components/combobox.js.map +3 -3
  42. package/dist/esm/components/shell.context.d.ts +2 -0
  43. package/dist/esm/components/shell.context.d.ts.map +1 -1
  44. package/dist/esm/components/shell.context.js.map +2 -2
  45. package/dist/esm/components/shell.d.ts.map +1 -1
  46. package/dist/esm/components/shell.js +1 -1
  47. package/dist/esm/components/shell.js.map +3 -3
  48. package/dist/esm/components/shell.types.d.ts +11 -0
  49. package/dist/esm/components/shell.types.d.ts.map +1 -1
  50. package/dist/esm/components/shell.types.js.map +1 -1
  51. package/package.json +1 -1
  52. package/schemas/base-button.json +1 -1
  53. package/schemas/button.json +1 -1
  54. package/schemas/icon-button.json +1 -1
  55. package/schemas/index.json +6 -6
  56. package/schemas/toggle-button.json +1 -1
  57. package/schemas/toggle-icon-button.json +1 -1
  58. package/src/components/_internal/shell-bottom.tsx +5 -5
  59. package/src/components/_internal/shell-handles.tsx +26 -26
  60. package/src/components/_internal/shell-inspector.tsx +5 -5
  61. package/src/components/_internal/shell-prop-helpers.ts +1 -1
  62. package/src/components/_internal/shell-sidebar.tsx +10 -10
  63. package/src/components/combobox.tsx +176 -80
  64. package/src/components/shell.context.tsx +12 -10
  65. package/src/components/shell.tsx +21 -20
  66. package/src/components/shell.types.ts +13 -0
@@ -1 +1 @@
1
- {"version":3,"file":"shell-bottom.d.ts","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CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAC3I,KAAK,yBAAyB,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAChF,KAAK,2BAA2B,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AACnF,KAAK,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAA;CAAE,CAAC;AACzE,KAAK,iBAAiB,GAAG,aAAa,GACpC,CAAC,qBAAqB,GAAG,uBAAuB,CAAC,GACjD,CAAC,yBAAyB,GAAG,2BAA2B,CAAC,GAAG;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEJ,KAAK,eAAe,GAAG,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,YAAY,CAAA;CAAE,CAAC;AAiBlJ,eAAO,MAAM,MAAM,EAsWb,eAAe,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var Ce=Object.create;var g=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)g(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,P)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of Ee(i))!Te.call(s,d)&&d!==l&&g(s,d,{get:()=>i[d],enumerable:!(P=ve(i,d))||P.enumerable});return s};var A=(s,i,l)=>(l=s!=null?Ce(Oe(s)):{},se(i||!s||!s.__esModule?g(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(g({},"__esModule",{value:!0}),s);var De={};Ne(De,{Bottom:()=>F});module.exports=ke(De);var t=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),C=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),b=require("./shell-handles.js"),He=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),de=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=t.forwardRef((s,i)=>{const{className:l,presentation:P="fixed",defaultOpen:d,open:u,onOpenChange:y,expandedSize:E=200,minSize:c=100,maxSize:m=400,resizable:O=!1,collapsible:ue=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:pe,onResizeEnd:ce,snapPoints:me,snapTolerance:fe,collapseThreshold:be,paneId:N,persistence:k,children:ye,style:he,size:Y,defaultSize:G,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,inset:H}=s,ze=(0,z.extractPaneDomProps)(s,we),o=(0,C.useShell)(),{registerInset:J,unregisterInset:Q}=(0,C.useInset)();t.useEffect(()=>{if(H)return J("bottom"),()=>Q("bottom")},[H,J,Q]);const I=(0,v.useResponsivePresentation)(P),B=I==="overlay",Pe=I==="stacked",p=t.useRef(null),Be=t.useCallback(e=>{p.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),W=t.Children.toArray(ye),X=W.filter(e=>t.isValidElement(e)&&e.type===b.BottomHandle),Z=W.filter(e=>!(t.isValidElement(e)&&e.type===b.BottomHandle)),Me=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(u),[u]),Re=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(d),[d]),Se=typeof u=="object"&&u!==null;(0,v.useResponsiveInitialState)({controlledValue:Me,defaultValue:Re,currentValue:o.bottomMode,setValue:o.setBottomMode,breakpointReady:o.currentBreakpointReady,controlledIsResponsive:Se,onResponsiveChange:e=>y?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof u>"u"&&y?.(e==="expanded",{reason:"init"})}});const f=t.useRef(null);t.useEffect(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[w,D,V]);const M=t.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(n,h)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{e(n,h),f.current=null},a)};if(r==="throttle"){let n=0;return(h,ge)=>{const re=Date.now();re-n>=a&&(n=re,e(h,ge))}}return(n,h)=>e(n,h)},[w,D,V]),R=t.useRef(null);t.useEffect(()=>{const e=typeof u<"u";if(R.current===null){R.current=e;return}R.current!==e&&(console.warn("Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported."),R.current=e)},[u]);const ee=t.useRef(!1),U=t.useRef(null);t.useEffect(()=>{!ee.current&&typeof u>"u"&&d&&o.bottomMode==="expanded"&&(y?.(!0,{reason:"init"}),ee.current=!0),typeof u>"u"&&(U.current!==null&&U.current!==o.bottomMode&&y?.(o.bottomMode==="expanded",{reason:"toggle"}),U.current=o.bottomMode)},[o.bottomMode,u,d,y]);const te=t.useRef(q),oe=t.useRef(K);t.useLayoutEffect(()=>{te.current=q,oe.current=K});const S=t.useRef(null),ne=t.useRef(!1);t.useEffect(()=>{const e=o.bottomMode;if(!o.currentBreakpointReady){S.current=e;return}if(!ne.current){ne.current=!0,S.current=e;return}const r=S.current;r!==null&&r!==e&&(e==="expanded"?te.current?.():e==="collapsed"&&oe.current?.(),S.current=e)},[o.bottomMode,o.currentBreakpointReady]);const _=o.bottomMode==="expanded",x=t.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:bottom:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);t.useEffect(()=>{let e=!0;if(!O||!x?.load||B)return;const r=x.load(),a=n=>{!e||typeof n!="number"||!p.current||(p.current.style.setProperty("--bottom-size",`${n}px`),T?.(n))};return r instanceof Promise?r.then(a).catch(n=>{}):a(r),()=>{e=!1}},[O,x,T,B]);const xe=O&&!B&&_?t.createElement(le.PaneResizeContext.Provider,{value:{containerRef:p,cssVarName:"--bottom-size",minSize:c,maxSize:m,defaultSize:E,orientation:"horizontal",edge:"start",computeNext:(e,r,a)=>{const n=e-r;return a-n},onResize:T,onResizeStart:pe,onResizeEnd:e=>{ce?.(e),M(e,{reason:"resize"}),x?.save?.(e)},target:"bottom",collapsible:ue,snapPoints:me,snapTolerance:fe??8,collapseThreshold:be,requestCollapse:()=>o.setBottomMode("collapsed"),requestToggle:()=>o.togglePane("bottom")}},X.length>0?X.map((e,r)=>t.cloneElement(e,{key:e.key??r})):t.createElement(b.PaneHandle,null)):null,$=t.useCallback(e=>(0,de.normalizeToPx)(e,"vertical"),[]);t.useEffect(()=>{if(p.current&&typeof Y>"u"&&typeof G<"u"){const e=$(G);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),M(n,{reason:"init"})}}},[]);const L=Y;if(t.useEffect(()=>{if(!p.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),M(n,{reason:"controlled"})}},[L,c,m,$,M]),B){const e=o.bottomMode==="expanded";return t.createElement(j.Root,{open:e,onOpenChange:r=>o.setBottomMode(r?"expanded":"collapsed")},t.createElement(j.Content,{side:"bottom",style:{padding:0},height:{initial:`${E}px`}},t.createElement(ae.VisuallyHidden,null,t.createElement(j.Title,null,"Bottom panel")),Z))}return t.createElement("div",{...ze,ref:Be,className:(0,ie.default)("rt-ShellBottom",l),"data-mode":o.bottomMode,"data-peek":o.peekTarget==="bottom"||void 0,"data-presentation":o.currentBreakpointReady?I:void 0,"data-open":o.currentBreakpointReady&&Pe&&_||void 0,"data-inset":H||void 0,style:{...he,"--bottom-size":`${E}px`,"--bottom-min-size":`${c}px`,"--bottom-max-size":`${m}px`}},t.createElement("div",{className:"rt-ShellBottomContent","data-visible":_||void 0},Z),xe)});F.displayName="Shell.Bottom",F.Handle=b.BottomHandle;
1
+ "use strict";var ge=Object.create;var C=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)C(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,P)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of Ee(i))!Te.call(s,d)&&d!==l&&C(s,d,{get:()=>i[d],enumerable:!(P=ve(i,d))||P.enumerable});return s};var A=(s,i,l)=>(l=s!=null?ge(Oe(s)):{},se(i||!s||!s.__esModule?C(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(C({},"__esModule",{value:!0}),s);var De={};Ne(De,{Bottom:()=>F});module.exports=ke(De);var t=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),g=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),b=require("./shell-handles.js"),He=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),de=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=t.forwardRef((s,i)=>{const{className:l,presentation:P="fixed",defaultOpen:d,open:u,onOpenChange:y,expandedSize:E=200,minSize:c=100,maxSize:m=400,resizable:O=!1,collapsible:ue=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:pe,onResizeEnd:ce,snapPoints:me,snapTolerance:fe,collapseThreshold:be,paneId:N,persistence:k,children:ye,style:he,size:W,defaultSize:Y,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,inset:H}=s,ze=(0,z.extractPaneDomProps)(s,we),o=(0,g.useShell)(),{registerInset:G,unregisterInset:J}=(0,g.useInset)();t.useEffect(()=>{if(H)return G("bottom"),()=>J("bottom")},[H,G,J]);const I=(0,v.useResponsivePresentation)(P),S=I==="overlay",Pe=I==="stacked",p=t.useRef(null),Se=t.useCallback(e=>{p.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),Q=t.Children.toArray(ye),X=Q.filter(e=>t.isValidElement(e)&&e.type===b.BottomHandle),Z=Q.filter(e=>!(t.isValidElement(e)&&e.type===b.BottomHandle)),Be=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(u),[u]),Me=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(d),[d]),Re=typeof u=="object"&&u!==null;(0,v.useResponsiveInitialState)({controlledValue:Be,defaultValue:Me,currentValue:o.bottomMode,setValue:o.setBottomMode,breakpointReady:o.currentBreakpointReady,controlledIsResponsive:Re,onResponsiveChange:e=>y?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof u>"u"&&y?.(e==="expanded",{reason:"init"})}});const f=t.useRef(null);t.useEffect(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[w,D,V]);const B=t.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(n,h)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{e(n,h),f.current=null},a)};if(r==="throttle"){let n=0;return(h,Ce)=>{const re=Date.now();re-n>=a&&(n=re,e(h,Ce))}}return(n,h)=>e(n,h)},[w,D,V]),M=t.useRef(null);t.useEffect(()=>{const e=typeof u<"u";if(M.current===null){M.current=e;return}M.current!==e&&(console.warn("Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported."),M.current=e)},[u]);const ee=t.useRef(!1),U=t.useRef(null);t.useEffect(()=>{!ee.current&&typeof u>"u"&&d&&o.bottomMode==="expanded"&&(y?.(!0,{reason:"init"}),ee.current=!0),typeof u>"u"&&(U.current!==null&&U.current!==o.bottomMode&&y?.(o.bottomMode==="expanded",{reason:"toggle"}),U.current=o.bottomMode)},[o.bottomMode,u,d,y]);const te=t.useRef(q),oe=t.useRef(K);t.useLayoutEffect(()=>{te.current=q,oe.current=K});const R=t.useRef(null),ne=t.useRef(!1);t.useEffect(()=>{const e=o.bottomMode;if(!o.currentBreakpointReady){R.current=e;return}if(!ne.current){ne.current=!0,R.current=e;return}const r=R.current;r!==null&&r!==e&&(e==="expanded"?te.current?.():e==="collapsed"&&oe.current?.(),R.current=e)},[o.bottomMode,o.currentBreakpointReady]);const _=o.bottomMode==="expanded",x=t.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:bottom:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);t.useEffect(()=>{let e=!0;if(!O||!x?.load||S)return;const r=x.load(),a=n=>{!e||typeof n!="number"||!p.current||(p.current.style.setProperty("--bottom-size",`${n}px`),T?.(n))};return r instanceof Promise?r.then(a).catch(n=>{}):a(r),()=>{e=!1}},[O,x,T,S]);const xe=O&&!S&&_?t.createElement(le.PaneResizeContext.Provider,{value:{containerRef:p,cssVarName:"--bottom-size",minSize:c,maxSize:m,defaultSize:E,orientation:"horizontal",edge:"start",computeNext:(e,r,a)=>{const n=e-r;return a-n},onResize:T,onResizeStart:pe,onResizeEnd:e=>{ce?.(e),B(e,{reason:"resize"}),x?.save?.(e)},target:"bottom",collapsible:ue,snapPoints:me,snapTolerance:fe??8,collapseThreshold:be,requestCollapse:()=>o.setBottomMode("collapsed"),requestToggle:()=>o.togglePane("bottom")}},X.length>0?X.map((e,r)=>t.cloneElement(e,{key:e.key??r})):t.createElement(b.PaneHandle,null)):null,$=t.useCallback(e=>(0,de.normalizeToPx)(e,"vertical"),[]);t.useEffect(()=>{if(p.current&&typeof W>"u"&&typeof Y<"u"){const e=$(Y);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),B(n,{reason:"init"})}}},[]);const L=W;if(t.useEffect(()=>{if(!p.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),B(n,{reason:"controlled"})}},[L,c,m,$,B]),S){const e=o.bottomMode==="expanded";return t.createElement(j.Root,{open:e,onOpenChange:r=>o.setBottomMode(r?"expanded":"collapsed")},t.createElement(j.Content,{side:"bottom",style:{padding:0},height:{initial:`${E}px`}},t.createElement(ae.VisuallyHidden,null,t.createElement(j.Title,null,"Bottom panel")),Z))}return t.createElement("div",{...ze,ref:Se,className:(0,ie.default)("rt-ShellBottom",l),"data-mode":o.bottomMode,"data-peek":o.peekTarget==="bottom"||void 0,"data-presentation":o.currentBreakpointReady?I:void 0,"data-open":o.currentBreakpointReady&&Pe&&_||void 0,"data-inset":H||void 0,style:{...he,"--bottom-size":`${E}px`,"--bottom-min-size":`${c}px`,"--bottom-max-size":`${m}px`}},t.createElement("div",{className:"rt-ShellBottomContent","data-visible":_||void 0},Z),xe)});F.displayName="Shell.Bottom",F.Handle=b.BottomHandle;
2
2
  //# sourceMappingURL=shell-bottom.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-bottom.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\ntype BottomUncontrolledProps = { defaultOpen?: boolean; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: BottomSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof BottomPublicProps)[];\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n } = initialProps;\n const bottomDomProps = extractPaneDomProps(initialProps, BOTTOM_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('bottom');\n return () => unregisterInset('bottom');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === BottomHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === BottomHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.bottomMode,\n setValue: shell.setBottomMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: BottomSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: BottomSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: BottomSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: BottomSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastBottomModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.bottomMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n if (typeof open === 'undefined') {\n if (lastBottomModeRef.current !== null && lastBottomModeRef.current !== shell.bottomMode) {\n onOpenChange?.(shell.bottomMode === 'expanded', { reason: 'toggle' });\n }\n lastBottomModeRef.current = shell.bottomMode;\n }\n }, [shell.bottomMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevBottomModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.bottomMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevBottomModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevBottomModeRef.current = currentMode;\n }\n }, [shell.bottomMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.bottomMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:bottom:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--bottom-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--bottom-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'horizontal',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const delta = client - startClient;\n return startSize - delta;\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'bottom',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setBottomMode('collapsed'),\n requestToggle: () => shell.togglePane('bottom'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Strip control/size props from DOM spread (moved above overlay return to keep hook order consistent)\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'vertical'), []);\n\n // Apply defaultSize on mount when uncontrolled (moved above overlay return)\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync (moved above overlay return)\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.bottomMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setBottomMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"bottom\" style={{ padding: 0 }} height={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Bottom panel</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n return (\n <div\n {...bottomDomProps}\n ref={setRef}\n className={classNames('rt-ShellBottom', className)}\n data-mode={shell.bottomMode}\n data-peek={shell.peekTarget === 'bottom' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n ['--bottom-size' as any]: `${expandedSize}px`,\n ['--bottom-min-size' as any]: `${minSize}px`,\n ['--bottom-max-size' as any]: `${maxSize}px`,\n }}\n >\n <div className=\"rt-ShellBottomContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as BottomComponent;\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = BottomHandle;\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAAyC,8BACzCC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAoB9B,MAAMC,GAAuB,CAC3B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAASE,EAAM,WAA8C,CAACY,EAAcC,IAAQ,CAC/F,KAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,QACf,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU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AAO,OAAS",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps, CSSPropertiesWithVars } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\ntype BottomUncontrolledProps = { defaultOpen?: boolean; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: BottomSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof BottomPublicProps)[];\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n } = initialProps;\n const bottomDomProps = extractPaneDomProps(initialProps, BOTTOM_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('bottom');\n return () => unregisterInset('bottom');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === BottomHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === BottomHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.bottomMode,\n setValue: shell.setBottomMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: BottomSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: BottomSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: BottomSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: BottomSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastBottomModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.bottomMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n if (typeof open === 'undefined') {\n if (lastBottomModeRef.current !== null && lastBottomModeRef.current !== shell.bottomMode) {\n onOpenChange?.(shell.bottomMode === 'expanded', { reason: 'toggle' });\n }\n lastBottomModeRef.current = shell.bottomMode;\n }\n }, [shell.bottomMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevBottomModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.bottomMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevBottomModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevBottomModeRef.current = currentMode;\n }\n }, [shell.bottomMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.bottomMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:bottom:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--bottom-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--bottom-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'horizontal',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const delta = client - startClient;\n return startSize - delta;\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'bottom',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setBottomMode('collapsed'),\n requestToggle: () => shell.togglePane('bottom'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Strip control/size props from DOM spread (moved above overlay return to keep hook order consistent)\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'vertical'), []);\n\n // Apply defaultSize on mount when uncontrolled (moved above overlay return)\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync (moved above overlay return)\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.bottomMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setBottomMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"bottom\" style={{ padding: 0 }} height={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Bottom panel</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n return (\n <div\n {...bottomDomProps}\n ref={setRef}\n className={classNames('rt-ShellBottom', className)}\n data-mode={shell.bottomMode}\n data-peek={shell.peekTarget === 'bottom' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n '--bottom-size': `${expandedSize}px`,\n '--bottom-min-size': `${minSize}px`,\n '--bottom-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars}\n >\n <div className=\"rt-ShellBottomContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as BottomComponent;\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = BottomHandle;\n"],
5
+ "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAAyC,8BACzCC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAoB9B,MAAMC,GAAuB,CAC3B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAASE,EAAM,WAA8C,CAACY,EAAcC,IAAQ,CAC/F,KAAM,CACJ,UAAAC,EACA,aAA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AI,UAAU,wBAAwB,eAAcgF,GAAc,QAChEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EACD3F,EAAO,YAAc,eACrBA,EAAO,OAAS",
6
6
  "names": ["shell_bottom_exports", "__export", "Bottom", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_handles", "import_shell_types", "import_shell_prop_helpers", "import_normalize_to_px", "BOTTOM_DOM_PROP_KEYS", "initialProps", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "bottomDomProps", "shell", "registerInset", "unregisterInset", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "normalizedControlledOpen", "normalizedDefaultOpen", "openIsResponsive", "next", "initial", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "wasControlledRef", "isControlled", "initNotifiedRef", "lastBottomModeRef", "onExpandRef", "onCollapseRef", "prevBottomModeRef", "hasInitializedRef", "currentMode", "prevMode", "isExpanded", "persistenceAdapter", "key", "v", "mounted", "loaded", "applyLoaded", "value", "err", "handleEl", "client", "startClient", "startSize", "delta", "i", "normalizeSizeToPx", "px", "clamped", "controlledSize", "o", "classNames"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var te=Object.create;var A=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var se=(e,t)=>{for(var u in t)A(e,u,{get:t[u],enumerable:!0})},U=(e,t,u,H)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of re(t))!oe.call(e,p)&&p!==u&&A(e,p,{get:()=>t[p],enumerable:!(H=ne(t,p))||H.enumerable});return e};var V=(e,t,u)=>(u=e!=null?te(ae(e)):{},U(t||!e||!e.__esModule?A(u,"default",{value:e,enumerable:!0}):u,e)),ie=e=>U(A({},"__esModule",{value:!0}),e);var le={};se(le,{BottomHandle:()=>j,InspectorHandle:()=>O,PaneHandle:()=>b,PanelHandle:()=>X,SidebarHandle:()=>Y});module.exports=ie(le);var c=V(require("react")),q=V(require("classnames")),B=require("./shell-resize.js");const b=c.forwardRef(({className:e,children:t,...u},H)=>{const{containerRef:p,cssVarName:m,minSize:C,maxSize:M,defaultSize:D,orientation:w,edge:N,computeNext:G,onResize:S,onResizeStart:T,onResizeEnd:P,snapPoints:z,snapTolerance:J,collapseThreshold:k,collapsible:$,target:I,requestCollapse:Q,requestToggle:Z}=(0,B.usePaneResize)(),R=c.useRef(null);c.useEffect(()=>()=>{try{R.current?.()}catch{}R.current=null},[]);const _=w,ee=`Resize ${I.charAt(0).toUpperCase()+I.slice(1)} pane`;return c.createElement("div",{...u,ref:H,className:(0,q.default)("rt-ShellResizer",e),"data-orientation":w,"data-edge":N,role:"slider","aria-label":ee,"aria-orientation":_,"aria-valuemin":C,"aria-valuemax":M,"aria-valuenow":D,tabIndex:0,onPointerDown:n=>{if(!p.current)return;n.preventDefault();const a=p.current,d=n.currentTarget,x=n.pointerId;try{R.current?.()}catch{}a.setAttribute("data-resizing","");try{d.setPointerCapture(x)}catch{}const L=w==="vertical"?n.clientX:n.clientY,v=parseFloat(getComputedStyle(a).getPropertyValue(m)||`${D}`),y=l=>Math.min(Math.max(l,C),M),o=document.body,r=o.style.cursor,f=o.style.userSelect;o.style.cursor=w==="vertical"?"col-resize":"row-resize",o.style.userSelect="none",T?.(v);const i=l=>{const E=w==="vertical"?l.clientX:l.clientY,g=y(G(E,L,v));a.style.setProperty(m,`${g}px`),d.setAttribute("aria-valuenow",String(g)),S?.(g)},h=()=>{try{d.releasePointerCapture(x)}catch{}window.removeEventListener("pointermove",i),document.removeEventListener("pointermove",i),window.removeEventListener("mousemove",i),document.removeEventListener("mousemove",i),d.removeEventListener("pointermove",i),window.removeEventListener("pointerup",s),document.removeEventListener("pointerup",s),window.removeEventListener("mouseup",s),document.removeEventListener("mouseup",s),window.removeEventListener("pointercancel",s),document.removeEventListener("pointercancel",s),window.removeEventListener("keydown",W),d.removeEventListener("lostpointercapture",s),a.removeAttribute("data-resizing"),o.style.cursor=r,o.style.userSelect=f,R.current=null},s=()=>{const l=parseFloat(getComputedStyle(a).getPropertyValue(m)||`${D}`);let E=l;if(z&&z.length){const g=z.reduce((F,K)=>Math.abs(K-l)<Math.abs(F-l)?K:F,z[0]);Math.abs(g-l)<=(J??8)&&(E=g,a.style.setProperty(m,`${E}px`),d.setAttribute("aria-valuenow",String(E)),S?.(E))}$&&typeof k=="number"&&l<=k&&Q?.(),P?.(E),h()},W=l=>{l.key==="Escape"&&(a.style.setProperty(m,`${v}px`),d.setAttribute("aria-valuenow",String(v)),P?.(v),h())};window.addEventListener("pointermove",i),document.addEventListener("pointermove",i),window.addEventListener("mousemove",i),document.addEventListener("mousemove",i),d.addEventListener("pointermove",i),window.addEventListener("pointerup",s),document.addEventListener("pointerup",s),window.addEventListener("mouseup",s),document.addEventListener("mouseup",s),window.addEventListener("pointercancel",s),document.addEventListener("pointercancel",s),window.addEventListener("keydown",W),d.addEventListener("lostpointercapture",s),R.current=h},onDoubleClick:()=>{$&&Z?.()},onKeyDown:n=>{if(!p.current)return;const a=p.current,d=getComputedStyle(a).getPropertyValue(m),x=Number.parseFloat(d.trim()),L=Number.isFinite(x)?x:D,v=r=>Math.min(Math.max(r,C),M),y=n.shiftKey?32:8;let o=0;if(w==="vertical"){const r=typeof document<"u"?document.dir:void 0,f=getComputedStyle(a).direction,i=!!(a.closest&&a.closest('[dir="rtl"]')),h=r==="rtl"||f==="rtl"||i;n.key==="ArrowRight"?o=h?-y:y:n.key==="ArrowLeft"&&(o=h?y:-y)}else n.key==="ArrowDown"?o=y:n.key==="ArrowUp"&&(o=-y);if(n.key==="Home"){n.preventDefault(),T?.(L);const r=v(C);a.style.setProperty(m,`${r}px`),n.currentTarget.setAttribute("aria-valuenow",String(r)),S?.(r),P?.(r);return}if(n.key==="End"){n.preventDefault(),T?.(L);const r=v(M);a.style.setProperty(m,`${r}px`),n.currentTarget.setAttribute("aria-valuenow",String(r)),S?.(r),P?.(r);return}if(o!==0){n.preventDefault(),T?.(L);const r=w==="vertical"&&N==="start"?-o:o,f=v(L+r);a.style.setProperty(m,`${f}px`),n.currentTarget.setAttribute("aria-valuenow",String(f)),S?.(f),P?.(f)}}},t)});b.displayName="Shell.Handle";const X=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));X.displayName="Shell.Panel.Handle";const Y=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));Y.displayName="Shell.Sidebar.Handle";const O=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));O.displayName="Shell.Inspector.Handle";const j=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));j.displayName="Shell.Bottom.Handle";
1
+ "use strict";var te=Object.create;var A=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var ie=(e,t)=>{for(var u in t)A(e,u,{get:t[u],enumerable:!0})},U=(e,t,u,H)=>{if(t&&typeof t=="object"||typeof t=="function")for(let v of re(t))!se.call(e,v)&&v!==u&&A(e,v,{get:()=>t[v],enumerable:!(H=ne(t,v))||H.enumerable});return e};var V=(e,t,u)=>(u=e!=null?te(oe(e)):{},U(t||!e||!e.__esModule?A(u,"default",{value:e,enumerable:!0}):u,e)),ae=e=>U(A({},"__esModule",{value:!0}),e);var le={};ie(le,{BottomHandle:()=>j,InspectorHandle:()=>O,PaneHandle:()=>b,PanelHandle:()=>X,SidebarHandle:()=>Y});module.exports=ae(le);var c=V(require("react")),q=V(require("classnames")),B=require("./shell-resize.js");const b=c.forwardRef(({className:e,children:t,...u},H)=>{const{containerRef:v,cssVarName:p,minSize:C,maxSize:M,defaultSize:D,orientation:f,edge:N,computeNext:G,onResize:S,onResizeStart:T,onResizeEnd:P,snapPoints:z,snapTolerance:J,collapseThreshold:k,collapsible:$,target:I,requestCollapse:Q,requestToggle:Z}=(0,B.usePaneResize)(),R=c.useRef(null);c.useEffect(()=>()=>{try{R.current?.()}catch{}R.current=null},[]);const _=f,ee=`Resize ${I.charAt(0).toUpperCase()+I.slice(1)} pane`;return c.createElement("div",{...u,ref:H,className:(0,q.default)("rt-ShellResizer",e),"data-orientation":f,"data-edge":N,role:"slider","aria-label":ee,"aria-orientation":_,"aria-valuemin":C,"aria-valuemax":M,"aria-valuenow":D,tabIndex:0,onPointerDown:n=>{if(!v.current)return;n.preventDefault();const o=v.current,d=n.currentTarget,x=n.pointerId;try{R.current?.()}catch{}o.setAttribute("data-resizing","");try{d.setPointerCapture(x)}catch{}const w=f==="vertical"?n.clientX:n.clientY,m=parseFloat(getComputedStyle(o).getPropertyValue(p)||`${D}`),E=l=>Math.min(Math.max(l,C),M),s=document.body,r=s.style.cursor,L=s.style.userSelect;s.style.cursor=f==="vertical"?"col-resize":"row-resize",s.style.userSelect="none",T?.(m);const a=l=>{const y=f==="vertical"?l.clientX:l.clientY,g=E(G(y,w,m));o.style.setProperty(p,`${g}px`),d.setAttribute("aria-valuenow",String(g)),S?.(g)},h=()=>{try{d.releasePointerCapture(x)}catch{}window.removeEventListener("pointermove",a),document.removeEventListener("pointermove",a),window.removeEventListener("mousemove",a),document.removeEventListener("mousemove",a),d.removeEventListener("pointermove",a),window.removeEventListener("pointerup",i),document.removeEventListener("pointerup",i),window.removeEventListener("mouseup",i),document.removeEventListener("mouseup",i),window.removeEventListener("pointercancel",i),document.removeEventListener("pointercancel",i),window.removeEventListener("keydown",W),d.removeEventListener("lostpointercapture",i),o.removeAttribute("data-resizing"),s.style.cursor=r,s.style.userSelect=L,R.current=null},i=()=>{const l=parseFloat(getComputedStyle(o).getPropertyValue(p)||`${D}`);let y=l;if(z&&z.length){const g=z.reduce((F,K)=>Math.abs(K-l)<Math.abs(F-l)?K:F,z[0]);Math.abs(g-l)<=(J??8)&&(y=g,o.style.setProperty(p,`${y}px`),d.setAttribute("aria-valuenow",String(y)),S?.(y))}$&&typeof k=="number"&&l<=k&&Q?.(),P?.(y),h()},W=l=>{l.key==="Escape"&&(o.style.setProperty(p,`${m}px`),d.setAttribute("aria-valuenow",String(m)),P?.(m),h())};window.addEventListener("pointermove",a),document.addEventListener("pointermove",a),window.addEventListener("mousemove",a),document.addEventListener("mousemove",a),d.addEventListener("pointermove",a),window.addEventListener("pointerup",i),document.addEventListener("pointerup",i),window.addEventListener("mouseup",i),document.addEventListener("mouseup",i),window.addEventListener("pointercancel",i),document.addEventListener("pointercancel",i),window.addEventListener("keydown",W),d.addEventListener("lostpointercapture",i),R.current=h},onDoubleClick:()=>{$&&Z?.()},onKeyDown:n=>{if(!v.current)return;const o=v.current,d=getComputedStyle(o).getPropertyValue(p),x=Number.parseFloat(d.trim()),w=Number.isFinite(x)?x:D,m=r=>Math.min(Math.max(r,C),M),E=n.shiftKey?32:8;let s=0;if(f==="vertical"){const r=typeof document<"u"?document.dir:void 0,L=getComputedStyle(o).direction,a=!!(o.closest&&o.closest('[dir="rtl"]')),h=r==="rtl"||L==="rtl"||a;n.key==="ArrowRight"?s=h?-E:E:n.key==="ArrowLeft"&&(s=h?E:-E)}else n.key==="ArrowDown"?s=E:n.key==="ArrowUp"&&(s=-E);if(n.key==="Home"){n.preventDefault(),T?.(w);const r=m(C);o.style.setProperty(p,`${r}px`),n.currentTarget.setAttribute("aria-valuenow",String(r)),S?.(r),P?.(r);return}if(n.key==="End"){n.preventDefault(),T?.(w);const r=m(M);o.style.setProperty(p,`${r}px`),n.currentTarget.setAttribute("aria-valuenow",String(r)),S?.(r),P?.(r);return}if(s!==0){n.preventDefault(),T?.(w);const r=f==="vertical"&&N==="start"?-s:s,L=m(w+r);o.style.setProperty(p,`${L}px`),n.currentTarget.setAttribute("aria-valuenow",String(L)),S?.(L),P?.(L)}}},t)});b.displayName="Shell.Handle";const X=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));X.displayName="Shell.Panel.Handle";const Y=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));Y.displayName="Shell.Sidebar.Handle";const O=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));O.displayName="Shell.Inspector.Handle";const j=c.forwardRef((e,t)=>c.createElement(b,{...e,ref:t}));j.displayName="Shell.Bottom.Handle";
2
2
  //# sourceMappingURL=shell-handles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-handles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { usePaneResize } from './shell-resize.js';\n\nexport const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(({ className, children, ...props }, ref) => {\n const {\n containerRef,\n cssVarName,\n minSize,\n maxSize,\n defaultSize,\n orientation,\n edge,\n computeNext,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n collapsible,\n target,\n requestCollapse,\n requestToggle,\n } = usePaneResize();\n\n const activeCleanupRef = React.useRef<(() => void) | null>(null);\n React.useEffect(\n () => () => {\n try {\n activeCleanupRef.current?.();\n } catch {}\n activeCleanupRef.current = null;\n },\n [],\n );\n\n const ariaOrientation = orientation;\n\n // Generate accessible label from target\n const targetLabel = target.charAt(0).toUpperCase() + target.slice(1);\n const ariaLabel = `Resize ${targetLabel} pane`;\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames('rt-ShellResizer', className)}\n data-orientation={orientation}\n data-edge={edge}\n role=\"slider\"\n aria-label={ariaLabel}\n aria-orientation={ariaOrientation}\n aria-valuemin={minSize}\n aria-valuemax={maxSize}\n aria-valuenow={defaultSize}\n tabIndex={0}\n onPointerDown={(e) => {\n if (!containerRef.current) return;\n e.preventDefault();\n const container = containerRef.current;\n const handleEl = e.currentTarget as HTMLElement;\n const pointerId = e.pointerId;\n try {\n activeCleanupRef.current?.();\n } catch {}\n container.setAttribute('data-resizing', '');\n try {\n handleEl.setPointerCapture(pointerId);\n } catch {}\n const startClient = orientation === 'vertical' ? e.clientX : e.clientY;\n const startSize = parseFloat(getComputedStyle(container).getPropertyValue(cssVarName) || `${defaultSize}`);\n const clamp = (v: number) => Math.min(Math.max(v, minSize), maxSize);\n const body = document.body;\n const prevCursor = body.style.cursor;\n const prevUserSelect = body.style.userSelect;\n body.style.cursor = orientation === 'vertical' ? 'col-resize' : 'row-resize';\n body.style.userSelect = 'none';\n onResizeStart?.(startSize);\n const handleMove = (ev: PointerEvent) => {\n const client = orientation === 'vertical' ? ev.clientX : ev.clientY;\n const next = clamp(computeNext(client, startClient, startSize));\n container.style.setProperty(cssVarName, `${next}px`);\n handleEl.setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n };\n const cleanup = () => {\n try {\n handleEl.releasePointerCapture(pointerId);\n } catch {}\n window.removeEventListener('pointermove', handleMove as any);\n document.removeEventListener('pointermove', handleMove as any);\n window.removeEventListener('mousemove', handleMove as any);\n document.removeEventListener('mousemove', handleMove as any);\n handleEl.removeEventListener('pointermove', handleMove as any);\n window.removeEventListener('pointerup', handleUp as any);\n document.removeEventListener('pointerup', handleUp as any);\n window.removeEventListener('mouseup', handleUp as any);\n document.removeEventListener('mouseup', handleUp as any);\n window.removeEventListener('pointercancel', handleUp as any);\n document.removeEventListener('pointercancel', handleUp as any);\n window.removeEventListener('keydown', handleKey as any);\n handleEl.removeEventListener('lostpointercapture', handleUp as any);\n container.removeAttribute('data-resizing');\n body.style.cursor = prevCursor;\n body.style.userSelect = prevUserSelect;\n activeCleanupRef.current = null;\n };\n const handleUp = () => {\n const finalSize = parseFloat(getComputedStyle(container).getPropertyValue(cssVarName) || `${defaultSize}`);\n let snapped = finalSize;\n if (snapPoints && snapPoints.length) {\n const nearest = snapPoints.reduce((acc, p) => (Math.abs(p - finalSize) < Math.abs(acc - finalSize) ? p : acc), snapPoints[0]);\n if (Math.abs(nearest - finalSize) <= (snapTolerance ?? 8)) {\n snapped = nearest;\n container.style.setProperty(cssVarName, `${snapped}px`);\n handleEl.setAttribute('aria-valuenow', String(snapped));\n onResize?.(snapped);\n }\n }\n if (collapsible && typeof collapseThreshold === 'number' && finalSize <= collapseThreshold) {\n requestCollapse?.();\n }\n onResizeEnd?.(snapped);\n cleanup();\n };\n const handleKey = (kev: KeyboardEvent) => {\n if (kev.key === 'Escape') {\n container.style.setProperty(cssVarName, `${startSize}px`);\n handleEl.setAttribute('aria-valuenow', String(startSize));\n onResizeEnd?.(startSize);\n cleanup();\n }\n };\n window.addEventListener('pointermove', handleMove as any);\n document.addEventListener('pointermove', handleMove as any);\n // Fallbacks for environments that don't fully support PointerEvent on window\n window.addEventListener('mousemove', handleMove as any);\n document.addEventListener('mousemove', handleMove as any);\n handleEl.addEventListener('pointermove', handleMove as any);\n window.addEventListener('pointerup', handleUp as any);\n document.addEventListener('pointerup', handleUp as any);\n window.addEventListener('mouseup', handleUp as any);\n document.addEventListener('mouseup', handleUp as any);\n window.addEventListener('pointercancel', handleUp as any);\n document.addEventListener('pointercancel', handleUp as any);\n window.addEventListener('keydown', handleKey as any);\n handleEl.addEventListener('lostpointercapture', handleUp as any);\n activeCleanupRef.current = cleanup;\n }}\n onDoubleClick={() => {\n if (collapsible) requestToggle?.();\n }}\n onKeyDown={(e) => {\n if (!containerRef.current) return;\n const container = containerRef.current;\n const rawCurrent = getComputedStyle(container).getPropertyValue(cssVarName);\n const parsedCurrent = Number.parseFloat(rawCurrent.trim());\n const current = Number.isFinite(parsedCurrent) ? parsedCurrent : defaultSize;\n const clamp = (v: number) => Math.min(Math.max(v, minSize), maxSize);\n const step = e.shiftKey ? 32 : 8;\n let delta = 0;\n if (orientation === 'vertical') {\n const docDir = typeof document !== 'undefined' ? document.dir : undefined;\n const cssDir = getComputedStyle(container).direction;\n const hasRtlAncestor = !!(container.closest && container.closest('[dir=\"rtl\"]'));\n const isRtl = docDir === 'rtl' || cssDir === 'rtl' || hasRtlAncestor;\n if (e.key === 'ArrowRight')\n delta = isRtl ? -step : step; // inline-end\n else if (e.key === 'ArrowLeft') delta = isRtl ? step : -step; // inline-start\n } else {\n if (e.key === 'ArrowDown') delta = step;\n else if (e.key === 'ArrowUp') delta = -step;\n }\n if (e.key === 'Home') {\n e.preventDefault();\n onResizeStart?.(current);\n const next = clamp(minSize);\n container.style.setProperty(cssVarName, `${next}px`);\n (e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n onResizeEnd?.(next);\n return;\n }\n if (e.key === 'End') {\n e.preventDefault();\n onResizeStart?.(current);\n const next = clamp(maxSize);\n container.style.setProperty(cssVarName, `${next}px`);\n (e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n onResizeEnd?.(next);\n return;\n }\n if (delta !== 0) {\n e.preventDefault();\n onResizeStart?.(current);\n const signedDelta = orientation === 'vertical' ? (edge === 'start' ? -delta : delta) : delta;\n const next = clamp(current + signedDelta);\n container.style.setProperty(cssVarName, `${next}px`);\n (e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n onResizeEnd?.(next);\n }\n }}\n >\n {children}\n </div>\n );\n});\nPaneHandle.displayName = 'Shell.Handle';\n\nexport const PanelHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nPanelHandle.displayName = 'Shell.Panel.Handle';\n\nexport const SidebarHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nSidebarHandle.displayName = 'Shell.Sidebar.Handle';\n\nexport const InspectorHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nInspectorHandle.displayName = 'Shell.Inspector.Handle';\n\nexport const BottomHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nBottomHandle.displayName = 'Shell.Bottom.Handle';\n"],
5
- "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,kBAAAE,EAAA,oBAAAC,EAAA,eAAAC,EAAA,gBAAAC,EAAA,kBAAAC,IAAA,eAAAC,GAAAP,IAAA,IAAAQ,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA8B,6BAEvB,MAAMN,EAAaI,EAAM,WAAkE,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAAQ,CAC5I,KAAM,CACJ,aAAAC,EACA,WAAAC,EACA,QAAAC,EACA,QAAAC,EACA,YAAAC,EACA,YAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,gBAAAC,EACA,cAAAC,CACF,KAAI,iBAAc,EAEZC,EAAmBzB,EAAM,OAA4B,IAAI,EAC/DA,EAAM,UACJ,IAAM,IAAM,CACV,GAAI,CACFyB,EAAiB,UAAU,CAC7B,MAAQ,CAAC,CACTA,EAAiB,QAAU,IAC7B,EACA,CAAC,CACH,EAEA,MAAMC,EAAkBd,EAIlBe,GAAY,UADEL,EAAO,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAO,MAAM,CAAC,CAC5B,QAEvC,OACEtB,EAAA,cAAC,OACE,GAAGK,EACJ,IAAKC,EACL,aAAW,EAAAsB,SAAW,kBAAmBzB,CAAS,EAClD,mBAAkBS,EAClB,YAAWC,EACX,KAAK,SACL,aAAYc,GACZ,mBAAkBD,EAClB,gBAAejB,EACf,gBAAeC,EACf,gBAAeC,EACf,SAAU,EACV,cAAgBkB,GAAM,CACpB,GAAI,CAACtB,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N,EAAA,cAACJ,EAAA,CAAY,GAAGS,EAAO,IAAKC,EAAK,CAAE,EAC1JX,EAAgB,YAAc,yBAEvB,MAAMD,EAAeM,EAAM,WAAkE,CAACK,EAAOC,IAAQN,EAAA,cAACJ,EAAA,CAAY,GAAGS,EAAO,IAAKC,EAAK,CAAE,EACvJZ,EAAa,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { usePaneResize } from './shell-resize.js';\n\nexport const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(({ className, children, ...props }, ref) => {\n const {\n containerRef,\n cssVarName,\n minSize,\n maxSize,\n defaultSize,\n orientation,\n edge,\n computeNext,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n collapsible,\n target,\n requestCollapse,\n requestToggle,\n } = usePaneResize();\n\n const activeCleanupRef = React.useRef<(() => void) | null>(null);\n React.useEffect(\n () => () => {\n try {\n activeCleanupRef.current?.();\n } catch {}\n activeCleanupRef.current = null;\n },\n [],\n );\n\n const ariaOrientation = orientation;\n\n // Generate accessible label from target\n const targetLabel = target.charAt(0).toUpperCase() + target.slice(1);\n const ariaLabel = `Resize ${targetLabel} pane`;\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames('rt-ShellResizer', className)}\n data-orientation={orientation}\n data-edge={edge}\n role=\"slider\"\n aria-label={ariaLabel}\n aria-orientation={ariaOrientation}\n aria-valuemin={minSize}\n aria-valuemax={maxSize}\n aria-valuenow={defaultSize}\n tabIndex={0}\n onPointerDown={(e) => {\n if (!containerRef.current) return;\n e.preventDefault();\n const container = containerRef.current;\n const handleEl = e.currentTarget as HTMLElement;\n const pointerId = e.pointerId;\n try {\n activeCleanupRef.current?.();\n } catch {}\n container.setAttribute('data-resizing', '');\n try {\n handleEl.setPointerCapture(pointerId);\n } catch {}\n const startClient = orientation === 'vertical' ? e.clientX : e.clientY;\n const startSize = parseFloat(getComputedStyle(container).getPropertyValue(cssVarName) || `${defaultSize}`);\n const clamp = (v: number) => Math.min(Math.max(v, minSize), maxSize);\n const body = document.body;\n const prevCursor = body.style.cursor;\n const prevUserSelect = body.style.userSelect;\n body.style.cursor = orientation === 'vertical' ? 'col-resize' : 'row-resize';\n body.style.userSelect = 'none';\n onResizeStart?.(startSize);\n const handleMove = (ev: PointerEvent) => {\n const client = orientation === 'vertical' ? ev.clientX : ev.clientY;\n const next = clamp(computeNext(client, startClient, startSize));\n container.style.setProperty(cssVarName, `${next}px`);\n handleEl.setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n };\n const cleanup = () => {\n try {\n handleEl.releasePointerCapture(pointerId);\n } catch {}\n window.removeEventListener('pointermove', handleMove as EventListener);\n document.removeEventListener('pointermove', handleMove as EventListener);\n window.removeEventListener('mousemove', handleMove as EventListener);\n document.removeEventListener('mousemove', handleMove as EventListener);\n handleEl.removeEventListener('pointermove', handleMove as EventListener);\n window.removeEventListener('pointerup', handleUp as EventListener);\n document.removeEventListener('pointerup', handleUp as EventListener);\n window.removeEventListener('mouseup', handleUp as EventListener);\n document.removeEventListener('mouseup', handleUp as EventListener);\n window.removeEventListener('pointercancel', handleUp as EventListener);\n document.removeEventListener('pointercancel', handleUp as EventListener);\n window.removeEventListener('keydown', handleKey as EventListener);\n handleEl.removeEventListener('lostpointercapture', handleUp as EventListener);\n container.removeAttribute('data-resizing');\n body.style.cursor = prevCursor;\n body.style.userSelect = prevUserSelect;\n activeCleanupRef.current = null;\n };\n const handleUp = () => {\n const finalSize = parseFloat(getComputedStyle(container).getPropertyValue(cssVarName) || `${defaultSize}`);\n let snapped = finalSize;\n if (snapPoints && snapPoints.length) {\n const nearest = snapPoints.reduce((acc, p) => (Math.abs(p - finalSize) < Math.abs(acc - finalSize) ? p : acc), snapPoints[0]);\n if (Math.abs(nearest - finalSize) <= (snapTolerance ?? 8)) {\n snapped = nearest;\n container.style.setProperty(cssVarName, `${snapped}px`);\n handleEl.setAttribute('aria-valuenow', String(snapped));\n onResize?.(snapped);\n }\n }\n if (collapsible && typeof collapseThreshold === 'number' && finalSize <= collapseThreshold) {\n requestCollapse?.();\n }\n onResizeEnd?.(snapped);\n cleanup();\n };\n const handleKey = (kev: KeyboardEvent) => {\n if (kev.key === 'Escape') {\n container.style.setProperty(cssVarName, `${startSize}px`);\n handleEl.setAttribute('aria-valuenow', String(startSize));\n onResizeEnd?.(startSize);\n cleanup();\n }\n };\n window.addEventListener('pointermove', handleMove as EventListener);\n document.addEventListener('pointermove', handleMove as EventListener);\n // Fallbacks for environments that don't fully support PointerEvent on window\n window.addEventListener('mousemove', handleMove as EventListener);\n document.addEventListener('mousemove', handleMove as EventListener);\n handleEl.addEventListener('pointermove', handleMove as EventListener);\n window.addEventListener('pointerup', handleUp as EventListener);\n document.addEventListener('pointerup', handleUp as EventListener);\n window.addEventListener('mouseup', handleUp as EventListener);\n document.addEventListener('mouseup', handleUp as EventListener);\n window.addEventListener('pointercancel', handleUp as EventListener);\n document.addEventListener('pointercancel', handleUp as EventListener);\n window.addEventListener('keydown', handleKey as EventListener);\n handleEl.addEventListener('lostpointercapture', handleUp as EventListener);\n activeCleanupRef.current = cleanup;\n }}\n onDoubleClick={() => {\n if (collapsible) requestToggle?.();\n }}\n onKeyDown={(e) => {\n if (!containerRef.current) return;\n const container = containerRef.current;\n const rawCurrent = getComputedStyle(container).getPropertyValue(cssVarName);\n const parsedCurrent = Number.parseFloat(rawCurrent.trim());\n const current = Number.isFinite(parsedCurrent) ? parsedCurrent : defaultSize;\n const clamp = (v: number) => Math.min(Math.max(v, minSize), maxSize);\n const step = e.shiftKey ? 32 : 8;\n let delta = 0;\n if (orientation === 'vertical') {\n const docDir = typeof document !== 'undefined' ? document.dir : undefined;\n const cssDir = getComputedStyle(container).direction;\n const hasRtlAncestor = !!(container.closest && container.closest('[dir=\"rtl\"]'));\n const isRtl = docDir === 'rtl' || cssDir === 'rtl' || hasRtlAncestor;\n if (e.key === 'ArrowRight')\n delta = isRtl ? -step : step; // inline-end\n else if (e.key === 'ArrowLeft') delta = isRtl ? step : -step; // inline-start\n } else {\n if (e.key === 'ArrowDown') delta = step;\n else if (e.key === 'ArrowUp') delta = -step;\n }\n if (e.key === 'Home') {\n e.preventDefault();\n onResizeStart?.(current);\n const next = clamp(minSize);\n container.style.setProperty(cssVarName, `${next}px`);\n (e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n onResizeEnd?.(next);\n return;\n }\n if (e.key === 'End') {\n e.preventDefault();\n onResizeStart?.(current);\n const next = clamp(maxSize);\n container.style.setProperty(cssVarName, `${next}px`);\n (e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n onResizeEnd?.(next);\n return;\n }\n if (delta !== 0) {\n e.preventDefault();\n onResizeStart?.(current);\n const signedDelta = orientation === 'vertical' ? (edge === 'start' ? -delta : delta) : delta;\n const next = clamp(current + signedDelta);\n container.style.setProperty(cssVarName, `${next}px`);\n (e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));\n onResize?.(next);\n onResizeEnd?.(next);\n }\n }}\n >\n {children}\n </div>\n );\n});\nPaneHandle.displayName = 'Shell.Handle';\n\nexport const PanelHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nPanelHandle.displayName = 'Shell.Panel.Handle';\n\nexport const SidebarHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nSidebarHandle.displayName = 'Shell.Sidebar.Handle';\n\nexport const InspectorHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nInspectorHandle.displayName = 'Shell.Inspector.Handle';\n\nexport const BottomHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nBottomHandle.displayName = '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AQN,EAAA,cAACJ,EAAA,CAAY,GAAGS,EAAO,IAAKC,EAAK,CAAE,EACvJZ,EAAa,YAAc",
6
6
  "names": ["shell_handles_exports", "__export", "BottomHandle", "InspectorHandle", "PaneHandle", "PanelHandle", "SidebarHandle", "__toCommonJS", "React", "import_classnames", "import_shell_resize", "className", "children", "props", "ref", "containerRef", "cssVarName", "minSize", "maxSize", "defaultSize", "orientation", "edge", "computeNext", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "collapsible", "target", "requestCollapse", "requestToggle", "activeCleanupRef", "ariaOrientation", "ariaLabel", "classNames", "e", "container", "handleEl", "pointerId", "startClient", "startSize", "clamp", "v", "body", "prevCursor", "prevUserSelect", "handleMove", "ev", "client", "next", "cleanup", "handleUp", "handleKey", "finalSize", "snapped", "nearest", "acc", "p", "kev", "rawCurrent", "parsedCurrent", "current", "step", "delta", "docDir", "cssDir", "hasRtlAncestor", "isRtl", "signedDelta"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shell-inspector.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/shell-inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,eAAe,EAAc,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAyD,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAI1H,KAAK,uBAAuB,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAA;CAAE,CAAC;AAC5E,KAAK,wBAAwB,GAAG;IAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CA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,CAAC,4BAA4B,GAAG,8BAA8B,CAAC,GAAG;IAChE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACrE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEJ,KAAK,kBAAkB,GAAG,KAAK,CAAC,yBAAyB,CAAC,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,eAAe,CAAA;CAAE,CAAC;AAiB3J,eAAO,MAAM,SAAS,EAwWhB,kBAAkB,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var Ce=Object.create;var g=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)g(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of Ee(i))!Te.call(s,c)&&c!==l&&g(s,c,{get:()=>i[c],enumerable:!(R=ve(i,c))||R.enumerable});return s};var A=(s,i,l)=>(l=s!=null?Ce(Oe(s)):{},se(i||!s||!s.__esModule?g(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(g({},"__esModule",{value:!0}),s);var De={};Ne(De,{Inspector:()=>F});module.exports=ke(De);var n=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),C=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),h=require("./shell-handles.js"),Be=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ce=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=n.forwardRef((s,i)=>{const{className:l,presentation:R={initial:"overlay",lg:"fixed"},defaultOpen:c,open:p,onOpenChange:P,expandedSize:E=320,minSize:f=200,maxSize:m=500,resizable:O=!1,collapsible:pe=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:de,onResizeEnd:ue,snapPoints:fe,snapTolerance:me,collapseThreshold:ye,paneId:N,persistence:k,children:he,style:Pe,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,size:Y,defaultSize:G,inset:B}=s,ze=(0,z.extractPaneDomProps)(s,we),t=(0,C.useShell)(),{registerInset:J,unregisterInset:Q}=(0,C.useInset)();n.useEffect(()=>{if(B)return J("inspector"),()=>Q("inspector")},[B,J,Q]);const H=(0,v.useResponsivePresentation)(R),I=H==="overlay",Re=H==="stacked",d=n.useRef(null),Ie=n.useCallback(e=>{d.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),W=n.Children.toArray(he),X=W.filter(e=>n.isValidElement(e)&&e.type===h.InspectorHandle),Z=W.filter(e=>!(n.isValidElement(e)&&e.type===h.InspectorHandle)),be=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(p),[p]),Me=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(c),[c]),Se=typeof p=="object"&&p!==null;(0,v.useResponsiveInitialState)({controlledValue:be,defaultValue:Me,currentValue:t.inspectorMode,setValue:t.setInspectorMode,breakpointReady:t.currentBreakpointReady,controlledIsResponsive:Se,onResponsiveChange:e=>P?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof p>"u"&&P?.(e==="expanded",{reason:"init"})}});const y=n.useRef(null);n.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[w,D,V]);const b=n.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(o,u)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{e(o,u),y.current=null},a)};if(r==="throttle"){let o=0;return(u,ge)=>{const re=Date.now();re-o>=a&&(o=re,e(u,ge))}}return(o,u)=>e(o,u)},[w,D,V]),M=n.useRef(null);n.useEffect(()=>{const e=typeof p<"u";if(M.current===null){M.current=e;return}M.current!==e&&(console.warn("Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported."),M.current=e)},[p]);const ee=n.useRef(!1),U=n.useRef(null);n.useEffect(()=>{!ee.current&&typeof p>"u"&&c&&t.inspectorMode==="expanded"&&(P?.(!0,{reason:"init"}),ee.current=!0),typeof p>"u"&&(U.current!==null&&U.current!==t.inspectorMode&&P?.(t.inspectorMode==="expanded",{reason:"toggle"}),U.current=t.inspectorMode)},[t.inspectorMode,p,c,P]);const ne=n.useRef(q),te=n.useRef(K);n.useLayoutEffect(()=>{ne.current=q,te.current=K});const S=n.useRef(null),oe=n.useRef(!1);n.useEffect(()=>{const e=t.inspectorMode;if(!t.currentBreakpointReady){S.current=e;return}if(!oe.current){oe.current=!0,S.current=e;return}const r=S.current;r!==null&&r!==e&&(e==="expanded"?ne.current?.():e==="collapsed"&&te.current?.(),S.current=e)},[t.inspectorMode,t.currentBreakpointReady]);const _=t.inspectorMode==="expanded",x=n.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:inspector:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);n.useEffect(()=>{let e=!0;if(!O||!x?.load||I)return;const r=x.load(),a=o=>{!e||typeof o!="number"||!d.current||(d.current.style.setProperty("--inspector-size",`${o}px`),T?.(o))};return r instanceof Promise?r.then(a).catch(o=>{}):a(r),()=>{e=!1}},[O,x,T,I]);const xe=O&&!I&&_?n.createElement(le.PaneResizeContext.Provider,{value:{containerRef:d,cssVarName:"--inspector-size",minSize:f,maxSize:m,defaultSize:E,orientation:"vertical",edge:"start",computeNext:(e,r,a)=>{const o=getComputedStyle(d.current).direction==="rtl",u=e-r;return a+(o?u:-u)},onResize:T,onResizeStart:de,onResizeEnd:e=>{ue?.(e),b(e,{reason:"resize"}),x?.save?.(e)},target:"inspector",collapsible:pe,snapPoints:fe,snapTolerance:me??8,collapseThreshold:ye,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},X.length>0?X.map((e,r)=>n.cloneElement(e,{key:e.key??r})):n.createElement(h.PaneHandle,null)):null,$=n.useCallback(e=>(0,ce.normalizeToPx)(e,"horizontal"),[]);n.useEffect(()=>{if(d.current&&typeof Y>"u"&&typeof G<"u"){const e=$(G);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),b(o,{reason:"init"})}}},[]);const L=Y;if(n.useEffect(()=>{if(!d.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),b(o,{reason:"controlled"})}},[L,f,m,$,b]),I){const e=t.inspectorMode==="expanded";return n.createElement(j.Root,{open:e,onOpenChange:r=>t.setInspectorMode(r?"expanded":"collapsed")},n.createElement(j.Content,{side:"end",style:{padding:0},width:{initial:`${E}px`}},n.createElement(ae.VisuallyHidden,null,n.createElement(j.Title,null,"Inspector")),Z))}return n.createElement("div",{...ze,ref:Ie,className:(0,ie.default)("rt-ShellInspector",l),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":t.currentBreakpointReady?H:void 0,"data-open":t.currentBreakpointReady&&Re&&_||void 0,"data-inset":B||void 0,style:{...Pe,"--inspector-size":`${E}px`,"--inspector-min-size":`${f}px`,"--inspector-max-size":`${m}px`}},n.createElement("div",{className:"rt-ShellInspectorContent","data-visible":_||void 0},Z),xe)});F.displayName="Shell.Inspector",F.Handle=h.InspectorHandle;
1
+ "use strict";var ge=Object.create;var x=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)x(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of Ee(i))!Te.call(s,c)&&c!==l&&x(s,c,{get:()=>i[c],enumerable:!(R=ve(i,c))||R.enumerable});return s};var A=(s,i,l)=>(l=s!=null?ge(Oe(s)):{},se(i||!s||!s.__esModule?x(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(x({},"__esModule",{value:!0}),s);var De={};Ne(De,{Inspector:()=>F});module.exports=ke(De);var n=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),g=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),h=require("./shell-handles.js"),Be=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ce=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=n.forwardRef((s,i)=>{const{className:l,presentation:R={initial:"overlay",lg:"fixed"},defaultOpen:c,open:p,onOpenChange:P,expandedSize:E=320,minSize:f=200,maxSize:m=500,resizable:O=!1,collapsible:pe=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:de,onResizeEnd:ue,snapPoints:fe,snapTolerance:me,collapseThreshold:ye,paneId:N,persistence:k,children:he,style:Pe,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,size:W,defaultSize:Y,inset:B}=s,ze=(0,z.extractPaneDomProps)(s,we),t=(0,g.useShell)(),{registerInset:G,unregisterInset:J}=(0,g.useInset)();n.useEffect(()=>{if(B)return G("inspector"),()=>J("inspector")},[B,G,J]);const H=(0,v.useResponsivePresentation)(R),S=H==="overlay",Re=H==="stacked",d=n.useRef(null),Se=n.useCallback(e=>{d.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),Q=n.Children.toArray(he),X=Q.filter(e=>n.isValidElement(e)&&e.type===h.InspectorHandle),Z=Q.filter(e=>!(n.isValidElement(e)&&e.type===h.InspectorHandle)),Ie=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(p),[p]),be=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(c),[c]),Me=typeof p=="object"&&p!==null;(0,v.useResponsiveInitialState)({controlledValue:Ie,defaultValue:be,currentValue:t.inspectorMode,setValue:t.setInspectorMode,breakpointReady:t.currentBreakpointReady,controlledIsResponsive:Me,onResponsiveChange:e=>P?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof p>"u"&&P?.(e==="expanded",{reason:"init"})}});const y=n.useRef(null);n.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[w,D,V]);const I=n.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(o,u)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{e(o,u),y.current=null},a)};if(r==="throttle"){let o=0;return(u,xe)=>{const re=Date.now();re-o>=a&&(o=re,e(u,xe))}}return(o,u)=>e(o,u)},[w,D,V]),b=n.useRef(null);n.useEffect(()=>{const e=typeof p<"u";if(b.current===null){b.current=e;return}b.current!==e&&(console.warn("Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported."),b.current=e)},[p]);const ee=n.useRef(!1),U=n.useRef(null);n.useEffect(()=>{!ee.current&&typeof p>"u"&&c&&t.inspectorMode==="expanded"&&(P?.(!0,{reason:"init"}),ee.current=!0),typeof p>"u"&&(U.current!==null&&U.current!==t.inspectorMode&&P?.(t.inspectorMode==="expanded",{reason:"toggle"}),U.current=t.inspectorMode)},[t.inspectorMode,p,c,P]);const ne=n.useRef(q),te=n.useRef(K);n.useLayoutEffect(()=>{ne.current=q,te.current=K});const M=n.useRef(null),oe=n.useRef(!1);n.useEffect(()=>{const e=t.inspectorMode;if(!t.currentBreakpointReady){M.current=e;return}if(!oe.current){oe.current=!0,M.current=e;return}const r=M.current;r!==null&&r!==e&&(e==="expanded"?ne.current?.():e==="collapsed"&&te.current?.(),M.current=e)},[t.inspectorMode,t.currentBreakpointReady]);const _=t.inspectorMode==="expanded",C=n.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:inspector:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);n.useEffect(()=>{let e=!0;if(!O||!C?.load||S)return;const r=C.load(),a=o=>{!e||typeof o!="number"||!d.current||(d.current.style.setProperty("--inspector-size",`${o}px`),T?.(o))};return r instanceof Promise?r.then(a).catch(o=>{}):a(r),()=>{e=!1}},[O,C,T,S]);const Ce=O&&!S&&_?n.createElement(le.PaneResizeContext.Provider,{value:{containerRef:d,cssVarName:"--inspector-size",minSize:f,maxSize:m,defaultSize:E,orientation:"vertical",edge:"start",computeNext:(e,r,a)=>{const o=getComputedStyle(d.current).direction==="rtl",u=e-r;return a+(o?u:-u)},onResize:T,onResizeStart:de,onResizeEnd:e=>{ue?.(e),I(e,{reason:"resize"}),C?.save?.(e)},target:"inspector",collapsible:pe,snapPoints:fe,snapTolerance:me??8,collapseThreshold:ye,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},X.length>0?X.map((e,r)=>n.cloneElement(e,{key:e.key??r})):n.createElement(h.PaneHandle,null)):null,$=n.useCallback(e=>(0,ce.normalizeToPx)(e,"horizontal"),[]);n.useEffect(()=>{if(d.current&&typeof W>"u"&&typeof Y<"u"){const e=$(Y);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),I(o,{reason:"init"})}}},[]);const L=W;if(n.useEffect(()=>{if(!d.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),I(o,{reason:"controlled"})}},[L,f,m,$,I]),S){const e=t.inspectorMode==="expanded";return n.createElement(j.Root,{open:e,onOpenChange:r=>t.setInspectorMode(r?"expanded":"collapsed")},n.createElement(j.Content,{side:"end",style:{padding:0},width:{initial:`${E}px`}},n.createElement(ae.VisuallyHidden,null,n.createElement(j.Title,null,"Inspector")),Z))}return n.createElement("div",{...ze,ref:Se,className:(0,ie.default)("rt-ShellInspector",l),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":t.currentBreakpointReady?H:void 0,"data-open":t.currentBreakpointReady&&Re&&_||void 0,"data-inset":B||void 0,style:{...Pe,"--inspector-size":`${E}px`,"--inspector-min-size":`${f}px`,"--inspector-max-size":`${m}px`}},n.createElement("div",{className:"rt-ShellInspectorContent","data-visible":_||void 0},Z),Ce)});F.displayName="Shell.Inspector",F.Handle=h.InspectorHandle;
2
2
  //# sourceMappingURL=shell-inspector.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-inspector.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { InspectorHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype InspectorOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype InspectorControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; defaultOpen?: never };\ntype InspectorUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; open?: never };\ntype InspectorSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype InspectorSizeControlledProps = { size: number | string; defaultSize?: never };\ntype InspectorSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype InspectorPublicProps = PaneBaseProps &\n (InspectorControlledProps | InspectorUncontrolledProps) &\n (InspectorSizeControlledProps | InspectorSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: InspectorSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n };\n\ntype InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof InspectorHandle };\n\nconst INSPECTOR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof InspectorPublicProps)[];\n\nexport const Inspector = React.forwardRef<HTMLDivElement, InspectorPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', lg: 'fixed' },\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 320,\n minSize = 200,\n maxSize = 500,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n size,\n defaultSize,\n inset,\n } = initialProps;\n const inspectorDomProps = extractPaneDomProps(initialProps, INSPECTOR_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('inspector');\n return () => unregisterInset('inspector');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === InspectorHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === InspectorHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.inspectorMode,\n setValue: shell.setInspectorMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: InspectorSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: InspectorSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: InspectorSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: InspectorSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Inspector: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n }\n\n // Warn on controlled/uncontrolled mode switch\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastInspectorModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n // Notify init open\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.inspectorMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n\n // Notify toggles when uncontrolled (avoid double-notify after responsive change)\n if (typeof open === 'undefined') {\n if (lastInspectorModeRef.current !== null && lastInspectorModeRef.current !== shell.inspectorMode) {\n onOpenChange?.(shell.inspectorMode === 'expanded', { reason: 'toggle' });\n }\n lastInspectorModeRef.current = shell.inspectorMode;\n }\n }, [shell.inspectorMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevInspectorModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.inspectorMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevInspectorModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevInspectorModeRef.current = currentMode;\n }\n }, [shell.inspectorMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.inspectorMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:inspector:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--inspector-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--inspector-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? delta : -delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'inspector',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setInspectorMode('collapsed'),\n requestToggle: () => shell.togglePane('inspector'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.inspectorMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setInspectorMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"end\" style={{ padding: 0 }} width={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Inspector</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n // Strip control/size props from DOM spread\n return (\n <div\n {...inspectorDomProps}\n ref={setRef}\n className={classNames('rt-ShellInspector', className)}\n data-mode={shell.inspectorMode}\n data-peek={shell.peekTarget === 'inspector' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n ['--inspector-size' as any]: `${expandedSize}px`,\n ['--inspector-min-size' as any]: `${minSize}px`,\n ['--inspector-max-size' as any]: `${maxSize}px`,\n }}\n >\n <div className=\"rt-ShellInspectorContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as InspectorComponent;\n\nInspector.displayName = 'Shell.Inspector';\nInspector.Handle = InspectorHandle;\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,eAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAA4C,8BAC5CC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAoB9B,MAAMC,GAA0B,CAC9B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAAYE,EAAM,WAAiD,CAACY,EAAcC,IAAQ,CACrG,KAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,CAAE,QAAS,UAAW,GAAI,OAAQ,EACjD,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,GAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,GACA,YAAAC,GACA,WAAAC,GACA,cAAAC,GACA,kBAAAC,GACA,OAAAC,EACA,YAAAC,EACA,SAAAC,G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ADP,OAAO7E,GAAY,SAAWA,EAAU,SACpB4E,EAAI,KAAK,KAF7B,OAAO7E,GAAY,SAAWA,EAAU,SAEE6E,EAAIA,CAAE,CAAC,EAC/DhD,EAAS,QAAQ,MAAM,YAAY,mBAAoB,GAAGiD,CAAO,IAAI,EACrEpC,EAAeoC,EAAS,CAAE,OAAQ,YAAa,CAAC,CAClD,CACF,EAAG,CAACC,EAAgB/E,EAASC,EAAS2E,EAAmBlC,CAAc,CAAC,EAEpEf,EAAW,CACb,MAAM9B,EAAO0B,EAAM,gBAAkB,WACrC,OACE3C,EAAA,cAACE,EAAM,KAAN,CAAW,KAAMe,EAAM,aAAemF,GAAMzD,EAAM,iBAAiByD,EAAI,WAAa,WAAW,GAC9FpG,EAAA,cAACE,EAAM,QAAN,CAAc,KAAK,MAAM,MAAO,CAAE,QAAS,CAAE,EAAG,MAAO,CAAE,QAAS,GAAGiB,CAAY,IAAK,GACrFnB,EAAA,cAAC,uBACCA,EAAA,cAACE,EAAM,MAAN,KAAY,WAAS,CACxB,EACCqD,CACH,CACF,CAEJ,CAGA,OACEvD,EAAA,cAAC,OACE,GAAG0C,GACJ,IAAKQ,GACL,aAAW,GAAAmD,SAAW,oBAAqBvF,CAAS,EACpD,YAAW6B,EAAM,cACjB,YAAWA,EAAM,aAAe,aAAe,OAC/C,oBAAmBA,EAAM,uBAAyBG,EAAuB,OACzE,YAAYH,EAAM,wBAA0BK,IAAagC,GAAe,OACxE,aAAYvC,GAAS,OACrB,MAAO,CACL,GAAGN,GACF,mBAA4B,GAAGhB,CAAY,KAC3C,uBAAgC,GAAGC,CAAO,KAC1C,uBAAgC,GAAGC,CAAO,IAC7C,GAEArB,EAAA,cAAC,OAAI,UAAU,2BAA2B,eAAcgF,GAAc,QACnEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EAED3F,EAAU,YAAc,kBACxBA,EAAU,OAAS",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { InspectorHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps, CSSPropertiesWithVars } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype InspectorOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype InspectorControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; defaultOpen?: never };\ntype InspectorUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; open?: never };\ntype InspectorSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype InspectorSizeControlledProps = { size: number | string; defaultSize?: never };\ntype InspectorSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype InspectorPublicProps = PaneBaseProps &\n (InspectorControlledProps | InspectorUncontrolledProps) &\n (InspectorSizeControlledProps | InspectorSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: InspectorSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n };\n\ntype InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof InspectorHandle };\n\nconst INSPECTOR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof InspectorPublicProps)[];\n\nexport const Inspector = React.forwardRef<HTMLDivElement, InspectorPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', lg: 'fixed' },\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 320,\n minSize = 200,\n maxSize = 500,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n size,\n defaultSize,\n inset,\n } = initialProps;\n const inspectorDomProps = extractPaneDomProps(initialProps, INSPECTOR_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('inspector');\n return () => unregisterInset('inspector');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === InspectorHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === InspectorHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.inspectorMode,\n setValue: shell.setInspectorMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: InspectorSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: InspectorSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: InspectorSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: InspectorSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Inspector: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n }\n\n // Warn on controlled/uncontrolled mode switch\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastInspectorModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n // Notify init open\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.inspectorMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n\n // Notify toggles when uncontrolled (avoid double-notify after responsive change)\n if (typeof open === 'undefined') {\n if (lastInspectorModeRef.current !== null && lastInspectorModeRef.current !== shell.inspectorMode) {\n onOpenChange?.(shell.inspectorMode === 'expanded', { reason: 'toggle' });\n }\n lastInspectorModeRef.current = shell.inspectorMode;\n }\n }, [shell.inspectorMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevInspectorModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.inspectorMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevInspectorModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevInspectorModeRef.current = currentMode;\n }\n }, [shell.inspectorMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.inspectorMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:inspector:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--inspector-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--inspector-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? delta : -delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'inspector',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setInspectorMode('collapsed'),\n requestToggle: () => shell.togglePane('inspector'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.inspectorMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setInspectorMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"end\" style={{ padding: 0 }} width={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Inspector</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n // Strip control/size props from DOM spread\n return (\n <div\n {...inspectorDomProps}\n ref={setRef}\n className={classNames('rt-ShellInspector', className)}\n data-mode={shell.inspectorMode}\n data-peek={shell.peekTarget === 'inspector' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n '--inspector-size': `${expandedSize}px`,\n '--inspector-min-size': `${minSize}px`,\n '--inspector-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars}\n >\n <div className=\"rt-ShellInspectorContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as InspectorComponent;\n\nInspector.displayName = 'Shell.Inspector';\nInspector.Handle = InspectorHandle;\n"],
5
+ "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,eAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAA4C,8BAC5CC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAoB9B,MAAMC,GAA0B,CAC9B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAAYE,EAAM,WAAiD,CAACY,EAAcC,IAAQ,CACrG,KAAM,CACJ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AAS,OACrB,MAAO,CACL,GAAGN,GACH,mBAAoB,GAAGhB,CAAY,KACnC,uBAAwB,GAAGC,CAAO,KAClC,uBAAwB,GAAGC,CAAO,IACpC,GAEArB,EAAA,cAAC,OAAI,UAAU,2BAA2B,eAAcgF,GAAc,QACnEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EAED3F,EAAU,YAAc,kBACxBA,EAAU,OAAS",
6
6
  "names": ["shell_inspector_exports", "__export", "Inspector", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_handles", "import_shell_types", "import_shell_prop_helpers", "import_normalize_to_px", "INSPECTOR_DOM_PROP_KEYS", "initialProps", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "size", "defaultSize", "inset", "inspectorDomProps", "shell", "registerInset", "unregisterInset", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "normalizedControlledOpen", "normalizedDefaultOpen", "openIsResponsive", "next", "initial", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "wasControlledRef", "isControlled", "initNotifiedRef", "lastInspectorModeRef", "onExpandRef", "onCollapseRef", "prevInspectorModeRef", "hasInitializedRef", "currentMode", "prevMode", "isExpanded", "persistenceAdapter", "key", "v", "mounted", "loaded", "applyLoaded", "value", "err", "handleEl", "client", "startClient", "startSize", "isRtl", "delta", "i", "normalizeSizeToPx", "px", "clamped", "controlledSize", "o", "classNames"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-prop-helpers.ts"],
4
- "sourcesContent": ["import type { Breakpoint, PaneMode } from '../shell.types.js';\n\ntype KeyList<T> = readonly (keyof T)[];\n\nexport function omitPaneProps<T extends object, K extends KeyList<T>>(source: T, keys: K) {\n const omitSet = new Set<keyof T>(keys as readonly (keyof T)[]);\n const result: Partial<T> = {};\n (Object.keys(source) as Array<keyof T>).forEach((key) => {\n if (!omitSet.has(key)) {\n result[key] = (source as any)[key];\n }\n });\n return result as Omit<T, K[number]>;\n}\n\nconst PANE_BASE_INTERNAL_PROPS = [\n 'presentation',\n 'expandedSize',\n 'minSize',\n 'maxSize',\n 'resizable',\n 'collapsible',\n 'onExpand',\n 'onCollapse',\n 'onResize',\n 'resizer',\n 'onResizeStart',\n 'onResizeEnd',\n 'snapPoints',\n 'snapTolerance',\n 'collapseThreshold',\n 'paneId',\n 'persistence',\n] as const;\n\nexport function extractPaneDomProps<T extends object, Extra extends KeyList<T> | undefined = undefined>(source: T, extraKeys?: Extra) {\n const omitKeys = extraKeys ? [...PANE_BASE_INTERNAL_PROPS, ...extraKeys] : [...PANE_BASE_INTERNAL_PROPS];\n return omitPaneProps(source, omitKeys as ReadonlyArray<keyof T>);\n}\n\nexport function mapResponsiveBooleanToPaneMode(value?: boolean | Partial<Record<Breakpoint, boolean>>): PaneMode | Partial<Record<Breakpoint, PaneMode>> | undefined {\n if (value == null) return undefined;\n if (typeof value === 'object') {\n const mapped: Partial<Record<Breakpoint, PaneMode>> = {};\n (Object.entries(value) as Array<[string, boolean]>).forEach(([bp, val]) => {\n if (typeof val === 'boolean') {\n mapped[bp as Breakpoint] = val ? 'expanded' : 'collapsed';\n }\n });\n return mapped;\n }\n return value ? 'expanded' : 'collapsed';\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,mCAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAL,GAIO,SAASI,EAAsDE,EAAWC,EAAS,CACxF,MAAMC,EAAU,IAAI,IAAaD,CAA4B,EACvDE,EAAqB,CAAC,EAC5B,OAAC,OAAO,KAAKH,CAAM,EAAqB,QAASI,GAAQ,CAClDF,EAAQ,IAAIE,CAAG,IAClBD,EAAOC,CAAG,EAAKJ,EAAeI,CAAG,EAErC,CAAC,EACMD,CACT,CAEA,MAAME,EAA2B,CAC/B,eACA,eACA,UACA,UACA,YACA,cACA,WACA,aACA,WACA,UACA,gBACA,cACA,aACA,gBACA,oBACA,SACA,aACF,EAEO,SAAST,EAAwFI,EAAWM,EAAmB,CACpI,MAAMC,EAAWD,EAAY,CAAC,GAAGD,EAA0B,GAAGC,CAAS,EAAI,CAAC,GAAGD,CAAwB,EACvG,OAAOP,EAAcE,EAAQO,CAAkC,CACjE,CAEO,SAASV,EAA+BW,EAAsH,CACnK,GAAIA,GAAS,KACb,IAAI,OAAOA,GAAU,SAAU,CAC7B,MAAMC,EAAgD,CAAC,EACvD,OAAC,OAAO,QAAQD,CAAK,EAA+B,QAAQ,CAAC,CAACE,EAAIC,CAAG,IAAM,CACrE,OAAOA,GAAQ,YACjBF,EAAOC,CAAgB,EAAIC,EAAM,WAAa,YAElD,CAAC,EACMF,CACT,CACA,OAAOD,EAAQ,WAAa,YAC9B",
4
+ "sourcesContent": ["import type { Breakpoint, PaneMode } from '../shell.types.js';\n\ntype KeyList<T> = readonly (keyof T)[];\n\nexport function omitPaneProps<T extends object, K extends KeyList<T>>(source: T, keys: K) {\n const omitSet = new Set<keyof T>(keys as readonly (keyof T)[]);\n const result: Partial<T> = {};\n (Object.keys(source) as Array<keyof T>).forEach((key) => {\n if (!omitSet.has(key)) {\n result[key] = source[key];\n }\n });\n return result as Omit<T, K[number]>;\n}\n\nconst PANE_BASE_INTERNAL_PROPS = [\n 'presentation',\n 'expandedSize',\n 'minSize',\n 'maxSize',\n 'resizable',\n 'collapsible',\n 'onExpand',\n 'onCollapse',\n 'onResize',\n 'resizer',\n 'onResizeStart',\n 'onResizeEnd',\n 'snapPoints',\n 'snapTolerance',\n 'collapseThreshold',\n 'paneId',\n 'persistence',\n] as const;\n\nexport function extractPaneDomProps<T extends object, Extra extends KeyList<T> | undefined = undefined>(source: T, extraKeys?: Extra) {\n const omitKeys = extraKeys ? [...PANE_BASE_INTERNAL_PROPS, ...extraKeys] : [...PANE_BASE_INTERNAL_PROPS];\n return omitPaneProps(source, omitKeys as ReadonlyArray<keyof T>);\n}\n\nexport function mapResponsiveBooleanToPaneMode(value?: boolean | Partial<Record<Breakpoint, boolean>>): PaneMode | Partial<Record<Breakpoint, PaneMode>> | undefined {\n if (value == null) return undefined;\n if (typeof value === 'object') {\n const mapped: Partial<Record<Breakpoint, PaneMode>> = {};\n (Object.entries(value) as Array<[string, boolean]>).forEach(([bp, val]) => {\n if (typeof val === 'boolean') {\n mapped[bp as Breakpoint] = val ? 'expanded' : 'collapsed';\n }\n });\n return mapped;\n }\n return value ? 'expanded' : 'collapsed';\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,mCAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAL,GAIO,SAASI,EAAsDE,EAAWC,EAAS,CACxF,MAAMC,EAAU,IAAI,IAAaD,CAA4B,EACvDE,EAAqB,CAAC,EAC5B,OAAC,OAAO,KAAKH,CAAM,EAAqB,QAASI,GAAQ,CAClDF,EAAQ,IAAIE,CAAG,IAClBD,EAAOC,CAAG,EAAIJ,EAAOI,CAAG,EAE5B,CAAC,EACMD,CACT,CAEA,MAAME,EAA2B,CAC/B,eACA,eACA,UACA,UACA,YACA,cACA,WACA,aACA,WACA,UACA,gBACA,cACA,aACA,gBACA,oBACA,SACA,aACF,EAEO,SAAST,EAAwFI,EAAWM,EAAmB,CACpI,MAAMC,EAAWD,EAAY,CAAC,GAAGD,EAA0B,GAAGC,CAAS,EAAI,CAAC,GAAGD,CAAwB,EACvG,OAAOP,EAAcE,EAAQO,CAAkC,CACjE,CAEO,SAASV,EAA+BW,EAAsH,CACnK,GAAIA,GAAS,KACb,IAAI,OAAOA,GAAU,SAAU,CAC7B,MAAMC,EAAgD,CAAC,EACvD,OAAC,OAAO,QAAQD,CAAK,EAA+B,QAAQ,CAAC,CAACE,EAAIC,CAAG,IAAM,CACrE,OAAOA,GAAQ,YACjBF,EAAOC,CAAgB,EAAIC,EAAM,WAAa,YAElD,CAAC,EACMF,CACT,CACA,OAAOD,EAAQ,WAAa,YAC9B",
6
6
  "names": ["shell_prop_helpers_exports", "__export", "extractPaneDomProps", "mapResponsiveBooleanToPaneMode", "omitPaneProps", "__toCommonJS", "source", "keys", "omitSet", "result", "key", "PANE_BASE_INTERNAL_PROPS", "extraKeys", "omitKeys", "value", "mapped", "bp", "val"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shell-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/shell-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,aAAa,EAAc,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAA+C,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAInJ,KAAK,gBAAgB,GAAG,aAAa,GAAG;IACtC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAA;CAAE,CAAC;AAC3E,KAAK,sBAAsB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AACnK,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