@aiquants/resize-panels 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -22
- package/dist/GlobalDebugOverlay-Cf3GOn2A.cjs +1 -0
- package/dist/{GlobalDebugOverlay-Do70T2l6.js → GlobalDebugOverlay-DQtUdNeF.js} +28 -28
- package/dist/debugOverlayStore-D7FT6zPE.js +135 -0
- package/dist/debugOverlayStore-DY09saU8.cjs +1 -0
- package/dist/index-DZ0itiBD.js +1299 -0
- package/dist/index-DqATP_BA.cjs +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -29
- package/dist/index.js +25 -13
- package/dist/src/GlobalDebugOverlay.d.ts.map +1 -0
- package/dist/src/Panel.d.ts +46 -0
- package/dist/src/Panel.d.ts.map +1 -0
- package/dist/src/PanelDebugInfo.d.ts +34 -0
- package/dist/src/PanelDebugInfo.d.ts.map +1 -0
- package/dist/src/PanelGroup.d.ts.map +1 -0
- package/dist/src/PanelResizeHandle.d.ts.map +1 -0
- package/dist/src/allocateLayout.d.ts +60 -0
- package/dist/src/allocateLayout.d.ts.map +1 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/{debugOverlayStore.d.ts → src/debugOverlayStore.d.ts} +10 -2
- package/dist/src/debugOverlayStore.d.ts.map +1 -0
- package/dist/src/hooks.d.ts +48 -0
- package/dist/src/hooks.d.ts.map +1 -0
- package/dist/src/index.d.ts +32 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/reducer.d.ts +49 -0
- package/dist/src/reducer.d.ts.map +1 -0
- package/dist/src/roundHalfToEven.d.ts.map +1 -0
- package/dist/{types.d.ts → src/types.d.ts} +164 -60
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils/simple-logger.d.ts.map +1 -0
- package/dist/src/utils.d.ts +164 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/styles/resize-panels.standalone.css +1 -1
- package/dist/tests/support/dom-harness.d.ts +89 -0
- package/dist/tests/support/dom-harness.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/GlobalDebugOverlay.tsx +3 -3
- package/src/Panel.tsx +203 -541
- package/src/PanelDebugInfo.tsx +52 -106
- package/src/PanelGroup.tsx +27 -42
- package/src/PanelResizeHandle.tsx +470 -509
- package/src/allocateLayout.ts +412 -0
- package/src/debugOverlayStore.ts +19 -15
- package/src/hooks.ts +187 -779
- package/src/index.ts +12 -3
- package/src/reducer.ts +364 -1126
- package/src/types.ts +149 -63
- package/src/utils.ts +205 -164
- package/dist/GlobalDebugOverlay-sEQN6exo.cjs +0 -1
- package/dist/GlobalDebugOverlay.d.ts.map +0 -1
- package/dist/Panel.d.ts +0 -7
- package/dist/Panel.d.ts.map +0 -1
- package/dist/PanelDebugInfo.d.ts +0 -26
- package/dist/PanelDebugInfo.d.ts.map +0 -1
- package/dist/PanelGroup.d.ts.map +0 -1
- package/dist/PanelResizeHandle.d.ts.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/debugOverlayStore-Cntyxboe.js +0 -141
- package/dist/debugOverlayStore-Dkl-fHoa.cjs +0 -1
- package/dist/debugOverlayStore.d.ts.map +0 -1
- package/dist/hooks.d.ts +0 -45
- package/dist/hooks.d.ts.map +0 -1
- package/dist/index-B6YGX2DH.js +0 -2009
- package/dist/index-DssZUxGw.cjs +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/reducer.d.ts +0 -39
- package/dist/reducer.d.ts.map +0 -1
- package/dist/roundHalfToEven.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/simple-logger.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -61
- package/dist/utils.d.ts.map +0 -1
- /package/dist/{GlobalDebugOverlay.d.ts → src/GlobalDebugOverlay.d.ts} +0 -0
- /package/dist/{PanelGroup.d.ts → src/PanelGroup.d.ts} +0 -0
- /package/dist/{PanelResizeHandle.d.ts → src/PanelResizeHandle.d.ts} +0 -0
- /package/dist/{context.d.ts → src/context.d.ts} +0 -0
- /package/dist/{roundHalfToEven.d.ts → src/roundHalfToEven.d.ts} +0 -0
- /package/dist/{utils → src/utils}/simple-logger.d.ts +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const s=require("react"),_=require("react/jsx-runtime"),Re=require("tailwind-merge"),yn=12,N=1e-6,Vn=8,Kn=6,qn=48,Yn=80,Xn=2,Zn=32,Jn=64,Qn=8,et=8,hn=10,En=.05,wn=10,nt=.05,tt=20,rt=.05,ot=(e,n=0)=>{if(!Number.isFinite(e))return e;const t=10**n,r=e*t,o=Math.floor(r),i=r-o,l=Number.EPSILON*Math.max(1,Math.abs(r));return i<.5-l?o/t:i>.5+l?(o+1)/t:(o%2===0?o:o+1)/t},it=6,qe=(e,n)=>n<=0?0:ot(e/n*100,it),st=(e,n)=>n<=0?0:e/100*n,Rn=(e,n="percentage")=>{if(e!==void 0)return typeof e=="number"?{value:e,unit:n}:e},$e=(e,n,t)=>e===void 0?n:typeof e=="number"?e/100*t:e.unit==="pixels"?e.value:e.value/100*t,Ie=(e,n,t)=>Math.min(Math.max(e,n),t),Ye=e=>!Number.isFinite(e)||e<=0?0:Math.max(0,Math.min(yn,wn,e*En)),ue=e=>{if(!e)return 0;const n=Number.parseFloat(e);return Number.isFinite(n)?n:0},be=(e,n,t)=>{const r=n==="horizontal",o=typeof window<"u"?window.getComputedStyle(e):null,i=o?r?ue(o.paddingLeft)+ue(o.paddingRight):ue(o.paddingTop)+ue(o.paddingBottom):0,l=o?r?ue(o.borderLeftWidth)+ue(o.borderRightWidth):ue(o.borderTopWidth)+ue(o.borderBottomWidth):0,a=t?.contentBoxSize?.[0],d=a?r?a.inlineSize:a.blockSize:void 0,u=r?e.clientWidth:e.clientHeight,x=u>0?Math.max(0,u-i):Math.max(0,(r?e.offsetWidth:e.offsetHeight)-i-l),c=d??x;return{content:Math.max(0,c),border:Math.max(0,c+i+l)}},lt="[data-panel-group-direction]",je="[data-panel-id], [data-resize-handle-anchor]",at="[data-panel-id]",Me=e=>e?.closest(lt)??null,Xe=e=>Array.from(e.querySelectorAll(je)).filter(n=>{if(Me(n)!==e)return!1;const t=n.parentElement?.closest(at);return!(t&&e.contains(t))}),ct=e=>{const n=t=>{for(const r of Array.from(t))if(r instanceof Element&&(r.matches(je)||r.querySelector(je)!==null))return!0;return!1};return e.some(t=>n(t.addedNodes)||n(t.removedNodes))},ut=(e,n)=>{if(typeof window>"u")return 1;const t=n==="horizontal",r=e.getBoundingClientRect(),o=t?r.width:r.height,i=window.getComputedStyle(e),l=t?i.width:i.height;if(!l.endsWith("px"))return 1;const a=Number.parseFloat(l);return o>0&&Number.isFinite(a)&&a>0?o/a:1},Ue=(e,n)=>{try{localStorage.setItem(`panel-layout-${e}`,JSON.stringify(n))}catch(t){console.warn("Failed to save panel layout:",t)}},Mn=e=>{try{const n=localStorage.getItem(`panel-layout-${e}`);if(!n)return null;const t=JSON.parse(n);if(!Array.isArray(t))return null;const r=o=>typeof o=="object"&&o!==null&&typeof o.id=="string"&&Number.isFinite(o.size);return t.every(r)?t:null}catch(n){return console.warn("Failed to load panel layout:",n),null}},We=0,In=1,_e=e=>Number.isFinite(e)&&e>0?e:0,Z=e=>e.sizeUnit==="pixels",de=(e,n)=>{const t=Math.max(0,_e($e(e.minSize,0,n))),r=Math.max(t,_e($e(e.maxSize,n,n)));return{min:t,max:r}},dt=(e,n)=>{const t=e.map(o=>o.min),r=e.map(()=>!1);for(;;){let o=0,i=0,l=0;for(let c=0;c<e.length;c+=1){if(r[c]){i+=t[c];continue}l+=1,o+=e[c].weight}if(l===0)return t;const a=n-i;if(o<=0){for(let c=0;c<e.length;c+=1)r[c]||(t[c]=e[c].min);return t}const d=Math.max(0,a/o);let u=0;for(let c=0;c<e.length;c+=1){if(r[c])continue;const I=d*e[c].weight,h=Ie(I,e[c].min,e[c].max);t[c]=h,u+=h-I}let x=!1;for(let c=0;c<e.length;c+=1){if(r[c])continue;const I=d*e[c].weight;u>N&&t[c]>I+N?(r[c]=!0,t[c]=e[c].min,x=!0):u<-N&&t[c]<I-N&&(r[c]=!0,t[c]=e[c].max,x=!0)}if(!x)return t}},pt=(e,n,t)=>{const{min:r,max:o}=de(e,t);if(Z(e))return{index:n,weight:0,target:Ie(_e(e.preferredPixelSize),r,o),priority:e.pixelAdjustPriority??0,tier:We,min:r,max:o};const i=_e(e.preferredPercentageSize),l=e.flexAdjustPriority!==void 0;return{index:n,weight:i,target:l?Ie(i/100*t,r,o):null,priority:e.flexAdjustPriority??0,tier:In,min:r,max:o}},mn=(e,n,t,r)=>{let o=r;for(const i of e){if(o<=N)break;const l=t(i)-n[i.index];if(l<=0)continue;const a=Math.min(l,o);n[i.index]+=a,o-=a}return o},Ve=(e,n,t)=>{if(e.length===0||t<=N)return t;const r=e.map(l=>({...l,min:n[l.index]})),o=dt(r,t+r.reduce((l,a)=>l+a.min,0));let i=0;for(let l=0;l<e.length;l+=1)i+=o[l]-n[e[l].index],n[e[l].index]=o[l];return t-i},ft=(e,n,t)=>Ve(e.map(r=>({...r,weight:1})),n,t),ht=(e,n)=>e.tier!==n.tier?e.tier-n.tier:e.priority!==n.priority?n.priority-e.priority:e.index-n.index,Cn=(e,n)=>{const t=e.map(()=>0);if(!Number.isFinite(n)||n<=0||e.length===0)return{sizes:t,violation:null};const r=[];for(let h=0;h<e.length;h+=1){const A=e[h];A.collapsed||r.push(pt(A,h,n))}if(r.length===0)return{sizes:t,violation:null};let o=0,i=0;for(const h of r)t[h.index]=h.min,o+=h.min,i+=h.max;const l=mt(o,i,n);let a=n-o;if(a<=N)return{sizes:t,violation:l};const d=r.filter(h=>h.target!==null).sort(ht),u=r.filter(h=>h.target===null&&h.weight>0),x=r.filter(h=>h.tier!==We&&h.weight<=0),c=d.filter(h=>h.tier===In),I=d.filter(h=>h.tier===We);return a=mn(d,t,h=>h.target??h.min,a),a=Ve(u,t,a),a=Ve(c,t,a),a=mn(I,t,h=>h.max,a),a=ft(x,t,a),{sizes:t,violation:l}},mt=(e,n,t)=>e-t>N?{reason:"minimum-exceeded",totalMinimumSize:e,totalMaximumSize:n,availableContainerSize:t}:t-n>N?{reason:"maximum-insufficient",totalMinimumSize:e,totalMaximumSize:n,availableContainerSize:t}:null,Ze=s.createContext(null),Ae=()=>{const e=s.useContext(Ze);if(!e)throw new Error("usePanelGroup must be used within a PanelGroup");return e};var De=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE",e))(De||{});const X=class X{constructor(n=2,t="[resize-panels]",r=console){this.level=n,this.prefix=t,this.impl=r,X.instances.add(this)}static setLevel(n){for(const t of X.instances)t.setLevel(n)}setLevel(n){this.level=n}static setImplementation(n){for(const t of X.instances)t.setImplementation(n)}setImplementation(n){this.impl=n}static setPrefix(n){for(const t of X.instances)t.setPrefix(n)}setPrefix(n){this.prefix=n}enabledFor(n){return this.level<=n}formatMessage(n){return typeof n=="string"?[`${this.prefix} ${n}`]:[this.prefix,n]}static debug(n,...t){X.instance.debug(n,...t)}debug(n,...t){this.level<=0&&this.impl.debug(...this.formatMessage(n),...t)}static info(n,...t){X.instance.info(n,...t)}info(n,...t){this.level<=1&&this.impl.info(...this.formatMessage(n),...t)}static warn(n,...t){X.instance.warn(n,...t)}warn(n,...t){this.level<=2&&this.impl.warn(...this.formatMessage(n),...t)}static error(n,...t){X.instance.error(n,...t)}error(n,...t){this.level<=3&&this.impl.error(...this.formatMessage(n),...t)}};X.instances=new Set,X.instance=new X(2,"[resize-panels]");let Ce=X;const vn=new Ce(De.INFO,"[resize-panels]"),Nn={containerSize:0,panels:[],violation:null},gn=(e,n)=>e===null||n===null?e===n:e.reason===n.reason&&Math.abs(e.totalMinimumSize-n.totalMinimumSize)<=N&&Math.abs(e.totalMaximumSize-n.totalMaximumSize)<=N&&Math.abs(e.availableContainerSize-n.availableContainerSize)<=N,se=(e,n)=>{const{sizes:t,violation:r}=Cn(e,n);let o=!1;const i=e.map((a,d)=>{const u=a.collapsed?0:t[d];return Math.abs(a.size-u)<=N?a:(o=!0,{...a,size:u})}),l={containerSize:n,panels:o?i:e,violation:r};return gt(l),l},Ln=e=>{if(e.containerSize<=0||e.violation!==null)return null;let n=0,t=0;for(const o of e.panels)o.collapsed||(n+=o.size,t+=1);if(t===0)return null;const r=N*Math.max(1,e.containerSize);return!Number.isFinite(n)||Math.abs(n-e.containerSize)>r?{allocatedTotal:n,containerSize:e.containerSize}:null},gt=e=>{const n=Ln(e);n&&vn.error("Allocated sizes do not fill the container.",{...n,panels:e.panels.map(t=>({id:t.id,size:t.size,collapsed:t.collapsed}))})},le=(e,n)=>e.panels===n.panels&&e.containerSize===n.containerSize&&gn(e.violation,n.violation)?e:{containerSize:n.containerSize,panels:n.panels,violation:gn(e.violation,n.violation)?e.violation:n.violation},xt=(e,n)=>{const t=e.sizeUnit==="pixels"?e.preferredPixelSize:e.preferredPercentageSize;return{...e,size:0,collapsed:e.collapsed,collapsedByDirection:e.collapsed?n:null,preferenceBeforeCollapse:t,authoredPreference:t}},Ge=e=>e.collapseFromStart?"start":e.collapseFromEnd?"end":null,bt=(e,n)=>{if(n<=0)return e;const t=Ye(n);return e.map(r=>{if(r.collapsed)return r;const o=Z(r)?r.size:r.size/n*100,i=Z(r)?r.preferredPixelSize:r.preferredPercentageSize,l=r.size>t?o:r.preferenceBeforeCollapse;return i===o&&l===r.preferenceBeforeCollapse?r:Z(r)?{...r,preferredPixelSize:o,preferenceBeforeCollapse:l}:{...r,preferredPercentageSize:o,preferenceBeforeCollapse:l}})},Ke=(e,n,t)=>{if(Z(e)){const o=Math.max(0,n);return{...e,preferredPixelSize:o,preferenceBeforeCollapse:o}}if(t<=0)return e;const r=Math.max(0,n/t*100);return{...e,preferredPercentageSize:r,preferenceBeforeCollapse:r}},_n=(e,n)=>{const t=e.collapsed?e.preferenceBeforeCollapse:Z(e)?e.preferredPixelSize:e.preferredPercentageSize;return Z(e)?t:t/100*n},St=(e,n,t,r)=>{const o=Math.max(0,Math.min(t,r)),i=e.filter(u=>u.id!==n&&!u.collapsed&&!Z(u)),l=e.reduce((u,x)=>x.id!==n&&!x.collapsed&&Z(x)?u+x.size:u,0),a=i.reduce((u,x)=>u+x.size,0),d=Math.max(0,r-o-l);return e.map(u=>{if(u.id===n)return Ke(u,o,r);if(u.collapsed||Z(u)||i.length===0)return u;const x=a>0?u.size/a*d:d/i.length;return Ke(u,x,r)})},An=(e,n)=>{switch(n.type){case"SET_CONTAINER_SIZE":return!Number.isFinite(n.containerSize)||n.containerSize<0||n.containerSize===e.containerSize?e:le(e,se(e.panels,n.containerSize));case"REGISTER_PANEL":{const t=e.panels.findIndex(c=>c.id===n.panel.id);if(t===-1){const c=[...e.panels,xt(n.panel,Ge(n.panel))];return le(e,se(c,e.containerSize))}const r=e.panels[t],o=n.panel.sizeUnit==="pixels"?n.panel.preferredPixelSize:n.panel.preferredPercentageSize,i=o!==r.authoredPreference||n.panel.sizeUnit!==r.sizeUnit,l=r.collapsedByDirection==="start"?n.panel.collapseFromStart:r.collapsedByDirection==="end"?n.panel.collapseFromEnd:!1,a=n.panel.collapseFromStart||n.panel.collapseFromEnd,d=r.collapsed&&a,u={...r,...n.panel,collapsed:d,collapsedByDirection:d?l?r.collapsedByDirection:Ge(n.panel):null,preferredPercentageSize:i?n.panel.preferredPercentageSize:r.preferredPercentageSize,preferredPixelSize:i?n.panel.preferredPixelSize:r.preferredPixelSize,preferenceBeforeCollapse:i?o:r.preferenceBeforeCollapse,authoredPreference:o},x=[...e.panels];return x[t]=u,le(e,se(x,e.containerSize))}case"UNREGISTER_PANEL":{const t=e.panels.filter(r=>r.id!==n.id);return t.length===e.panels.length?e:le(e,se(t,e.containerSize))}case"REORDER_PANELS":{if(n.ids.length!==e.panels.length||new Set(n.ids).size!==n.ids.length)return e;const t=new Map(e.panels.map(o=>[o.id,o])),r=[];for(const o of n.ids){const i=t.get(o);if(!i)return e;r.push(i)}return r.every((o,i)=>o===e.panels[i])?e:le(e,se(r,e.containerSize))}case"RESIZE_PANELS":{const t=e.panels.findIndex(A=>A.id===n.startId),r=e.panels.findIndex(A=>A.id===n.endId);if(t===-1||r===-1)return e;const o=e.panels[t],i=e.panels[r];if(o.collapsed||i.collapsed||e.containerSize<=0||!Number.isFinite(n.startSize))return e;const l=o.size+i.size,a=de(o,e.containerSize),d=de(i,e.containerSize),u=Math.max(a.min,l-d.max),x=Math.min(a.max,l-d.min);if(u-x>N)return e;const c=Ie(n.startSize,u,Math.max(u,x)),I=l-c;if(Math.abs(c-o.size)<=N)return e;const h=[...e.panels];return h[t]={...o,size:c},h[r]={...i,size:I},le(e,se(bt(h,e.containerSize),e.containerSize))}case"COLLAPSE_PANEL":{const t=e.panels.findIndex(l=>l.id===n.id);if(t===-1)return e;const r=e.panels[t];if(!(n.from==="start"?r.collapseFromStart:r.collapseFromEnd)||r.collapsed)return e;const i=[...e.panels];return i[t]={...r,collapsed:!0,collapsedByDirection:n.from},le(e,se(i,e.containerSize))}case"EXPAND_PANEL":{const t=e.panels.findIndex(d=>d.id===n.id);if(t===-1||n.targetSize!==void 0&&e.containerSize<=0)return e;const r=e.panels[t];if(!((n.from==="start"?r.collapseFromStart:r.collapseFromEnd)&&r.collapsed)||r.collapsedByDirection!==null&&r.collapsedByDirection!==n.from)return e;const i={...r,collapsed:!1,collapsedByDirection:null,preferredPixelSize:Z(r)?r.preferenceBeforeCollapse:r.preferredPixelSize,preferredPercentageSize:Z(r)?r.preferredPercentageSize:r.preferenceBeforeCollapse},l=[...e.panels];l[t]=i;const a=n.targetSize===void 0?l:St(l,n.id,n.targetSize,e.containerSize);return le(e,se(a,e.containerSize))}case"RESTORE_LAYOUT":{if(n.entries.length!==e.panels.length||e.containerSize<=0)return e;const t=new Map(n.entries.map(o=>[o.id,o]));if(e.panels.some(o=>!t.has(o.id)))return e;const r=e.panels.map(o=>{const i=t.get(o.id);if(!i)return o;const l=Ke(o,i.size,e.containerSize),a=o.collapseFromStart||o.collapseFromEnd;return i.collapsed&&a?{...l,collapsed:!0,collapsedByDirection:o.collapsedByDirection??Ge(o)}:l.collapsed?{...l,collapsed:!1,collapsedByDirection:null}:l});return vn.debug("restore layout",{containerSize:e.containerSize,entries:n.entries}),le(e,se(r,e.containerSize))}default:return e}},zt=new Ce(De.INFO,"[resize-panels]"),Pt=200,yt="\0handle",Dn=({direction:e,style:n,onLayout:t,autoSaveId:r,showDebugInfo:o=!1})=>{const[i,l]=s.useReducer(An,Nn),[a,d]=s.useState({}),[u,x]=s.useState({}),c=s.useRef(null),[I,h]=s.useState(""),A=s.useRef({}),K=s.useRef(t);K.current=t,s.useLayoutEffect(()=>{const p=c.current;if(!p||typeof ResizeObserver>"u")return;let f=Number.NaN;const m=v=>{v!==f&&(f=v,l({type:"SET_CONTAINER_SIZE",containerSize:v}))},P=new ResizeObserver(v=>{m(be(p,e,v[0]).content)});return P.observe(p),m(be(p,e).content),()=>{P.disconnect()}},[e]);const C=i.panels,H=s.useRef(C);H.current=C;const k=s.useCallback(()=>{const p=c.current,f=H.current;if(!p)return;const m=Xe(p);if(h(v=>{const oe=m.map(pe=>pe.dataset.panelId??yt).join("\0");return v===oe?v:oe}),f.length===0)return;const P=[];for(const v of m){const oe=v.dataset.panelId;oe!==void 0&&P.push(oe)}if(new Set(P).size!==P.length){zt.error("Duplicate panel id in one group.",{ids:P});return}P.length!==f.length||P.every((v,oe)=>v===f[oe].id)||l({type:"REORDER_PANELS",ids:P})},[]);s.useLayoutEffect(()=>{const p=c.current;if(!p||(k(),typeof MutationObserver>"u"))return;const f=new MutationObserver(m=>{ct(m)&&k()});return f.observe(p,{childList:!0,subtree:!0}),()=>{f.disconnect()}},[k]),s.useLayoutEffect(()=>{k()},[k,C]);const S=s.useMemo(()=>C.map(p=>p.size),[C]),L=i.containerSize>0;s.useLayoutEffect(()=>{!L||S.length===0||K.current?.(S)},[S,L]);const E=s.useRef(null);s.useEffect(()=>{if(!r||E.current===r||!L||C.length===0)return;E.current=r;const p=Mn(r);p&&l({type:"RESTORE_LAYOUT",entries:p})},[r,L,C.length]);const W=s.useRef(null);s.useEffect(()=>{if(!(r&&E.current===r&&L)||C.length===0)return;const p=C.map(m=>({id:m.id,size:_n(m,i.containerSize),collapsed:m.collapsed}));W.current={id:r,entries:p};const f=setTimeout(()=>{W.current=null,Ue(r,p)},Pt);return()=>{clearTimeout(f)}},[r,C,i.containerSize,L]),s.useEffect(()=>()=>{const p=W.current;p&&(W.current=null,Ue(p.id,p.entries))},[]);const w=s.useCallback(p=>{const f=JSON.stringify(p);A.current[p.id]!==f&&(A.current[p.id]=f,l({type:"REGISTER_PANEL",panel:p}))},[]),D=s.useCallback(p=>{delete A.current[p],l({type:"UNREGISTER_PANEL",id:p}),d(f=>{if(!(p in f))return f;const m={...f};return delete m[p],m})},[]),M=s.useCallback((p,f,m)=>{l({type:"RESIZE_PANELS",startId:p,endId:f,startSize:m})},[]),J=s.useCallback((p,f)=>{l({type:"COLLAPSE_PANEL",id:p,from:f})},[]),O=s.useCallback((p,f,m)=>{l({type:"EXPAND_PANEL",id:p,from:f,targetSize:m})},[]),z=s.useCallback(p=>C.find(f=>f.id===p),[C]),b=s.useCallback((p,f)=>{d(m=>{if(f===null){if(!(p in m))return m;const v={...m};return delete v[p],v}const P=m[p];return P&&P.pixelSize===f.pixelSize&&P.percentageSize===f.percentageSize?m:{...m,[p]:f}})},[]),j=s.useCallback((p,f)=>{x(m=>{if(f===null){if(!(p in m))return m;const v={...m};return delete v[p],v}const P=m[p];return P&&P.thickness===f.thickness&&P.visible===f.visible&&P.direction===f.direction&&P.startPanelId===f.startPanelId&&P.endPanelId===f.endPanelId?m:{...m,[p]:f}})},[]),G=s.useMemo(()=>({direction:e,panels:C,containerSize:i.containerSize,layoutOrderKey:I,showDebugInfo:o,registerPanel:w,unregisterPanel:D,resizePanels:M,collapsePanel:J,expandPanel:O,getPanel:z,reportPanelMeasurement:b,panelMeasurements:a,reportHandleMeasurement:j,handleMeasurements:u,layoutConstraintViolation:i.violation}),[e,C,i.containerSize,I,i.violation,o,w,D,M,J,O,z,b,a,j,u]),q=s.useMemo(()=>({width:"100%",height:"100%",minWidth:"0px",minHeight:"0px",overflow:"hidden",...n,display:"flex",flexDirection:e==="horizontal"?"row":"column",alignItems:"stretch",gap:"0px",position:"relative",boxSizing:"border-box",writingMode:"horizontal-tb"}),[e,n]);return{groupRef:c,contextValue:G,groupStyle:q}},Et=e=>{const{getPanel:n,collapsePanel:t,expandPanel:r}=Ae(),o=n(e),i=s.useCallback(d=>{t(e,d)},[t,e]),l=s.useCallback((d,u)=>{r(e,d,u)},[r,e]),a=s.useCallback((d,u)=>{o?.collapsed?l(d,u):i(d)},[o?.collapsed,i,l]);return s.useMemo(()=>({panel:o,isCollapsed:o?.collapsed??!1,canCollapseFromStart:o?.collapseFromStart??!1,canCollapseFromEnd:o?.collapseFromEnd??!1,collapse:i,expand:l,toggle:a}),[o,i,l,a])},wt=({panel:e,containerAxisSize:n,containerLabel:t})=>{if(!e)return{sizeDisplay:"-",preferenceDisplay:"-",boundsDisplay:"-",containerDisplay:"-",headlineLabel:"Unregistered",titleText:"Unregistered"};const r=e.sizeUnit==="pixels",o=`${e.size.toFixed(3)}px / ${qe(e.size,n).toFixed(3)}%`,i=r?`${e.preferredPixelSize.toFixed(3)}px`:`${e.preferredPercentageSize.toFixed(3)}%`,l=de(e,n),a=`${l.min.toFixed(1)} - ${l.max.toFixed(1)}px`,d=Number.isFinite(n)?`${n.toFixed(3)}px`:"-",u=r?"Fixed":"Flexible",x=[u,`${t}: ${d}`,`size: ${o}`,`preference: ${i}`,`bounds: ${a}`].join(`
|
|
2
|
+
`);return{sizeDisplay:o,preferenceDisplay:i,boundsDisplay:a,containerDisplay:d,headlineLabel:u,titleText:x}},Rt=s.memo(({panel:e,containerAxisSize:n,direction:t})=>{const r=t==="horizontal"?"container width":"container height",{sizeDisplay:o,preferenceDisplay:i,boundsDisplay:l,containerDisplay:a,headlineLabel:d,titleText:u}=s.useMemo(()=>wt({panel:e,containerAxisSize:n,containerLabel:r}),[e,n,r]),x={position:"absolute",top:2,left:2,zIndex:30,pointerEvents:"none",maxWidth:"calc(100% - 4px)",padding:"2px 4px",borderRadius:4,border:"1px solid rgba(255,255,255,0.1)",backgroundColor:"rgba(15, 23, 42, 0.78)",color:"#e2e8f0",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:10,lineHeight:1.35,whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"};return _.jsxs("div",{style:x,title:u,"data-panel-debug-info":"",children:[_.jsxs("div",{children:[d," · ",r,": ",a]}),_.jsxs("div",{children:["size: ",o]}),_.jsxs("div",{children:["preference: ",i]}),_.jsxs("div",{children:["bounds: ",l]})]})}),xn=new Ce(De.INFO,"[resize-panels]"),Mt={both:{collapseFromStart:!0,collapseFromEnd:!0},start:{collapseFromStart:!0,collapseFromEnd:!1},end:{collapseFromStart:!1,collapseFromEnd:!0}},It=e=>{if(!e)return{collapseFromStart:!1,collapseFromEnd:!1};const n=Mt[e.from];if(!n)throw new Error("Invalid collapsible configuration: unsupported 'from' value");return n},Ct=e=>{const n=Math.max(0,e.value);return e.unit==="pixels"?{sizeUnit:"pixels",preferredPixelSize:n,preferredPercentageSize:0}:{sizeUnit:"percentage",preferredPercentageSize:n,preferredPixelSize:0}},vt=({size:e,panel:n,registration:t,containerSize:r,isCollapsed:o})=>{if(o)return{flexBasis:"0px",flexGrow:0,flexShrink:0};if(!n||r<=0){const d=t.sizeUnit==="pixels";return{flexBasis:d?`${t.preferredPixelSize}px`:`${t.preferredPercentageSize}%`,flexGrow:d?0:t.preferredPercentageSize,flexShrink:d?0:1}}if(n.sizeUnit==="pixels")return{flexBasis:`${e}px`,flexGrow:0,flexShrink:0};const i=de(n,r),l=e<i.max-N,a=l&&e>i.min+N;return{flexBasis:`${e}px`,flexGrow:l?n.preferredPercentageSize:0,flexShrink:a?1:0}},Nt=s.memo(({id:e,defaultSize:n={value:50,unit:"percentage"},minSize:t,maxSize:r,className:o,style:i,children:l,collapsible:a,defaultCollapsed:d=!1,pixelAdjustPriority:u,flexAdjustPriority:x,contentOverflow:c="auto",...I})=>{const{direction:h,registerPanel:A,unregisterPanel:K,getPanel:C,containerSize:H,showDebugInfo:k,reportPanelMeasurement:S}=Ae(),L=s.useRef(null),E=s.useId(),w=s.useRef(e||`panel-${E}`).current;s.useEffect(()=>{e&&e!==w&&xn.warn("Panel id prop change after mount is ignored.",{currentId:w,attemptedId:e})},[e,w]);const D=s.useMemo(()=>It(a),[a]),M=D.collapseFromStart||D.collapseFromEnd;s.useEffect(()=>{d&&!M&&xn.warn("Panel defaultCollapsed is ignored because collapsible configuration is not provided.",{panelId:w})},[d,M,w]);const J=s.useMemo(()=>{const f=Rn(n)??{value:50,unit:"percentage"};return{id:w,...Ct(f),minSize:t,maxSize:r,...D,collapsed:M&&d,pixelAdjustPriority:u,flexAdjustPriority:x}},[w,n,t,r,D,M,d,u,x]);s.useLayoutEffect(()=>{A(J)},[A,J]),s.useLayoutEffect(()=>()=>{K(w)},[K,w]);const O=C(w),z=O?.size??0,b=O?.collapsed??!1,j=s.useRef(H);j.current=H;const G=s.useCallback(()=>{const f=L.current;if(!f)return;const m=be(f,h).border;S(w,{pixelSize:m,percentageSize:qe(m,j.current)})},[h,w,S]);s.useEffect(()=>{if(!k){S(w,null);return}const f=L.current;if(!f||typeof ResizeObserver>"u"){G();return}const m=new ResizeObserver(G);return m.observe(f),G(),()=>{m.disconnect(),S(w,null)}},[k,G,w,S]);const q=s.useMemo(()=>{const f={overflow:"hidden",isolation:"isolate"},m=b?{...h==="horizontal"?{width:"0px"}:{height:"0px"},pointerEvents:"none",visibility:"hidden",display:"none"}:{};return{...f,...i,...vt({size:z,panel:O,registration:J,containerSize:H,isCollapsed:b}),order:0,margin:0,display:"flex",flexDirection:"column",position:"relative",boxSizing:"border-box",minWidth:0,minHeight:0,maxWidth:"none",maxHeight:"none",...h==="horizontal"?{height:"100%"}:{width:"100%"},...m}},[z,h,b,O,J,H,i]),p=s.useMemo(()=>({flex:"1 1 auto",position:"relative",overflow:c,display:"flex",flexDirection:"column",minWidth:"0px",minHeight:"0px"}),[c]);return _.jsxs("div",{...I,ref:L,className:Re.twMerge("panel",o),style:q,"data-panel-id":w,"data-panel-size":z,"data-panel-size-unit":O?.sizeUnit??"percentage","data-panel-collapsible":M,"data-panel-collapse-start":D.collapseFromStart,"data-panel-collapse-end":D.collapseFromEnd,"data-panel-collapsed":b,"aria-hidden":b,children:[_.jsx("div",{style:p,children:l}),k&&_.jsx(Rt,{panel:O,containerAxisSize:H,direction:h})]})}),Lt=s.lazy(()=>Promise.resolve().then(()=>require("./GlobalDebugOverlay-Cf3GOn2A.cjs")).then(e=>({default:e.GlobalDebugOverlayGate}))),_t=[],At={};let bn=0;const Dt=()=>(bn+=1,`panel-group-${bn}`),Ot=e=>{const n=e.reason==="minimum-exceeded",t=n?"Layout unavailable: minimum panel sizes exceed the container.":"Layout unavailable: panels cannot fill the container with their maximum sizes.",r=n?`Min required: ${Math.ceil(e.totalMinimumSize)}px | Available: ${Math.floor(e.availableContainerSize)}px`:`Max total: ${Math.floor(e.totalMaximumSize)}px | Needed: ${Math.floor(e.availableContainerSize)}px`;return{summary:t,detail:r}},Tt=(e,n)=>e.map(t=>{const r=n[t.id];return r?{...t,measuredPixelSize:r.pixelSize,measuredPercentageSize:r.percentageSize}:t}),Sn=(e,n,t)=>{const r=be(e,"horizontal"),o=be(e,"vertical"),i=e.getBoundingClientRect(),l=r.content>0?r.content:n??i.width,a=o.content>0?o.content:t??i.height;return{width:l,height:a}},Ft=e=>{const{id:n,className:t,style:r,children:o,direction:i,onLayout:l,autoSaveId:a,showDebugInfo:d,...u}=e,{groupRef:x,contextValue:c,groupStyle:I}=Dn(e),[h,A]=s.useState({width:0,height:0}),K=c.layoutConstraintViolation,C=!!K,H=s.useMemo(()=>{if(!K)return null;const{summary:z,detail:b}=Ot(K);return _.jsxs("div",{className:"flex w-full flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-slate-300 border-dashed bg-slate-100/70 px-6 py-8 text-center text-slate-600 text-sm dark:border-slate-600 dark:bg-slate-800/50 dark:text-slate-200","data-panel-group-placeholder":"constraint-violation",children:[_.jsx("span",{children:z}),_.jsx("span",{className:"text-slate-500 text-xs dark:text-slate-400",children:b})]})},[K]),k=s.useRef(null);k.current===null&&(k.current=n??Dt());const S=k.current,L=n??S,E=c.showDebugInfo&&c.panels.length>0,W=E?c.panels:_t,w=E?c.panelMeasurements:At,D=s.useMemo(()=>{if(!E)return[];const z=Object.values(c.handleMeasurements);return z.length<=1?z:z.slice().sort((b,j)=>b.id.localeCompare(j.id))},[c.handleMeasurements,E]),M=h.width,J=h.height;s.useLayoutEffect(()=>{if(!E){A({width:0,height:0});return}if(typeof window>"u"||typeof ResizeObserver>"u")return;const z=x.current;if(!z)return;const b=G=>{A(q=>q.width===G.width&&q.height===G.height?q:G)},j=new ResizeObserver(G=>{for(const q of G){if(q.target!==z)continue;const p=Sn(z,q.contentRect.width,q.contentRect.height);b(p)}});return j.observe(z),b(Sn(z)),()=>{j.disconnect()}},[x,E]);const O=s.useMemo(()=>Tt(W,w),[W,w]);return s.useEffect(()=>{if(!E)return;let z=!1,b=null;return Promise.resolve().then(()=>require("./debugOverlayStore-DY09saU8.cjs")).then(j=>{z||(b=j,j.enableDebugOverlayGroup(S))}),()=>{z=!0,b&&(b.disableDebugOverlayGroup(S),b.removeDebugOverlayGroup(S))}},[E,S]),s.useEffect(()=>{if(!E)return;let z=!1;return Promise.resolve().then(()=>require("./debugOverlayStore-DY09saU8.cjs")).then(b=>{z||b.updateDebugOverlayGroup(S,{displayName:L,direction:i,containerSize:{width:M,height:J},panels:O,handles:D})}),()=>{z=!0}},[E,S,L,i,M,J,O,D]),_.jsxs(Ze.Provider,{value:c,children:[_.jsxs("div",{...u,ref:x,className:Re.twMerge("panel-group",i==="horizontal"?"flex-row":"flex-col",t),style:I,"data-panel-group-id":n,"data-panel-group-direction":i,children:[o,C&&H?_.jsx("div",{className:"pointer-events-auto",style:{position:"absolute",inset:0,zIndex:60,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(248, 250, 252, 0.82)",backdropFilter:"blur(2px)"},children:H}):null]}),E&&_.jsx(s.Suspense,{fallback:null,children:_.jsx(Lt,{groupId:S})})]})},kt={display:"none",pointerEvents:"none",visibility:"hidden"},Bt={display:"none"},we=(e,n)=>typeof e!="number"||!Number.isFinite(e)||e<=0?n:e,Ht=e=>{const n=Math.round(e);return n%2===0?n:n+1},zn=e=>!e||typeof window>"u"?!1:window.getComputedStyle(e).direction==="rtl",Pn=(e,n,t)=>{const r=e.collapsed?0:e.size,o=n.collapsed?0:n.size,i=r+o;if(i<=0)return;const l=de(e,t),a=de(n,t),d=Math.max(l.min,i-a.max),u=Math.max(d,Math.min(l.max,i-a.min));if(e.collapsed)return{position:0,lower:0,upper:e.collapsedByDirection==="end"?Math.max(0,u):0,resizeLower:d,resizeUpper:u};if(n.collapsed){const I=n.collapsedByDirection==="start";return{position:i,lower:I?Math.min(i,d):i,upper:i,resizeLower:d,resizeUpper:u}}const x=Math.min(r,e.collapseFromEnd?0:d),c=Math.max(r,x,n.collapseFromStart?i:u);return{position:r,lower:x,upper:c,resizeLower:d,resizeUpper:u}},Gt=s.memo(e=>{const{id:n,disabled:t=!1,className:r,style:o,children:i,onDragging:l,thickness:a,indicator:d=!0,indicatorThickness:u,indicatorLength:x,indicatorBarThickness:c,indicatorBarLength:I,title:h,onPointerDown:A,onKeyDown:K,...C}=e,{direction:H,resizePanels:k,getPanel:S,collapsePanel:L,expandPanel:E,panels:W,layoutOrderKey:w,reportHandleMeasurement:D,containerSize:M,layoutConstraintViolation:J}=Ae(),[O,z]=s.useState(!1),[b,j]=s.useState({start:null,end:null}),G=s.useRef(null),q=s.useRef(null),p=s.useRef({getPanel:S,containerSize:M});p.current={getPanel:S,containerSize:M};const f=s.useRef(""),m=s.useRef(""),P=s.useRef(null),v=s.useRef(null),oe=s.useId(),pe=s.useRef(n??`resize-handle-${oe}`),fe=n??pe.current,y=H==="horizontal",Oe=!!J,Q=t||Oe,Qe=s.useCallback(()=>{const g=G.current,Y=Me(g);if(!(g&&Y))return;const B=Xe(Y),T=B.indexOf(g);let F="",U="";for(let $=T-1;$>=0;$-=1){const R=B[$].dataset.panelId;if(R!==void 0){F=R;break}}for(let $=T+1;$<B.length;$+=1){const R=B[$].dataset.panelId;if(R!==void 0){U=R;break}}F===f.current&&U===m.current||(f.current=F,m.current=U,j({start:F||null,end:U||null}))},[]);s.useEffect(()=>{Qe()},[Qe,w]),s.useEffect(()=>()=>{P.current?.()},[]);const en=s.useCallback(g=>{if(Q||P.current||g.button!==0)return;const Y=S(f.current),B=S(m.current);if(!(Y&&B))return;g.preventDefault(),g.stopPropagation();const T=f.current,F=m.current,U=Y.size,$=Y.size+B.size,R=y?g.clientX:g.clientY,ee=Me(G.current),ge=y&&zn(ee)?-1:1,ne=ee?ut(ee,H):1,he=g.pointerId,Pe=g.currentTarget;Pe.setPointerCapture?.(he),z(!0),l?.(!0);let on=0,ye=null;const sn=V=>{const xe=((y?V.clientX:V.clientY)-R)*ge/ne,Ee=U+xe,ke=$-Ee,Le=p.current,Be=Le.getPanel(T),He=Le.getPanel(F);if(!(Be&&He))return;const pn=Math.min(Le.containerSize*En,wn),fn=Math.min(Le.containerSize*nt,tt);if(He.collapsed){ke>fn&&E(F,"start",ke);return}if(Be.collapsed){Ee>fn&&E(T,"end",Ee);return}if(He.collapseFromStart&&ke<=pn){L(F,"start");return}if(Be.collapseFromEnd&&Ee<=pn){L(T,"end");return}k(T,F,Ee)},ln=V=>{if(V.pointerId!==he)return;V.preventDefault(),V.stopPropagation();const xe=performance.now();if(xe-on<et){ye=V;return}on=xe,ye=null,sn(V)};let an=!0;const Ne=()=>{an&&(an=!1,P.current=null,z(!1),l?.(!1),document.removeEventListener("pointermove",ln),document.removeEventListener("pointerup",cn),document.removeEventListener("pointercancel",un),Pe.removeEventListener("lostpointercapture",dn),Pe.hasPointerCapture?.(he)&&Pe.releasePointerCapture(he))},cn=V=>{if(V.pointerId===he){if(ye){const xe=ye;ye=null,sn(xe)}Ne()}},un=V=>{V.pointerId===he&&Ne()},dn=V=>{V.pointerId===he&&Ne()};document.addEventListener("pointermove",ln),document.addEventListener("pointerup",cn),document.addEventListener("pointercancel",un),Pe.addEventListener("lostpointercapture",dn),P.current=Ne},[Q,y,H,S,k,L,E,l]),nn=s.useCallback(g=>{if(Q)return;const Y=y?"ArrowLeft":"ArrowUp",B=y?"ArrowRight":"ArrowDown";if(g.key!==Y&&g.key!==B)return;const T=f.current,F=m.current,U=S(T),$=S(F);if(!(U&&$))return;const R=Pn(U,$,M);if(!R||R.upper-R.lower<=N)return;g.preventDefault(),g.stopPropagation();const ee=g.shiftKey?hn*5:hn,ge=y&&zn(Me(G.current))?-1:1,ne=(g.key===B?ee:-ee)*ge;if(U.collapsed){ne>0&&E(T,"end");return}if($.collapsed){ne<0&&E(F,"start");return}if(ne<0&&U.collapseFromEnd&&R.position<=R.resizeLower+N){L(T,"end");return}if(ne>0&&$.collapseFromStart&&R.position>=R.resizeUpper-N){L(F,"start");return}k(T,F,U.size+ne)},[Q,y,S,k,L,E,M]),ie=typeof d=="object"&&d!==null?d:void 0,Te=d===!1||ie?.visible===!1,te=Math.max(1,we(a,Vn)),On=y?qn:Yn,Tn=y?Zn:Jn,ae=Math.min(te,Math.max(1,we(u??ie?.thickness,Kn))),me=Math.max(1,we(x??ie?.length,On)),Se=Math.min(ae,Math.max(1,we(c??ie?.barThickness,Xn))),ze=Math.min(me,Math.max(1,we(I??ie?.barLength,Tn))),ce=s.useMemo(()=>{const g=Ye(M),Y=R=>{const ee=W[R];return ee?ee.collapsed||ee.size<=g:!1},B=(R,ee)=>{let ge=0;for(let ne=R;ne>=0&&ne<W.length&&Y(ne);ne+=ee)ge+=1;return ge},T=W.findIndex(R=>R.id===b.start),F=W.findIndex(R=>R.id===b.end),U=T>=0?B(T,-1):0,$=F>=0?B(F,1):0;return{groupSize:U+$+1,overlapIndex:U}},[b.start,b.end,W,M]),re=s.useMemo(()=>Oe?!0:ce.groupSize<=1?!1:ce.overlapIndex>0&&ce.overlapIndex<ce.groupSize-1,[ce,Oe]),ve=s.useMemo(()=>{if(ce.groupSize<=1||re)return 0;const g=Ht(Math.max(Qn,ae+4));return(ce.overlapIndex===0?-.5:.5)*g},[ce,re,ae]),Fn=s.useMemo(()=>{const g={position:"relative",flex:"0 0 0px",alignSelf:"stretch",order:0,margin:0,overflow:"visible",...y?{width:0,minWidth:0}:{height:0,minHeight:0}};return re?{...g,...kt}:g},[y,re]),tn=s.useMemo(()=>({"--rp-handle-thickness":`${te}px`,"--rp-indicator-thickness":`${ae}px`,"--rp-indicator-length":`${me}px`,"--rp-indicator-bar-thickness":`${Se}px`,"--rp-indicator-bar-length":`${ze}px`}),[te,ae,me,Se,ze]),kn=s.useMemo(()=>({...tn,...o,position:"absolute",zIndex:20,touchAction:"none",...y?{insetBlockStart:0,insetInlineStart:`${-te/2}px`,width:`${te}px`,height:"100%"}:{insetInlineStart:0,insetBlockStart:`${-te/2}px`,height:`${te}px`,width:"100%"}}),[y,te,tn,o]),Bn=s.useMemo(()=>{if(re||Te)return Bt;const g={width:`${y?ae:me}px`,height:`${y?me:ae}px`,flexShrink:0};return ve!==0&&(g.position="relative",y?g.insetInlineStart=`${ve}px`:g.insetBlockStart=`${ve}px`),g},[re,Te,y,ae,me,ve]),Hn=s.useMemo(()=>({width:`${y?Se:ze}px`,height:`${y?ze:Se}px`,flexShrink:0}),[y,Se,ze]),Gn=s.useMemo(()=>Re.twMerge("group absolute z-20 flex select-none items-center justify-center border-none bg-transparent transition-colors duration-150 overflow-visible",y?"cursor-col-resize h-full":"cursor-row-resize w-full",!Q&&"hover:bg-gray-200/70 dark:hover:bg-gray-700/70",!Q&&"active:bg-blue-300/60 dark:active:bg-blue-700/60",O&&"bg-blue-200/80 dark:bg-blue-800/60",Q&&"cursor-not-allowed opacity-50","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",r),[y,Q,O,r]),$n=s.useMemo(()=>Re.twMerge("pointer-events-none flex items-center justify-center rounded-full bg-white text-slate-700 ring-1 ring-inset ring-white/80 backdrop-blur-sm transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.85),0_1px_3px_rgba(15,23,42,0.18)]","dark:bg-slate-800/95 dark:text-slate-200 dark:ring-slate-500/60 dark:shadow-[0_0_0_1px_rgba(148,163,184,0.45),0_1px_3px_rgba(2,6,23,0.55)]",O&&"bg-blue-200/80 ring-blue-300 shadow-[0_0_0_1px_rgba(191,219,254,0.65),0_1px_4px_rgba(59,130,246,0.45)] dark:bg-blue-900/70 dark:ring-blue-400 dark:shadow-[0_0_0_1px_rgba(147,197,253,0.5),0_1px_4px_rgba(59,130,246,0.55)]",ie?.className),[O,ie?.className]),jn=s.useMemo(()=>Re.twMerge("pointer-events-none rounded-full bg-slate-600 transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.9)] dark:bg-slate-200 dark:shadow-[0_0_0_1px_rgba(15,23,42,0.55)]",O&&"bg-blue-500 dark:bg-blue-300",!Q&&"group-hover:bg-slate-700 dark:group-hover:bg-slate-100",ie?.barClassName),[O,Q,ie?.barClassName]);s.useEffect(()=>{if(fe===pe.current)return;const g=pe.current;pe.current=fe,v.current=null,D(g,null)},[D,fe]),s.useEffect(()=>{const g={id:fe,thickness:re?0:te,direction:H,visible:!re&&te>rt,startPanelId:b.start,endPanelId:b.end};v.current=g,D(fe,g)},[fe,te,re,H,b.start,b.end,D]),s.useEffect(()=>()=>{D(pe.current,null)},[D]);const Un=s.useCallback(g=>{A?.(g),g.defaultPrevented||en(g)},[A,en]),Wn=s.useCallback(g=>{K?.(g),g.defaultPrevented||nn(g)},[K,nn]),rn=`Resize ${y?"columns":"rows"} - Drag or use arrow keys to resize, drag to the edge to collapse/expand panels`,Fe=s.useMemo(()=>{const g=b.start===null?void 0:S(b.start),Y=b.end===null?void 0:S(b.end);if(!(g&&Y)||M<=0)return;const B=Pn(g,Y,M);if(!B)return;const T=F=>Math.round(F/M*100);return{now:T(B.position),min:T(B.lower),max:T(B.upper)}},[b.start,b.end,S,M]);return _.jsx("div",{ref:G,style:Fn,"data-resize-handle-anchor":"",children:_.jsx("button",{...C,type:"button",ref:q,className:Gn,style:kn,onPointerDown:Un,onKeyDown:Wn,disabled:Q,role:"separator","aria-orientation":y?"vertical":"horizontal","aria-valuenow":Fe?.now,"aria-valuemin":Fe?.min,"aria-valuemax":Fe?.max,"aria-disabled":Q||void 0,"aria-hidden":re||void 0,"aria-label":C["aria-label"]??rn,"data-resize-handle-id":fe,title:h??rn,children:i||!Te&&_.jsx("div",{className:$n,style:Bn,"data-resize-handle-indicator":"","aria-hidden":"true",children:_.jsx("span",{className:jn,style:Hn,"data-resize-handle-indicator-bar":"","aria-hidden":"true"})})})})}),Je=e=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&"),$t=e=>typeof document>"u"?null:document.querySelector(`[data-panel-id="${Je(e)}"]`),jt=e=>typeof document>"u"?null:document.querySelector(`[data-panel-group-id="${Je(e)}"]`),Ut=e=>typeof document>"u"?null:document.querySelector(`[data-resize-handle-id="${Je(e)}"]`);exports.PANEL_SNAP_THRESHOLD=yn;exports.Panel=Nt;exports.PanelGroup=Ft;exports.PanelGroupContext=Ze;exports.PanelResizeHandle=Gt;exports.allocatePanelSizes=Cn;exports.calculateSnapThreshold=Ye;exports.clamp=Ie;exports.findLayoutInvariantBreach=Ln;exports.findOwningGroup=Me;exports.getConstraintInPixels=$e;exports.getContainerSize=be;exports.getGroupLayoutElements=Xe;exports.getPanelElement=$t;exports.getPanelGroupElement=jt;exports.getPanelPreferenceInPixels=_n;exports.getResizeHandleElement=Ut;exports.initialPanelGroupLayoutState=Nn;exports.isPixelPanel=Z;exports.loadLayout=Mn;exports.normalizeSizeConfig=Rn;exports.panelReducer=An;exports.percentageToPixels=st;exports.resolvePanelBounds=de;exports.saveLayout=Ue;exports.toRoundedPercentage=qe;exports.usePanelControls=Et;exports.usePanelGroup=Ae;exports.useResizablePanels=Dn;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DqATP_BA.cjs");exports.Panel=e.Panel;exports.PanelGroup=e.PanelGroup;exports.PanelGroupContext=e.PanelGroupContext;exports.PanelResizeHandle=e.PanelResizeHandle;exports.allocatePanelSizes=e.allocatePanelSizes;exports.calculateSnapThreshold=e.calculateSnapThreshold;exports.clamp=e.clamp;exports.findLayoutInvariantBreach=e.findLayoutInvariantBreach;exports.findOwningGroup=e.findOwningGroup;exports.getConstraintInPixels=e.getConstraintInPixels;exports.getContainerSize=e.getContainerSize;exports.getGroupLayoutElements=e.getGroupLayoutElements;exports.getPanelElement=e.getPanelElement;exports.getPanelGroupElement=e.getPanelGroupElement;exports.getPanelPreferenceInPixels=e.getPanelPreferenceInPixels;exports.getResizeHandleElement=e.getResizeHandleElement;exports.initialPanelGroupLayoutState=e.initialPanelGroupLayoutState;exports.isPixelPanel=e.isPixelPanel;exports.loadLayout=e.loadLayout;exports.normalizeSizeConfig=e.normalizeSizeConfig;exports.panelReducer=e.panelReducer;exports.percentageToPixels=e.percentageToPixels;exports.resolvePanelBounds=e.resolvePanelBounds;exports.saveLayout=e.saveLayout;exports.toRoundedPercentage=e.toRoundedPercentage;exports.usePanelControls=e.usePanelControls;exports.usePanelGroup=e.usePanelGroup;exports.useResizablePanels=e.useResizablePanels;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @description Reusable resizable panel components and utilities for React
|
|
4
|
-
*
|
|
5
|
-
* 再利用可能なリサイズパネルコンポーネントとユーティリティ
|
|
6
|
-
*/
|
|
7
|
-
export { PanelGroupContext, usePanelGroup } from './context';
|
|
8
|
-
export { usePanelControls, useResizablePanels } from './hooks';
|
|
9
|
-
export { Panel } from './Panel';
|
|
10
|
-
export { PanelGroup } from './PanelGroup';
|
|
11
|
-
export { PanelResizeHandle } from './PanelResizeHandle';
|
|
12
|
-
export type { CollapsibleConfig, CollapsibleDirection, ContainerAxisMeasurement, ContainerSize, FlexibleSize, LayoutConstraintViolation, LayoutConstraintViolationReason, PanelCollapseDirection, PanelDirection, PanelGroupContextValue, PanelGroupProps, PanelLayoutData, PanelMeasurement, PanelProps, PanelResizeHandleIndicatorConfig, PanelResizeHandleProps, ResizeHandleLayoutData, SizeConfig, SizeUnit, } from './types';
|
|
13
|
-
export { clamp, getConstraintInPixels, getContainerSize, loadLayout, normalizeSizeConfig, saveLayout, } from './utils';
|
|
14
|
-
/**
|
|
15
|
-
* Locate a panel element in the DOM by its data attribute.
|
|
16
|
-
* data 属性を手がかりにパネル要素を DOM から取得する補助関数。
|
|
17
|
-
*/
|
|
18
|
-
export declare const getPanelElement: (id: string) => HTMLElement | null;
|
|
19
|
-
/**
|
|
20
|
-
* Locate a panel group element in the DOM by its data attribute.
|
|
21
|
-
* data 属性を手がかりにパネルグループ要素を DOM から取得する補助関数。
|
|
22
|
-
*/
|
|
23
|
-
export declare const getPanelGroupElement: (id: string) => HTMLElement | null;
|
|
24
|
-
/**
|
|
25
|
-
* Locate a resize handle element in the DOM by its data attribute.
|
|
26
|
-
* data 属性を手がかりにリサイズハンドル要素を DOM から取得する補助関数。
|
|
27
|
-
*/
|
|
28
|
-
export declare const getResizeHandleElement: (id: string) => HTMLElement | null;
|
|
29
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './src/index'
|
|
2
|
+
export {}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import { a as s, b as n, c as l, d as t, e as o,
|
|
1
|
+
import { a as s, b as n, c as l, d as t, e as o, f as i, g as r, h as u, i as P, j as p, k as g, l as d, m as c, n as m, o as z, p as x, q as G, r as f, s as y, t as C, u as L, v as R, w as S, x as h, y as v, z as E, A as B, B as I } from "./index-DZ0itiBD.js";
|
|
2
2
|
export {
|
|
3
3
|
s as Panel,
|
|
4
4
|
n as PanelGroup,
|
|
5
5
|
l as PanelGroupContext,
|
|
6
6
|
t as PanelResizeHandle,
|
|
7
|
-
o as
|
|
8
|
-
i as
|
|
9
|
-
r as
|
|
10
|
-
u as
|
|
11
|
-
P as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
o as allocatePanelSizes,
|
|
8
|
+
i as calculateSnapThreshold,
|
|
9
|
+
r as clamp,
|
|
10
|
+
u as findLayoutInvariantBreach,
|
|
11
|
+
P as findOwningGroup,
|
|
12
|
+
p as getConstraintInPixels,
|
|
13
|
+
g as getContainerSize,
|
|
14
|
+
d as getGroupLayoutElements,
|
|
15
|
+
c as getPanelElement,
|
|
16
|
+
m as getPanelGroupElement,
|
|
17
|
+
z as getPanelPreferenceInPixels,
|
|
18
|
+
x as getResizeHandleElement,
|
|
19
|
+
G as initialPanelGroupLayoutState,
|
|
20
|
+
f as isPixelPanel,
|
|
21
|
+
y as loadLayout,
|
|
22
|
+
C as normalizeSizeConfig,
|
|
23
|
+
L as panelReducer,
|
|
24
|
+
R as percentageToPixels,
|
|
25
|
+
S as resolvePanelBounds,
|
|
26
|
+
h as saveLayout,
|
|
27
|
+
v as toRoundedPercentage,
|
|
28
|
+
E as usePanelControls,
|
|
29
|
+
B as usePanelGroup,
|
|
30
|
+
I as useResizablePanels
|
|
19
31
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalDebugOverlay.d.ts","sourceRoot":"","sources":["../../src/GlobalDebugOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyGH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,uCAMtE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,0CA2J9B,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { PanelLayoutData, PanelProps, PanelRegistration } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Flex triple a panel renders: the allocated length plus the weights that absorb a container change.
|
|
5
|
+
* パネルが描画する flex の三つ組: 配分された長さと、コンテナ変化を吸収する重み。
|
|
6
|
+
*/
|
|
7
|
+
type PanelFlexStyle = Required<Pick<CSSProperties, "flexBasis" | "flexGrow" | "flexShrink">>;
|
|
8
|
+
type ResolvePanelFlexArgs = {
|
|
9
|
+
size: number;
|
|
10
|
+
panel: PanelLayoutData | undefined;
|
|
11
|
+
registration: PanelRegistration;
|
|
12
|
+
containerSize: number;
|
|
13
|
+
isCollapsed: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the flex triple that renders a panel's current state.
|
|
17
|
+
* パネルの現在の状態を描画する flex の三つ組を解決する処理。
|
|
18
|
+
*
|
|
19
|
+
* The basis is always the allocated length, so the rendered geometry is the allocator's answer and nothing
|
|
20
|
+
* else. The weights are the first-order continuation of that answer: a panel grows with its ratio weight
|
|
21
|
+
* until it reaches its maximum and shrinks only while it is strictly between its bounds, which is exactly
|
|
22
|
+
* how the allocator would move it for a small container change.
|
|
23
|
+
* basis は常に配分された長さであり、描画される幾何は配分器の答えそのものとなる。重みはその答えの
|
|
24
|
+
* 一次近似であり、上限に達するまでは比率の重みで伸び、上下限の内側にいる間だけ縮む。これは小さな
|
|
25
|
+
* コンテナ変化に対して配分器が動かす量と一致する。
|
|
26
|
+
*
|
|
27
|
+
* @param args - Allocated size, panel state, registration and container length / 配分サイズ・パネル状態・登録情報・コンテナ長
|
|
28
|
+
* @returns Flex basis, grow and shrink to render / 描画する flex basis・grow・shrink
|
|
29
|
+
*/
|
|
30
|
+
export declare const resolvePanelFlex: ({ size, panel, registration, containerSize, isCollapsed }: ResolvePanelFlexArgs) => PanelFlexStyle;
|
|
31
|
+
/**
|
|
32
|
+
* Render a resizable panel whose size is decided by the group's allocator.
|
|
33
|
+
* グループの配分器が決めたサイズで描画されるリサイズ可能パネル。
|
|
34
|
+
*
|
|
35
|
+
* The panel publishes what it wants (its preference and constraints) and renders what it was given. Its
|
|
36
|
+
* flex basis is the allocated length itself, while `flex-grow` / `flex-shrink` describe how it should
|
|
37
|
+
* absorb a container change during the frames before the allocator runs again — a growth weight that
|
|
38
|
+
* vanishes at the panel's maximum and a shrink weight that vanishes at either bound, which is exactly how
|
|
39
|
+
* the allocator would move this panel for a small change.
|
|
40
|
+
* パネルは希望と制約を公開し、与えられたサイズで描画する。flex basis は配分結果そのもので、
|
|
41
|
+
* `flex-grow` / `flex-shrink` は配分器が再実行されるまでの数フレームでコンテナ変化をどう吸収するかを表す
|
|
42
|
+
* (上限で消える成長重みと、上下限のいずれかで消える縮小重み)。これは小さな変化に対して配分器が動かす量と一致する。
|
|
43
|
+
*/
|
|
44
|
+
export declare const Panel: import('react').MemoExoticComponent<({ id: providedId, defaultSize, minSize, maxSize, className, style, children, collapsible, defaultCollapsed, pixelAdjustPriority, flexAdjustPriority, contentOverflow, ...elementProps }: PanelProps) => import("react").JSX.Element>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=Panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../src/Panel.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAyE,MAAM,OAAO,CAAA;AAKjH,OAAO,EAAoD,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAmB,MAAM,SAAS,CAAA;AAwD1J;;;GAGG;AACH,KAAK,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC,CAAC,CAAA;AAE5F,KAAK,oBAAoB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,eAAe,GAAG,SAAS,CAAA;IAClC,YAAY,EAAE,iBAAiB,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,2DAA2D,oBAAoB,KAAG,cA2BlH,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,gOACiO,UAAU,iCA8J5P,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PanelDirection, PanelLayoutData } from './types';
|
|
2
|
+
type PanelDebugInfoProps = {
|
|
3
|
+
panel: PanelLayoutData | undefined;
|
|
4
|
+
containerAxisSize: number;
|
|
5
|
+
direction: PanelDirection;
|
|
6
|
+
};
|
|
7
|
+
type FormatPanelDebugInfoArgs = {
|
|
8
|
+
panel: PanelLayoutData | undefined;
|
|
9
|
+
containerAxisSize: number;
|
|
10
|
+
containerLabel: string;
|
|
11
|
+
};
|
|
12
|
+
type FormattedPanelDebugInfo = {
|
|
13
|
+
sizeDisplay: string;
|
|
14
|
+
preferenceDisplay: string;
|
|
15
|
+
boundsDisplay: string;
|
|
16
|
+
containerDisplay: string;
|
|
17
|
+
headlineLabel: string;
|
|
18
|
+
titleText: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Format one panel's allocation for the debug overlay.
|
|
22
|
+
* デバッグ表示用に 1 枚のパネルの配分結果を整形する処理。
|
|
23
|
+
*
|
|
24
|
+
* @param args - Panel, container length and the axis label / パネル・コンテナ長・軸ラベル
|
|
25
|
+
* @returns Display strings for the overlay / オーバーレイ表示用の文字列群
|
|
26
|
+
*/
|
|
27
|
+
export declare const formatPanelDebugInfo: ({ panel, containerAxisSize, containerLabel }: FormatPanelDebugInfoArgs) => FormattedPanelDebugInfo;
|
|
28
|
+
/**
|
|
29
|
+
* Render the per-panel debug badge inside a panel.
|
|
30
|
+
* パネル内にパネル単位のデバッグバッジを描画するコンポーネント。
|
|
31
|
+
*/
|
|
32
|
+
export declare const PanelDebugInfo: import('react').MemoExoticComponent<({ panel, containerAxisSize, direction }: PanelDebugInfoProps) => import("react").JSX.Element>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=PanelDebugInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelDebugInfo.d.ts","sourceRoot":"","sources":["../../src/PanelDebugInfo.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9D,KAAK,mBAAmB,GAAG;IACvB,KAAK,EAAE,eAAe,GAAG,SAAS,CAAA;IAClC,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,EAAE,cAAc,CAAA;CAC5B,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC5B,KAAK,EAAE,eAAe,GAAG,SAAS,CAAA;IAClC,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,8CAA8C,wBAAwB,KAAG,uBAe7G,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,gFAAkD,mBAAmB,iCAkC9F,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelGroup.d.ts","sourceRoot":"","sources":["../../src/PanelGroup.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,SAAS,CAAA;AAiE/D;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,gCAqKhD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelResizeHandle.d.ts","sourceRoot":"","sources":["../../src/PanelResizeHandle.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAkBH,KAAK,sBAAsB,EAE9B,MAAM,SAAS,CAAA;AAyHhB;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8CAAgB,sBAAsB,iCAklBlE,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LayoutConstraintViolation, PanelLayoutData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolved pixel bounds of a panel for a given container length.
|
|
4
|
+
* 指定コンテナ長におけるパネルのピクセル境界。
|
|
5
|
+
*/
|
|
6
|
+
export type PanelBounds = {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Report whether a panel is sized in pixels rather than as a share of the container.
|
|
12
|
+
* パネルがコンテナ比ではなくピクセルでサイズ指定されているかの判定。
|
|
13
|
+
*
|
|
14
|
+
* @param panel - Panel layout data / パネルレイアウトデータ
|
|
15
|
+
* @returns True when the panel keeps an absolute pixel size / 絶対ピクセル指定なら true
|
|
16
|
+
*/
|
|
17
|
+
export declare const isPixelPanel: (panel: PanelLayoutData) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a panel's bounds in pixels for the given container length.
|
|
20
|
+
* 指定コンテナ長に対するパネルの境界をピクセルで解決する処理。
|
|
21
|
+
*
|
|
22
|
+
* The same bounds govern the allocator and an explicit drag: a size the user cannot reach by hand but the
|
|
23
|
+
* allocator may produce (or the reverse) would make the two disagree about where a panel is allowed to be.
|
|
24
|
+
* 配分器と明示的なドラッグは同じ境界に従う。片方だけが到達できるサイズがあると、パネルが居てよい範囲について
|
|
25
|
+
* 両者の認識が食い違うためである。
|
|
26
|
+
*
|
|
27
|
+
* @param panel - Panel layout data / パネルレイアウトデータ
|
|
28
|
+
* @param containerSize - Container content-box length in pixels / コンテナ内容領域長 (px)
|
|
29
|
+
* @returns Pixel bounds with `min <= max` guaranteed / `min <= max` を保証したピクセル境界
|
|
30
|
+
*/
|
|
31
|
+
export declare const resolvePanelBounds: (panel: PanelLayoutData, containerSize: number) => PanelBounds;
|
|
32
|
+
/**
|
|
33
|
+
* Result of one allocation pass.
|
|
34
|
+
* 1 回の配分結果。
|
|
35
|
+
*/
|
|
36
|
+
export type LayoutAllocation = {
|
|
37
|
+
/** Pixel size per panel, index-aligned with the input, collapsed panels at 0. パネルごとのピクセルサイズ。 */
|
|
38
|
+
sizes: number[];
|
|
39
|
+
/** Constraint conflict detected while allocating, or null. 配分中に検出した制約矛盾。 */
|
|
40
|
+
violation: LayoutConstraintViolation | null;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Allocate pixel sizes to every panel of a group for a given container length.
|
|
44
|
+
* 指定コンテナ長に対してグループ内の全パネルへピクセルサイズを配分する処理。
|
|
45
|
+
*
|
|
46
|
+
* The allocation runs in three stages: collapsed panels take no space, panels with an absolute target
|
|
47
|
+
* (pixel panels first, then flexible panels that declare a priority) are filled in order, and the rest of
|
|
48
|
+
* the container is shared by the remaining flexible panels in proportion to their weights. Any residue
|
|
49
|
+
* left because every ratio panel hit its maximum is offered back to the sequential panels up to their own
|
|
50
|
+
* maximum, so the container is filled whenever the constraints allow it.
|
|
51
|
+
* 配分は 3 段階: 折りたたみパネルは領域を取らず、絶対目標を持つパネル (ピクセル → 優先度つき柔軟) を順に
|
|
52
|
+
* 充当し、残りを柔軟パネルが重みに比例して分け合う。全ての比例パネルが上限に達して余りが出た場合は逐次段の
|
|
53
|
+
* パネルへ上限まで戻すため、制約が許す限りコンテナは満たされる。
|
|
54
|
+
*
|
|
55
|
+
* @param panels - Panels in DOM order / DOM 順のパネル一覧
|
|
56
|
+
* @param containerSize - Container content-box length in pixels / コンテナ内容領域長 (px)
|
|
57
|
+
* @returns Sizes and the constraint violation detected, if any / 配分結果と検出した制約違反
|
|
58
|
+
*/
|
|
59
|
+
export declare const allocatePanelSizes: (panels: ReadonlyArray<PanelLayoutData>, containerSize: number) => LayoutAllocation;
|
|
60
|
+
//# sourceMappingURL=allocateLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allocateLayout.d.ts","sourceRoot":"","sources":["../../src/allocateLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,yBAAyB,EAA4B,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAqBxG;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AA4BD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,eAAe,KAAG,OAAsC,CAAA;AAE5F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,eAAe,EAAE,eAAe,MAAM,KAAG,WAIlF,CAAA;AAmMD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,gGAAgG;IAChG,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,4EAA4E;IAC5E,SAAS,EAAE,yBAAyB,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,aAAa,CAAC,eAAe,CAAC,EAAE,eAAe,MAAM,KAAG,gBAgElG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wDAAqD,CAAA;AAEnF;;;GAGG;AACH,eAAO,MAAM,aAAa,8BAMzB,CAAA"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { ContainerSize, PanelDirection, PanelLayoutData, ResizeHandleLayoutData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Panel layout data enriched with the DOM measurement the overlay compares it against.
|
|
4
|
+
* オーバーレイが突き合わせる DOM 実測値を添えたパネルレイアウトデータ。
|
|
5
|
+
*/
|
|
6
|
+
export type DebugPanelSnapshot = PanelLayoutData & {
|
|
7
|
+
measuredPixelSize?: number;
|
|
8
|
+
measuredPercentageSize?: number;
|
|
9
|
+
};
|
|
2
10
|
/**
|
|
3
11
|
* Snapshot of the debug overlay state across panel groups.
|
|
4
12
|
* デバッグオーバーレイのスナップショット状態を表す構造体。
|
|
@@ -16,7 +24,7 @@ export type DebugGroupState = {
|
|
|
16
24
|
displayName: string;
|
|
17
25
|
direction: PanelDirection;
|
|
18
26
|
containerSize: ContainerSize;
|
|
19
|
-
panels:
|
|
27
|
+
panels: DebugPanelSnapshot[];
|
|
20
28
|
handles: ResizeHandleLayoutData[];
|
|
21
29
|
index: number;
|
|
22
30
|
};
|
|
@@ -24,7 +32,7 @@ type DebugGroupUpdate = {
|
|
|
24
32
|
displayName: string;
|
|
25
33
|
direction: PanelDirection;
|
|
26
34
|
containerSize: ContainerSize;
|
|
27
|
-
panels:
|
|
35
|
+
panels: DebugPanelSnapshot[];
|
|
28
36
|
handles: ResizeHandleLayoutData[];
|
|
29
37
|
};
|
|
30
38
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugOverlayStore.d.ts","sourceRoot":"","sources":["../../src/debugOverlayStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErG;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,cAAc,CAAA;IACzB,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,OAAO,EAAE,sBAAsB,EAAE,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,cAAc,CAAA;IACzB,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,OAAO,EAAE,sBAAsB,EAAE,CAAA;CACpC,CAAA;AAsQD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,qBAElC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,4BAEnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,SAEtD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,SAEvD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,EAAE,QAAQ,gBAAgB,SAEhF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,SAEtD,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { PanelCollapseDirection, PanelGroupProps, PanelMeasurement, PanelRegistration, ResizeHandleLayoutData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Orchestrate measurement, ordering, persistence and user intent for one panel group.
|
|
5
|
+
* 1 つのパネルグループにおける計測・順序同期・永続化・利用者操作の統括。
|
|
6
|
+
*
|
|
7
|
+
* @param props - Panel group props / パネルグループのプロパティ
|
|
8
|
+
* @returns Group ref, context value and the group's base style / グループ ref・コンテキスト値・基準スタイル
|
|
9
|
+
*/
|
|
10
|
+
export declare const useResizablePanels: ({ direction, style, onLayout, autoSaveId, showDebugInfo }: PanelGroupProps) => {
|
|
11
|
+
groupRef: import('react').RefObject<HTMLDivElement | null>;
|
|
12
|
+
contextValue: {
|
|
13
|
+
direction: import('./types').PanelDirection;
|
|
14
|
+
panels: import('./types').PanelLayoutData[];
|
|
15
|
+
containerSize: number;
|
|
16
|
+
layoutOrderKey: string;
|
|
17
|
+
showDebugInfo: boolean;
|
|
18
|
+
registerPanel: (panel: PanelRegistration) => void;
|
|
19
|
+
unregisterPanel: (id: string) => void;
|
|
20
|
+
resizePanels: (startId: string, endId: string, startSize: number) => void;
|
|
21
|
+
collapsePanel: (id: string, from: PanelCollapseDirection) => void;
|
|
22
|
+
expandPanel: (id: string, from: PanelCollapseDirection, targetSize?: number) => void;
|
|
23
|
+
getPanel: (id: string) => import('./types').PanelLayoutData | undefined;
|
|
24
|
+
reportPanelMeasurement: (panelId: string, measurement: PanelMeasurement | null) => void;
|
|
25
|
+
panelMeasurements: Record<string, PanelMeasurement>;
|
|
26
|
+
reportHandleMeasurement: (handleId: string, measurement: ResizeHandleLayoutData | null) => void;
|
|
27
|
+
handleMeasurements: Record<string, ResizeHandleLayoutData>;
|
|
28
|
+
layoutConstraintViolation: import('./types').LayoutConstraintViolation | null;
|
|
29
|
+
};
|
|
30
|
+
groupStyle: CSSProperties;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Provide imperative helpers for toggling a specific panel while preserving its stored preference.
|
|
34
|
+
* 特定パネルの希望値を保ったまま開閉を制御する命令型ユーティリティを提供するカスタムフック。
|
|
35
|
+
*
|
|
36
|
+
* @param panelId - Identifier of the panel to control / 操作対象パネルの識別子
|
|
37
|
+
* @returns Panel state and collapse/expand/toggle helpers / パネル状態と開閉ヘルパー
|
|
38
|
+
*/
|
|
39
|
+
export declare const usePanelControls: (panelId: string) => {
|
|
40
|
+
panel: import('./types').PanelLayoutData | undefined;
|
|
41
|
+
isCollapsed: boolean;
|
|
42
|
+
canCollapseFromStart: boolean;
|
|
43
|
+
canCollapseFromEnd: boolean;
|
|
44
|
+
collapse: (from: PanelCollapseDirection) => void;
|
|
45
|
+
expand: (from: PanelCollapseDirection, targetSize?: number) => void;
|
|
46
|
+
toggle: (from: PanelCollapseDirection, targetSize?: number) => void;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAkF,MAAM,OAAO,CAAA;AAG1H,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAsB,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAkBvJ;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,2DAAmE,eAAe;;;;;;;;+BAqKvE,iBAAiB;8BAWlB,MAAM;gCAaJ,MAAM,SAAS,MAAM,aAAa,MAAM;4BAI5C,MAAM,QAAQ,sBAAsB;0BAItC,MAAM,QAAQ,sBAAsB,eAAe,MAAM;uBAI5D,MAAM;0CAEa,MAAM,eAAe,gBAAgB,GAAG,IAAI;;4CAkB1C,MAAM,eAAe,sBAAsB,GAAG,IAAI;;;;;CAkE5G,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM;;;;;qBAKjC,sBAAsB;mBAOtB,sBAAsB,eAAe,MAAM;mBAO3C,sBAAsB,eAAe,MAAM;CAsBzD,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package @aiquants/resize-panels
|
|
3
|
+
* @description Reusable resizable panel components and utilities for React
|
|
4
|
+
*
|
|
5
|
+
* 再利用可能なリサイズパネルコンポーネントとユーティリティ
|
|
6
|
+
*/
|
|
7
|
+
export type { LayoutAllocation, PanelBounds } from './allocateLayout';
|
|
8
|
+
export { allocatePanelSizes, isPixelPanel, resolvePanelBounds } from './allocateLayout';
|
|
9
|
+
export { PanelGroupContext, usePanelGroup } from './context';
|
|
10
|
+
export { usePanelControls, useResizablePanels } from './hooks';
|
|
11
|
+
export { Panel } from './Panel';
|
|
12
|
+
export { PanelGroup } from './PanelGroup';
|
|
13
|
+
export { PanelResizeHandle } from './PanelResizeHandle';
|
|
14
|
+
export { findLayoutInvariantBreach, getPanelPreferenceInPixels, initialPanelGroupLayoutState, panelReducer } from './reducer';
|
|
15
|
+
export type { CollapsibleConfig, CollapsibleDirection, ContainerAxisMeasurement, FlexibleSize, LayoutConstraintViolation, LayoutConstraintViolationReason, PanelAction, PanelCollapseDirection, PanelDirection, PanelGroupContextValue, PanelGroupLayoutState, PanelGroupProps, PanelLayoutData, PanelMeasurement, PanelProps, PanelRegistration, PanelResizeHandleIndicatorConfig, PanelResizeHandleProps, PersistedPanelSize, ResizeHandleLayoutData, SizeConfig, SizeUnit, } from './types';
|
|
16
|
+
export { calculateSnapThreshold, clamp, findOwningGroup, getConstraintInPixels, getContainerSize, getGroupLayoutElements, loadLayout, normalizeSizeConfig, percentageToPixels, saveLayout, toRoundedPercentage, } from './utils';
|
|
17
|
+
/**
|
|
18
|
+
* Locate a panel element in the DOM by its data attribute.
|
|
19
|
+
* data 属性を手がかりにパネル要素を DOM から取得する補助関数。
|
|
20
|
+
*/
|
|
21
|
+
export declare const getPanelElement: (id: string) => HTMLElement | null;
|
|
22
|
+
/**
|
|
23
|
+
* Locate a panel group element in the DOM by its data attribute.
|
|
24
|
+
* data 属性を手がかりにパネルグループ要素を DOM から取得する補助関数。
|
|
25
|
+
*/
|
|
26
|
+
export declare const getPanelGroupElement: (id: string) => HTMLElement | null;
|
|
27
|
+
/**
|
|
28
|
+
* Locate a resize handle element in the DOM by its data attribute.
|
|
29
|
+
* data 属性を手がかりにリサイズハンドル要素を DOM から取得する補助関数。
|
|
30
|
+
*/
|
|
31
|
+
export declare const getResizeHandleElement: (id: string) => HTMLElement | null;
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7H,YAAY,EACR,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACZ,yBAAyB,EACzB,+BAA+B,EAC/B,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,gCAAgC,EAChC,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,QAAQ,GACX,MAAM,SAAS,CAAA;AAChB,OAAO,EACH,sBAAsB,EACtB,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,mBAAmB,GACtB,MAAM,SAAS,CAAA;AAUhB;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,WAAW,GAAG,IAK1D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,KAAG,WAAW,GAAG,IAK/D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,IAAI,MAAM,KAAG,WAAW,GAAG,IAKjE,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PanelAction, PanelGroupLayoutState, PanelLayoutData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Empty layout state used before the group has measured itself or registered any panel.
|
|
4
|
+
* グループが自身を計測する前・パネル登録前の空レイアウト状態。
|
|
5
|
+
*/
|
|
6
|
+
export declare const initialPanelGroupLayoutState: PanelGroupLayoutState;
|
|
7
|
+
/**
|
|
8
|
+
* Find the layout invariant breach in a state, if there is one.
|
|
9
|
+
* レイアウト状態に不変条件の違反があれば、その内容を返す処理。
|
|
10
|
+
*
|
|
11
|
+
* The condition is the one the whole package rests on: with a measured container and no reported constraint
|
|
12
|
+
* conflict, the active panels fill it exactly. The misaligned handle this package once shipped was a silent
|
|
13
|
+
* violation of exactly this — the sizes stopped filling the container and nothing noticed.
|
|
14
|
+
* ここで見る条件はパッケージ全体の土台である: コンテナが計測済みで制約矛盾も報告されていないなら、
|
|
15
|
+
* アクティブなパネルはコンテナをちょうど満たす。かつて出荷された「ハンドルがずれる」欠陥は、まさにこの条件が
|
|
16
|
+
* 無言で破れた状態だった。
|
|
17
|
+
*
|
|
18
|
+
* @param state - Layout state to check / 検査するレイアウト状態
|
|
19
|
+
* @returns Allocated total and container length when they disagree, otherwise null / 食い違う場合の合計と
|
|
20
|
+
* コンテナ長、問題なければ null
|
|
21
|
+
*/
|
|
22
|
+
export declare const findLayoutInvariantBreach: (state: PanelGroupLayoutState) => {
|
|
23
|
+
allocatedTotal: number;
|
|
24
|
+
containerSize: number;
|
|
25
|
+
} | null;
|
|
26
|
+
/**
|
|
27
|
+
* Express a panel's preference as a length in pixels for the given container.
|
|
28
|
+
* パネルの希望値を、指定コンテナに対するピクセル長として表す処理。
|
|
29
|
+
*
|
|
30
|
+
* This is the length the panel occupies when it is open, which is what a persisted layout has to carry: the
|
|
31
|
+
* allocated size of a collapsed panel is 0 and would restore as "closed and with nothing to open to".
|
|
32
|
+
* これは「開いているときに占める長さ」であり、保存レイアウトが持つべき値でもある。折りたたみ中のパネルの
|
|
33
|
+
* 配分結果は 0 であり、そのまま保存すると「閉じたまま、開く先も無い」状態として復元されてしまう。
|
|
34
|
+
*
|
|
35
|
+
* @param panel - Panel layout data / パネルレイアウトデータ
|
|
36
|
+
* @param containerSize - Container content-box length in pixels / コンテナ内容領域長 (px)
|
|
37
|
+
* @returns Preferred length in pixels / 希望する長さ (px)
|
|
38
|
+
*/
|
|
39
|
+
export declare const getPanelPreferenceInPixels: (panel: PanelLayoutData, containerSize: number) => number;
|
|
40
|
+
/**
|
|
41
|
+
* Reduce the layout state of one panel group.
|
|
42
|
+
* パネルグループのレイアウト状態を遷移させるリデューサー。
|
|
43
|
+
*
|
|
44
|
+
* @param state - Current layout state / 現在のレイアウト状態
|
|
45
|
+
* @param action - Action describing the edit / 編集内容を表すアクション
|
|
46
|
+
* @returns Next layout state, identical by reference when nothing changed / 次のレイアウト状態 (無変化なら同一参照)
|
|
47
|
+
*/
|
|
48
|
+
export declare const panelReducer: (state: PanelGroupLayoutState, action: PanelAction) => PanelGroupLayoutState;
|
|
49
|
+
//# sourceMappingURL=reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/reducer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAA4D,KAAK,WAAW,EAA+B,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAA;AAM3M;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,qBAI1C,CAAA;AAkDD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,qBAAqB,KAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,IAqB5H,CAAA;AAuHD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,eAAe,EAAE,eAAe,MAAM,KAAG,MAG1F,CAAA;AAiCD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,qBAAqB,EAAE,QAAQ,WAAW,KAAG,qBAuLhF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roundHalfToEven.d.ts","sourceRoot":"","sources":["../../src/roundHalfToEven.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,SAAQ,MAAU,KAAG,MA+BnE,CAAA"}
|