Skip to content

Commit dba242a

Browse files
committed
Drop unreachable branch in resizable patch
1 parent e8531a3 commit dba242a

2 files changed

Lines changed: 29 additions & 15 deletions

File tree

patches/@window-splitter__state@0.4.1.patch

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js
2-
index acb542b1b71a7e808173d938d16f45a484334f94..fd21cccca33c34fdd3563c279aefbd4bb54eef50 100644
2+
index acb542b1b71a7e808173d938d16f45a484334f94..0b5fcfbd57ea015ace3cc5f255f39f71dccf9f73 100644
33
--- a/dist/commonjs/index.js
44
+++ b/dist/commonjs/index.js
55
@@ -107,6 +107,9 @@ function prepareSnapshot(snapshot) {
@@ -12,7 +12,7 @@ index acb542b1b71a7e808173d938d16f45a484334f94..fd21cccca33c34fdd3563c279aefbd4b
1212
}
1313
else {
1414
item.size.value = new big_js_1.default(item.size.value);
15-
@@ -648,8 +651,12 @@ function updateLayout(context, dragEvent) {
15+
@@ -648,15 +651,13 @@ function updateLayout(context, dragEvent) {
1616
}
1717
const panelBeforeIsAboutToCollapse = panelBefore.currentValue.value.eq(getUnitPixelValue(context, panelBefore.min));
1818
// If the panel was expanded and now is at it's min size, collapse it
@@ -23,9 +23,16 @@ index acb542b1b71a7e808173d938d16f45a484334f94..fd21cccca33c34fdd3563c279aefbd4b
2323
panelBefore.collapsible &&
2424
+ !panelBefore.collapseIsControlled &&
2525
panelBeforeIsAboutToCollapse) {
26-
if (panelBefore.onCollapseChange?.current &&
27-
panelBefore.collapseIsControlled &&
28-
@@ -693,7 +700,10 @@ function commitLayout(context) {
26+
- if (panelBefore.onCollapseChange?.current &&
27+
- panelBefore.collapseIsControlled &&
28+
- !dragEvent.controlled) {
29+
- panelBefore.onCollapseChange.current(true);
30+
- return { dragOvershoot: newDragOvershoot };
31+
- }
32+
// Make it collapsed
33+
panelBefore.collapsed = true;
34+
panelBeforeNewValue = getUnitPixelValue(context, panelBefore.collapsedSize);
35+
@@ -693,7 +694,10 @@ function commitLayout(context) {
2936
});
3037
const staticWidth = getStaticWidth({ ...context, items: newItems });
3138
newItems.forEach((item, index) => {
@@ -37,7 +44,7 @@ index acb542b1b71a7e808173d938d16f45a484334f94..fd21cccca33c34fdd3563c279aefbd4b
3744
return;
3845
}
3946
newItems[index] = {
40-
@@ -821,7 +831,12 @@ function clearLastKnownSize(items) {
47+
@@ -821,7 +825,12 @@ function clearLastKnownSize(items) {
4148
function getDeltaForEvent(context, event) {
4249
const panel = getPanelWithId(context, event.panelId);
4350
if (event.type === "expandPanel") {
@@ -52,7 +59,7 @@ index acb542b1b71a7e808173d938d16f45a484334f94..fd21cccca33c34fdd3563c279aefbd4b
5259
const collapsedSize = getUnitPixelValue(context, panel.collapsedSize);
5360
return panel.currentValue.value.minus(collapsedSize);
5461
diff --git a/dist/esm/index.js b/dist/esm/index.js
55-
index 8891ac0141135a3a885bd704d9d443458c7a01bf..80032b5a852c0117959808cff58b4cbf2b2eee11 100644
62+
index 8891ac0141135a3a885bd704d9d443458c7a01bf..cb00de4b543d2974a4afcd8999fa2e3e4e392fe8 100644
5663
--- a/dist/esm/index.js
5764
+++ b/dist/esm/index.js
5865
@@ -81,6 +81,9 @@ export function prepareSnapshot(snapshot) {
@@ -65,7 +72,7 @@ index 8891ac0141135a3a885bd704d9d443458c7a01bf..80032b5a852c0117959808cff58b4cbf
6572
}
6673
else {
6774
item.size.value = new Big(item.size.value);
68-
@@ -622,8 +625,12 @@ function updateLayout(context, dragEvent) {
75+
@@ -622,15 +625,13 @@ function updateLayout(context, dragEvent) {
6976
}
7077
const panelBeforeIsAboutToCollapse = panelBefore.currentValue.value.eq(getUnitPixelValue(context, panelBefore.min));
7178
// If the panel was expanded and now is at it's min size, collapse it
@@ -76,9 +83,16 @@ index 8891ac0141135a3a885bd704d9d443458c7a01bf..80032b5a852c0117959808cff58b4cbf
7683
panelBefore.collapsible &&
7784
+ !panelBefore.collapseIsControlled &&
7885
panelBeforeIsAboutToCollapse) {
79-
if (panelBefore.onCollapseChange?.current &&
80-
panelBefore.collapseIsControlled &&
81-
@@ -667,7 +674,10 @@ function commitLayout(context) {
86+
- if (panelBefore.onCollapseChange?.current &&
87+
- panelBefore.collapseIsControlled &&
88+
- !dragEvent.controlled) {
89+
- panelBefore.onCollapseChange.current(true);
90+
- return { dragOvershoot: newDragOvershoot };
91+
- }
92+
// Make it collapsed
93+
panelBefore.collapsed = true;
94+
panelBeforeNewValue = getUnitPixelValue(context, panelBefore.collapsedSize);
95+
@@ -667,7 +668,10 @@ function commitLayout(context) {
8296
});
8397
const staticWidth = getStaticWidth({ ...context, items: newItems });
8498
newItems.forEach((item, index) => {
@@ -90,7 +104,7 @@ index 8891ac0141135a3a885bd704d9d443458c7a01bf..80032b5a852c0117959808cff58b4cbf
90104
return;
91105
}
92106
newItems[index] = {
93-
@@ -795,7 +805,12 @@ function clearLastKnownSize(items) {
107+
@@ -795,7 +799,12 @@ function clearLastKnownSize(items) {
94108
function getDeltaForEvent(context, event) {
95109
const panel = getPanelWithId(context, event.panelId);
96110
if (event.type === "expandPanel") {

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)