@adecore/ui 0.31.11 → 0.32.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/dist/AccentSwatches.js +290 -13
- package/dist/Banner.js +90 -9
- package/dist/Button.js +114 -22
- package/dist/ButtonGroup.js +62 -8
- package/dist/Checkbox.js +73 -4
- package/dist/ChoiceCards.js +205 -11
- package/dist/CloseButton.js +87 -7
- package/dist/ColorSwatch.js +132 -15
- package/dist/ColorWheelPicker.js +305 -71
- package/dist/ColumnResizeHandle.js +43 -8
- package/dist/DisabledReason.js +27 -8
- package/dist/DockShell.js +144 -37
- package/dist/EmptyState.js +95 -6
- package/dist/ErrorBoundary.js +254 -31
- package/dist/Field.js +349 -31
- package/dist/FileIcon.js +67 -6
- package/dist/Icon.js +38 -6
- package/dist/IconButton.js +176 -20
- package/dist/IconPicker.js +344 -73
- package/dist/Input.js +233 -14
- package/dist/Kbd.js +150 -10
- package/dist/LazyBoundary.js +14 -5
- package/dist/ListRow.js +75 -15
- package/dist/Meter.js +108 -5
- package/dist/MiddleTruncate.js +126 -45
- package/dist/PanelEmpty.js +64 -5
- package/dist/PanelHeader.js +95 -13
- package/dist/Pill.js +114 -19
- package/dist/ProjectSwitcher.js +225 -12
- package/dist/PromptDialog.js +352 -37
- package/dist/SectionLabel.js +62 -8
- package/dist/SegmentBar.js +197 -36
- package/dist/Segmented.js +130 -23
- package/dist/Select.js +310 -19
- package/dist/SelectSearch.js +344 -29
- package/dist/Separator.js +35 -4
- package/dist/ShortcutHints.js +146 -76
- package/dist/Skeleton.js +31 -4
- package/dist/Slider.js +172 -10
- package/dist/SlidingColumn.js +194 -34
- package/dist/Spinner.js +100 -3
- package/dist/Stepper.js +232 -11
- package/dist/Surface.js +62 -8
- package/dist/Switch.js +60 -6
- package/dist/TextMenu.js +212 -17
- package/dist/Tile.js +149 -5
- package/dist/Toasts.js +391 -33
- package/dist/Tooltip.js +153 -16
- package/dist/UIProvider.js +62 -15
- package/dist/Waveform.js +362 -93
- package/dist/Wipe.js +259 -34
- package/dist/ZoomControls.js +356 -14
- package/dist/class-name.js +1 -1
- package/dist/clipboard.js +15 -17
- package/dist/context-menu/index.parts.js +1 -1
- package/dist/dialog/index.parts.js +1 -1
- package/dist/dialog/parts.js +378 -29
- package/dist/dialog-layer.js +51 -18
- package/dist/error-boundary.js +19 -19
- package/dist/error-message.js +1 -1
- package/dist/field-context.js +7 -5
- package/dist/file-icon.js +23 -21
- package/dist/file-tree/helpers.js +133 -119
- package/dist/file-tree/index.parts.js +3 -3
- package/dist/file-tree/parts.js +418 -127
- package/dist/file-tree/style.js +1 -1
- package/dist/file-tree/use-file-tree-shift.js +43 -30
- package/dist/file-tree/use-file-tree.js +60 -18
- package/dist/file-tree/use-slots.js +220 -192
- package/dist/floating.js +2 -2
- package/dist/format/datetime.js +88 -38
- package/dist/format/duration.js +59 -53
- package/dist/format/index.js +1 -1
- package/dist/format/locale.js +76 -56
- package/dist/format/number.js +77 -61
- package/dist/format/regions.js +4 -2
- package/dist/format/time-zone.js +1 -1
- package/dist/icon-button-size.js +12 -2
- package/dist/icon-picker.js +70 -61
- package/dist/index.js +57 -57
- package/dist/key-value-list/index.parts.js +1 -1
- package/dist/key-value-list/parts.js +256 -22
- package/dist/lazy-landings.js +10 -10
- package/dist/lazy.js +84 -71
- package/dist/locales/en.js +80 -80
- package/dist/locales/nl.js +80 -80
- package/dist/locales.js +10 -7
- package/dist/menu/index.parts.js +1 -1
- package/dist/menu/parts.js +882 -44
- package/dist/merge-refs.js +8 -9
- package/dist/middle-truncate.js +24 -25
- package/dist/modality.js +27 -19
- package/dist/placement.js +11 -20
- package/dist/platform.js +6 -6
- package/dist/popover/index.parts.js +1 -1
- package/dist/popover/parts.js +173 -11
- package/dist/popup-layer.js +38 -17
- package/dist/prefetch.js +78 -79
- package/dist/preview-card/index.parts.js +1 -1
- package/dist/project-switcher-row.js +153 -12
- package/dist/select-row.js +69 -5
- package/dist/select-shared.js +6 -6
- package/dist/selection.js +16 -16
- package/dist/seti-icons.js +413 -413
- package/dist/settings/ConfirmDialog.js +55 -8
- package/dist/settings/DetailHeader.js +72 -4
- package/dist/settings/MasterDetail.js +119 -7
- package/dist/settings/SettingsDialog.js +820 -80
- package/dist/settings/SettingsRow.js +205 -18
- package/dist/settings/SettingsSection.js +96 -6
- package/dist/settings/index.js +7 -7
- package/dist/settings/target.js +7 -2
- package/dist/shortcut-hints.js +73 -55
- package/dist/shortcut.js +140 -104
- package/dist/step-places.js +1 -1
- package/dist/tabs/index.parts.js +1 -1
- package/dist/tabs/overflow.js +18 -18
- package/dist/tabs/parts.js +780 -166
- package/dist/testing/dedupe.js +82 -75
- package/dist/testing/fake-source.js +12 -12
- package/dist/testing/index.js +1 -1
- package/dist/toast-store.js +65 -46
- package/dist/tree/index.parts.js +1 -1
- package/dist/tree/parts.js +721 -94
- package/dist/tree/shift.js +28 -22
- package/dist/tree/style.js +2 -2
- package/dist/tree/use-tree-shift.js +178 -117
- package/dist/useAsyncAction.js +23 -19
- package/dist/useColumnResize.js +36 -34
- package/dist/useContentSize.js +62 -18
- package/dist/useMeasuredWidth.js +14 -3
- package/dist/useNow.js +73 -30
- package/dist/wipe-split.js +14 -14
- package/dist/workspace/DropPreview.js +60 -7
- package/dist/workspace/SplitView.js +1025 -441
- package/dist/workspace/TabStrip.js +810 -191
- package/dist/workspace/Workspace.js +276 -26
- package/dist/workspace/context.js +8 -3
- package/dist/workspace/geometry.js +173 -150
- package/dist/workspace/model.js +313 -250
- package/dist/workspace/preview.js +61 -61
- package/dist/zoom.js +2 -2
- package/package.json +1 -1
- package/src/ErrorBoundary.tsx +1 -1
- package/src/Field.tsx +4 -3
- package/src/IconPicker.tsx +3 -3
- package/src/LazyBoundary.tsx +2 -0
- package/src/MiddleTruncate.tsx +2 -2
- package/src/SegmentBar.tsx +2 -2
- package/src/Toasts.tsx +3 -1
- package/src/Tooltip.tsx +7 -10
- package/src/Waveform.tsx +3 -3
- package/src/file-tree/parts.tsx +6 -9
- package/src/file-tree/use-file-tree-shift.tsx +6 -9
- package/src/lazy.tsx +4 -0
- package/src/locales/en.ts +4 -4
- package/src/locales/nl.ts +5 -5
- package/src/settings/SettingsDialog.tsx +1 -1
- package/src/tree/parts.tsx +5 -8
- package/src/useContentSize.ts +3 -3
- package/src/workspace/SplitView.tsx +2 -2
- package/src/workspace/TabStrip.tsx +2 -3
- package/src/workspace/Workspace.tsx +2 -5
|
@@ -1,468 +1,1052 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useCallback, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
4
4
|
import { GripVertical, Maximize2, Minimize2 } from 'lucide-react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { IconButton } from
|
|
7
|
+
import { IconButton } from "../IconButton.js";
|
|
8
8
|
import { WorkspaceContext } from './context.js';
|
|
9
9
|
import { paneRadius, resizeSplit, splitGeometry, splitSideAt, tabGapAt } from './geometry.js';
|
|
10
10
|
import { splitPanes, updateSplitLayout } from './model.js';
|
|
11
|
-
import { TabStrip } from
|
|
12
|
-
import { DropPreview } from
|
|
11
|
+
import { TabStrip } from "./TabStrip.js";
|
|
12
|
+
import { DropPreview } from "./DropPreview.js";
|
|
13
13
|
import { rectDropPreview, sameDropPreview, tabDropPreview } from './preview.js';
|
|
14
|
-
|
|
15
|
-
const
|
|
14
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const ZERO = {
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0,
|
|
18
|
+
left: 0,
|
|
19
|
+
top: 0,
|
|
20
|
+
scaleX: 1,
|
|
21
|
+
scaleY: 1
|
|
22
|
+
};
|
|
23
|
+
const MINIMUM = {
|
|
24
|
+
width: 120,
|
|
25
|
+
height: 80
|
|
26
|
+
};
|
|
16
27
|
/* The pane's section or header under `container`, found by its data attribute rather than a selector, so no id needs escaping. */
|
|
17
28
|
function paneElement(container, attribute, paneId) {
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
const selector = attribute === 'splitPane' ? '[data-split-pane]' : '[data-split-header]';
|
|
30
|
+
return Array.from(container?.querySelectorAll(selector) ?? []).find(element => element.dataset[attribute] === paneId);
|
|
20
31
|
}
|
|
21
|
-
function Divider(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
32
|
+
function Divider(t0) {
|
|
33
|
+
const $ = _c(55);
|
|
34
|
+
const {
|
|
35
|
+
divider,
|
|
36
|
+
minimumResizeShare,
|
|
37
|
+
onResize,
|
|
38
|
+
onEqualize
|
|
39
|
+
} = t0;
|
|
40
|
+
const {
|
|
41
|
+
t
|
|
42
|
+
} = useTranslation("ui");
|
|
43
|
+
const cleanup = useRef(null);
|
|
44
|
+
let t1;
|
|
45
|
+
let t2;
|
|
46
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47
|
+
t1 = () => () => cleanup.current?.();
|
|
48
|
+
t2 = [];
|
|
49
|
+
$[0] = t1;
|
|
50
|
+
$[1] = t2;
|
|
51
|
+
} else {
|
|
52
|
+
t1 = $[0];
|
|
53
|
+
t2 = $[1];
|
|
54
|
+
}
|
|
55
|
+
useEffect(t1, t2);
|
|
56
|
+
const horizontal = divider.axis === "horizontal";
|
|
57
|
+
let t3;
|
|
58
|
+
if ($[2] !== divider.index || $[3] !== divider.lengths) {
|
|
59
|
+
t3 = divider.lengths.slice(0, divider.index + 1).reduce(_temp, 0);
|
|
60
|
+
$[2] = divider.index;
|
|
61
|
+
$[3] = divider.lengths;
|
|
62
|
+
$[4] = t3;
|
|
63
|
+
} else {
|
|
64
|
+
t3 = $[4];
|
|
65
|
+
}
|
|
66
|
+
const before = t3;
|
|
67
|
+
let t10;
|
|
68
|
+
let t4;
|
|
69
|
+
let t5;
|
|
70
|
+
let t6;
|
|
71
|
+
let t7;
|
|
72
|
+
let t8;
|
|
73
|
+
let t9;
|
|
74
|
+
let total;
|
|
75
|
+
if ($[5] !== before || $[6] !== divider || $[7] !== horizontal || $[8] !== minimumResizeShare || $[9] !== t) {
|
|
76
|
+
total = divider.lengths.reduce(_temp2, 0);
|
|
77
|
+
const position = total ? Math.round(before / total * 100) : 0;
|
|
78
|
+
let t11;
|
|
79
|
+
if ($[18] !== divider || $[19] !== minimumResizeShare) {
|
|
80
|
+
t11 = delta => resizeSplit(divider, delta, false, 0, minimumResizeShare).slice(0, divider.index + 1).reduce(_temp3, 0) * 100;
|
|
81
|
+
$[18] = divider;
|
|
82
|
+
$[19] = minimumResizeShare;
|
|
83
|
+
$[20] = t11;
|
|
84
|
+
} else {
|
|
85
|
+
t11 = $[20];
|
|
86
|
+
}
|
|
87
|
+
const limit = t11;
|
|
88
|
+
t4 = "separator";
|
|
89
|
+
t5 = 0;
|
|
90
|
+
if ($[21] !== t) {
|
|
91
|
+
t6 = t("workspace.resize");
|
|
92
|
+
$[21] = t;
|
|
93
|
+
$[22] = t6;
|
|
94
|
+
} else {
|
|
95
|
+
t6 = $[22];
|
|
96
|
+
}
|
|
97
|
+
t7 = horizontal ? "vertical" : "horizontal";
|
|
98
|
+
t8 = position;
|
|
99
|
+
t9 = total ? Math.floor(limit(-total)) : 0;
|
|
100
|
+
t10 = total ? Math.ceil(limit(total)) : 100;
|
|
101
|
+
$[5] = before;
|
|
102
|
+
$[6] = divider;
|
|
103
|
+
$[7] = horizontal;
|
|
104
|
+
$[8] = minimumResizeShare;
|
|
105
|
+
$[9] = t;
|
|
106
|
+
$[10] = t10;
|
|
107
|
+
$[11] = t4;
|
|
108
|
+
$[12] = t5;
|
|
109
|
+
$[13] = t6;
|
|
110
|
+
$[14] = t7;
|
|
111
|
+
$[15] = t8;
|
|
112
|
+
$[16] = t9;
|
|
113
|
+
$[17] = total;
|
|
114
|
+
} else {
|
|
115
|
+
t10 = $[10];
|
|
116
|
+
t4 = $[11];
|
|
117
|
+
t5 = $[12];
|
|
118
|
+
t6 = $[13];
|
|
119
|
+
t7 = $[14];
|
|
120
|
+
t8 = $[15];
|
|
121
|
+
t9 = $[16];
|
|
122
|
+
total = $[17];
|
|
123
|
+
}
|
|
124
|
+
let t11;
|
|
125
|
+
if ($[23] !== divider.height || $[24] !== divider.width || $[25] !== divider.x || $[26] !== divider.y) {
|
|
126
|
+
t11 = {
|
|
127
|
+
left: divider.x,
|
|
128
|
+
top: divider.y,
|
|
129
|
+
width: divider.width,
|
|
130
|
+
height: divider.height
|
|
131
|
+
};
|
|
132
|
+
$[23] = divider.height;
|
|
133
|
+
$[24] = divider.width;
|
|
134
|
+
$[25] = divider.x;
|
|
135
|
+
$[26] = divider.y;
|
|
136
|
+
$[27] = t11;
|
|
137
|
+
} else {
|
|
138
|
+
t11 = $[27];
|
|
139
|
+
}
|
|
140
|
+
let t12;
|
|
141
|
+
if ($[28] !== onEqualize) {
|
|
142
|
+
t12 = event => onEqualize(event.altKey);
|
|
143
|
+
$[28] = onEqualize;
|
|
144
|
+
$[29] = t12;
|
|
145
|
+
} else {
|
|
146
|
+
t12 = $[29];
|
|
147
|
+
}
|
|
148
|
+
let t13;
|
|
149
|
+
if ($[30] !== divider || $[31] !== horizontal || $[32] !== minimumResizeShare || $[33] !== onEqualize || $[34] !== onResize || $[35] !== total) {
|
|
150
|
+
t13 = event_0 => {
|
|
151
|
+
const negative = horizontal ? "ArrowLeft" : "ArrowUp";
|
|
152
|
+
const positive = horizontal ? "ArrowRight" : "ArrowDown";
|
|
153
|
+
if (event_0.key === "Enter") {
|
|
154
|
+
event_0.preventDefault();
|
|
155
|
+
onEqualize(event_0.altKey);
|
|
156
|
+
} else {
|
|
157
|
+
if ([negative, positive, "Home", "End"].includes(event_0.key)) {
|
|
158
|
+
event_0.preventDefault();
|
|
159
|
+
const delta_0 = event_0.key === "Home" ? -total : event_0.key === "End" ? total : (event_0.key === negative ? -1 : 1) * (event_0.shiftKey ? 50 : 10);
|
|
160
|
+
onResize(resizeSplit(divider, delta_0, event_0.altKey, 0, minimumResizeShare));
|
|
138
161
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
$[30] = divider;
|
|
165
|
+
$[31] = horizontal;
|
|
166
|
+
$[32] = minimumResizeShare;
|
|
167
|
+
$[33] = onEqualize;
|
|
168
|
+
$[34] = onResize;
|
|
169
|
+
$[35] = total;
|
|
170
|
+
$[36] = t13;
|
|
171
|
+
} else {
|
|
172
|
+
t13 = $[36];
|
|
173
|
+
}
|
|
174
|
+
let t14;
|
|
175
|
+
if ($[37] !== divider || $[38] !== horizontal || $[39] !== minimumResizeShare || $[40] !== onResize) {
|
|
176
|
+
t14 = event_1 => {
|
|
177
|
+
if (event_1.button !== 0) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
event_1.preventDefault();
|
|
181
|
+
cleanup.current?.();
|
|
182
|
+
const element = event_1.currentTarget;
|
|
183
|
+
const view = element.ownerDocument.defaultView;
|
|
184
|
+
const pointerId = event_1.pointerId;
|
|
185
|
+
const start = horizontal ? event_1.clientX : event_1.clientY;
|
|
186
|
+
const parent = element.parentElement;
|
|
187
|
+
const rect = parent?.getBoundingClientRect();
|
|
188
|
+
const scale = horizontal ? (rect?.width ?? 1) / (parent?.clientWidth || 1) : (rect?.height ?? 1) / (parent?.clientHeight || 1);
|
|
189
|
+
element.dataset.resizing = "";
|
|
190
|
+
element.focus();
|
|
191
|
+
let frame = 0;
|
|
192
|
+
let pending = null;
|
|
193
|
+
const apply = () => {
|
|
194
|
+
frame = 0;
|
|
195
|
+
const next = pending;
|
|
196
|
+
pending = null;
|
|
197
|
+
if (next) {
|
|
198
|
+
const delta_1 = ((horizontal ? next.clientX : next.clientY) - start) / (scale || 1);
|
|
199
|
+
onResize(resizeSplit(divider, delta_1, next.altKey, 8 / (scale || 1), minimumResizeShare));
|
|
150
200
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
});
|
|
156
|
-
const dispatch = useCallback((command) => {
|
|
157
|
-
const state = latest.current;
|
|
158
|
-
const next = updateSplitLayout(state.value, command);
|
|
159
|
-
if (next !== state.value) {
|
|
160
|
-
state.onValueChange(next, command);
|
|
201
|
+
};
|
|
202
|
+
const move = next_0 => {
|
|
203
|
+
if (next_0.pointerId !== pointerId) {
|
|
204
|
+
return;
|
|
161
205
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (!element) {
|
|
166
|
-
return;
|
|
206
|
+
pending = next_0;
|
|
207
|
+
if (frame !== 0) {
|
|
208
|
+
return;
|
|
167
209
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
left: rect.left,
|
|
173
|
-
top: rect.top,
|
|
174
|
-
scaleX: rect.width / (element.clientWidth || 1),
|
|
175
|
-
scaleY: rect.height / (element.clientHeight || 1)
|
|
176
|
-
};
|
|
177
|
-
setMeasurement((current) => (Object.keys(next).every((key) => current[key] === next[key]) ? current : next));
|
|
178
|
-
}, []);
|
|
179
|
-
useLayoutEffect(measure);
|
|
180
|
-
useEffect(() => {
|
|
181
|
-
const element = root.current;
|
|
182
|
-
if (!element) {
|
|
183
|
-
return;
|
|
210
|
+
if (view) {
|
|
211
|
+
frame = view.requestAnimationFrame(apply);
|
|
212
|
+
} else {
|
|
213
|
+
apply();
|
|
184
214
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return () => {
|
|
191
|
-
observer?.disconnect();
|
|
192
|
-
view?.removeEventListener('resize', measure);
|
|
193
|
-
view?.removeEventListener('scroll', measure, true);
|
|
194
|
-
};
|
|
195
|
-
}, [measure]);
|
|
196
|
-
const stopDrag = useCallback(() => {
|
|
197
|
-
drag.current = null;
|
|
198
|
-
setDragging(false);
|
|
199
|
-
showPreview(null);
|
|
200
|
-
}, [showPreview]);
|
|
201
|
-
useEffect(() => {
|
|
202
|
-
if (!dragging) {
|
|
203
|
-
return;
|
|
215
|
+
};
|
|
216
|
+
const release = () => {
|
|
217
|
+
if (frame !== 0) {
|
|
218
|
+
view?.cancelAnimationFrame(frame);
|
|
219
|
+
apply();
|
|
204
220
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
document?.removeEventListener('dragend', stopDrag);
|
|
212
|
-
document?.removeEventListener('drop', stopDrag);
|
|
213
|
-
view?.removeEventListener('blur', stopDrag);
|
|
214
|
-
};
|
|
215
|
-
}, [dragging, stopDrag]);
|
|
216
|
-
const gap = layout === 'roomy' ? 8 : 1;
|
|
217
|
-
const barHeight = showTabs || renderPaneHeader ? Math.max(0, headerHeight) : 0;
|
|
218
|
-
const geometry = splitGeometry(value, measurement.width, measurement.height, gap, (pane) => typeof minimumSize === 'function' ? minimumSize(pane) : minimumSize);
|
|
219
|
-
const panes = splitPanes(value.root);
|
|
220
|
-
// A stable sibling order also avoids DOM moves, which reload embedded browsing contexts.
|
|
221
|
-
const views = panes
|
|
222
|
-
.flatMap((pane) => pane.views.map((viewId) => ({ pane, viewId })))
|
|
223
|
-
.sort((left, right) => (left.viewId < right.viewId ? -1 : left.viewId > right.viewId ? 1 : 0));
|
|
224
|
-
const visible = new Map(geometry.panes.map((pane) => [pane.pane.id, pane]));
|
|
225
|
-
const radius = (rect) => paneRadius(rect, measurement.width, measurement.height, edges, layout === 'roomy' ? 8 : 0);
|
|
226
|
-
// A header squares off the top corners of the body under it.
|
|
227
|
-
const bodyRadius = (rect, header) => {
|
|
228
|
-
const corners = radius(rect).split(' ');
|
|
229
|
-
if (header > 0) {
|
|
230
|
-
corners[0] = corners[1] = '0px';
|
|
221
|
+
end();
|
|
222
|
+
};
|
|
223
|
+
const end = () => {
|
|
224
|
+
if (frame !== 0) {
|
|
225
|
+
view?.cancelAnimationFrame(frame);
|
|
226
|
+
frame = 0;
|
|
231
227
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
y: measurement.top + (rect.y + header) * measurement.scaleY,
|
|
241
|
-
width: rect.width * measurement.scaleX,
|
|
242
|
-
height: Math.max(0, rect.height - header) * measurement.scaleY
|
|
243
|
-
}
|
|
244
|
-
: { x: 0, y: 0, width: 0, height: 0 };
|
|
245
|
-
const borderRadius = rect ? bodyRadius(rect, header) : '0px 0px 0px 0px';
|
|
246
|
-
return pane.views.map((viewId) => ({ viewId, paneId: pane.id, active: !!rect && pane.active === viewId, rect: body, borderRadius }));
|
|
247
|
-
});
|
|
248
|
-
const boundsKey = JSON.stringify(bounds);
|
|
249
|
-
const reportedBounds = useRef('');
|
|
250
|
-
const boundsCallback = useRef(onViewBoundsChange);
|
|
251
|
-
useLayoutEffect(() => {
|
|
252
|
-
boundsCallback.current = onViewBoundsChange;
|
|
253
|
-
});
|
|
254
|
-
useEffect(() => () => boundsCallback.current?.([]), []);
|
|
255
|
-
useLayoutEffect(() => {
|
|
256
|
-
if (onViewBoundsChange && reportedBounds.current !== boundsKey) {
|
|
257
|
-
reportedBounds.current = boundsKey;
|
|
258
|
-
onViewBoundsChange(bounds);
|
|
228
|
+
element.removeEventListener("pointermove", move);
|
|
229
|
+
element.removeEventListener("pointerup", release);
|
|
230
|
+
element.removeEventListener("pointercancel", end);
|
|
231
|
+
element.removeEventListener("lostpointercapture", end);
|
|
232
|
+
element.ownerDocument.defaultView?.removeEventListener("blur", end);
|
|
233
|
+
delete element.dataset.resizing;
|
|
234
|
+
if (element.hasPointerCapture(pointerId)) {
|
|
235
|
+
element.releasePointerCapture(pointerId);
|
|
259
236
|
}
|
|
237
|
+
cleanup.current = null;
|
|
238
|
+
};
|
|
239
|
+
cleanup.current = end;
|
|
240
|
+
element.setPointerCapture(pointerId);
|
|
241
|
+
element.addEventListener("pointermove", move);
|
|
242
|
+
element.addEventListener("pointerup", release);
|
|
243
|
+
element.addEventListener("pointercancel", end);
|
|
244
|
+
element.addEventListener("lostpointercapture", end);
|
|
245
|
+
element.ownerDocument.defaultView?.addEventListener("blur", end);
|
|
246
|
+
};
|
|
247
|
+
$[37] = divider;
|
|
248
|
+
$[38] = horizontal;
|
|
249
|
+
$[39] = minimumResizeShare;
|
|
250
|
+
$[40] = onResize;
|
|
251
|
+
$[41] = t14;
|
|
252
|
+
} else {
|
|
253
|
+
t14 = $[41];
|
|
254
|
+
}
|
|
255
|
+
let t15;
|
|
256
|
+
if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
257
|
+
t15 = /*#__PURE__*/_jsx("span", {});
|
|
258
|
+
$[42] = t15;
|
|
259
|
+
} else {
|
|
260
|
+
t15 = $[42];
|
|
261
|
+
}
|
|
262
|
+
let t16;
|
|
263
|
+
if ($[43] !== t10 || $[44] !== t11 || $[45] !== t12 || $[46] !== t13 || $[47] !== t14 || $[48] !== t4 || $[49] !== t5 || $[50] !== t6 || $[51] !== t7 || $[52] !== t8 || $[53] !== t9) {
|
|
264
|
+
t16 = /*#__PURE__*/_jsx("div", {
|
|
265
|
+
role: t4,
|
|
266
|
+
tabIndex: t5,
|
|
267
|
+
"aria-label": t6,
|
|
268
|
+
"aria-orientation": t7,
|
|
269
|
+
"aria-valuenow": t8,
|
|
270
|
+
"aria-valuemin": t9,
|
|
271
|
+
"aria-valuemax": t10,
|
|
272
|
+
className: "ade-split-divider",
|
|
273
|
+
style: t11,
|
|
274
|
+
onDoubleClick: t12,
|
|
275
|
+
onKeyDown: t13,
|
|
276
|
+
onPointerDown: t14,
|
|
277
|
+
children: t15
|
|
260
278
|
});
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
279
|
+
$[43] = t10;
|
|
280
|
+
$[44] = t11;
|
|
281
|
+
$[45] = t12;
|
|
282
|
+
$[46] = t13;
|
|
283
|
+
$[47] = t14;
|
|
284
|
+
$[48] = t4;
|
|
285
|
+
$[49] = t5;
|
|
286
|
+
$[50] = t6;
|
|
287
|
+
$[51] = t7;
|
|
288
|
+
$[52] = t8;
|
|
289
|
+
$[53] = t9;
|
|
290
|
+
$[54] = t16;
|
|
291
|
+
} else {
|
|
292
|
+
t16 = $[54];
|
|
293
|
+
}
|
|
294
|
+
return t16;
|
|
295
|
+
}
|
|
296
|
+
function _temp3(sum_1, size) {
|
|
297
|
+
return sum_1 + size;
|
|
298
|
+
}
|
|
299
|
+
function _temp2(sum_0, value_0) {
|
|
300
|
+
return sum_0 + value_0;
|
|
301
|
+
}
|
|
302
|
+
function _temp(sum, value) {
|
|
303
|
+
return sum + value;
|
|
304
|
+
}
|
|
305
|
+
export function SplitView(t0) {
|
|
306
|
+
const $ = _c(58);
|
|
307
|
+
const {
|
|
308
|
+
value,
|
|
309
|
+
onValueChange,
|
|
310
|
+
renderView,
|
|
311
|
+
getTab,
|
|
312
|
+
renderPaneHeader,
|
|
313
|
+
onClose,
|
|
314
|
+
onTabDoubleClick,
|
|
315
|
+
onTabContextMenu,
|
|
316
|
+
onViewDragStart,
|
|
317
|
+
canDrop,
|
|
318
|
+
canDropExternal,
|
|
319
|
+
onExternalDrop,
|
|
320
|
+
onViewBoundsChange,
|
|
321
|
+
minimumSize: t1,
|
|
322
|
+
minimumResizeShare: t2,
|
|
323
|
+
layout: ownLayout,
|
|
324
|
+
flushEdges,
|
|
325
|
+
showTabs: t3,
|
|
326
|
+
headerHeight: t4,
|
|
327
|
+
render,
|
|
328
|
+
ref,
|
|
329
|
+
className,
|
|
330
|
+
style,
|
|
331
|
+
...props
|
|
332
|
+
} = t0;
|
|
333
|
+
const minimumSize = t1 === undefined ? MINIMUM : t1;
|
|
334
|
+
const minimumResizeShare = t2 === undefined ? 0 : t2;
|
|
335
|
+
const showTabs = t3 === undefined ? true : t3;
|
|
336
|
+
const headerHeight = t4 === undefined ? 36 : t4;
|
|
337
|
+
const {
|
|
338
|
+
t
|
|
339
|
+
} = useTranslation("ui");
|
|
340
|
+
const inherited = useContext(WorkspaceContext);
|
|
341
|
+
const layout = ownLayout ?? inherited.layout;
|
|
342
|
+
const edges = flushEdges ?? inherited.edges;
|
|
343
|
+
const root = useRef(null);
|
|
344
|
+
const prefix = useId();
|
|
345
|
+
const serial = useRef(0);
|
|
346
|
+
const lastFocus = useRef(null);
|
|
347
|
+
let t5;
|
|
348
|
+
if ($[0] !== value.focused) {
|
|
349
|
+
t5 = () => {
|
|
350
|
+
const previous = lastFocus.current;
|
|
351
|
+
const element = root.current;
|
|
352
|
+
const active = element?.ownerDocument.activeElement;
|
|
353
|
+
if (previous && element && (!previous.isConnected || previous.closest("[hidden]")) && (!active || active === element.ownerDocument.body || active === previous)) {
|
|
354
|
+
const pane = paneElement(element, "splitPane", value.focused);
|
|
355
|
+
const target = pane?.querySelector("[role=\"tab\"][aria-selected=\"true\"]") ?? pane;
|
|
356
|
+
target?.focus({
|
|
357
|
+
preventScroll: true
|
|
358
|
+
});
|
|
359
|
+
}
|
|
270
360
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
361
|
+
$[0] = value.focused;
|
|
362
|
+
$[1] = t5;
|
|
363
|
+
} else {
|
|
364
|
+
t5 = $[1];
|
|
365
|
+
}
|
|
366
|
+
useEffect(t5);
|
|
367
|
+
const [measurement, setMeasurement] = useState(ZERO);
|
|
368
|
+
const [dragging, setDragging] = useState(false);
|
|
369
|
+
const drag = useRef(null);
|
|
370
|
+
const [preview, setPreview] = useState(null);
|
|
371
|
+
const shownPreview = useRef(null);
|
|
372
|
+
let t6;
|
|
373
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
374
|
+
t6 = shape => {
|
|
375
|
+
if (!sameDropPreview(shownPreview.current, shape)) {
|
|
376
|
+
shownPreview.current = shape;
|
|
377
|
+
setPreview(shape);
|
|
378
|
+
}
|
|
289
379
|
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
const tabRects = Array.from(strip?.querySelectorAll('[data-document-tab]') ?? [], (element) => element.getBoundingClientRect());
|
|
301
|
-
const side = inHeader ? undefined : (splitSideAt(rect, x, y) ?? 'center');
|
|
302
|
-
const index = inHeader ? tabGapAt(tabRects, event.clientX) : undefined;
|
|
303
|
-
const target = { paneId: rect.pane.id, side, index };
|
|
304
|
-
const command = commandFor(target);
|
|
305
|
-
if (drag.current) {
|
|
306
|
-
if (canDrop?.(drag.current, target) === false || !command || updateSplitLayout(value, command) === value) {
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
else if (!onExternalDrop || !canDropExternal?.(event, target)) {
|
|
311
|
-
return null;
|
|
312
|
-
}
|
|
313
|
-
if (side === 'center') {
|
|
314
|
-
return { target, shape: rectDropPreview(rect) };
|
|
315
|
-
}
|
|
316
|
-
if (side) {
|
|
317
|
-
const horizontal = side === 'left' || side === 'right';
|
|
318
|
-
const width = horizontal ? Math.max(0, (rect.width - gap) / 2) : rect.width;
|
|
319
|
-
const height = horizontal ? rect.height : Math.max(0, (rect.height - gap) / 2);
|
|
320
|
-
return {
|
|
321
|
-
target,
|
|
322
|
-
shape: rectDropPreview({
|
|
323
|
-
x: side === 'right' ? rect.x + rect.width - width : rect.x,
|
|
324
|
-
y: side === 'bottom' ? rect.y + rect.height - height : rect.y,
|
|
325
|
-
width,
|
|
326
|
-
height
|
|
327
|
-
})
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
if (header === 0) {
|
|
331
|
-
return { target, shape: rectDropPreview(rect) };
|
|
332
|
-
}
|
|
333
|
-
const tabWidth = Math.min(rect.width, (drag.current?.width ?? 128) / (measurement.scaleX || 1));
|
|
334
|
-
const next = tabRects[index ?? tabRects.length];
|
|
335
|
-
const left = next?.left ?? tabRects.at(-1)?.right ?? measurement.left + rect.x * measurement.scaleX;
|
|
336
|
-
const relative = Math.max(0, Math.min(rect.width - tabWidth, (left - measurement.left) / (measurement.scaleX || 1) - rect.x));
|
|
337
|
-
return {
|
|
338
|
-
target,
|
|
339
|
-
shape: tabDropPreview({ gap: index ?? rect.pane.views.length, left: relative, tabWidth, width: rect.width, height: rect.height, barHeight: header }, { x: rect.x, y: rect.y })
|
|
340
|
-
};
|
|
380
|
+
$[2] = t6;
|
|
381
|
+
} else {
|
|
382
|
+
t6 = $[2];
|
|
383
|
+
}
|
|
384
|
+
const showPreview = t6;
|
|
385
|
+
let t7;
|
|
386
|
+
if ($[3] !== onValueChange || $[4] !== value) {
|
|
387
|
+
t7 = {
|
|
388
|
+
value,
|
|
389
|
+
onValueChange
|
|
341
390
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
if (next) {
|
|
357
|
-
dispatch({ type: 'focus', paneId: next.pane.id });
|
|
358
|
-
const element = paneElement(root.current, 'splitPane', next.pane.id);
|
|
359
|
-
element?.querySelector('[role="tab"][aria-selected="true"]')?.focus();
|
|
360
|
-
if (!showTabs) {
|
|
361
|
-
element?.focus();
|
|
362
|
-
}
|
|
363
|
-
}
|
|
391
|
+
$[3] = onValueChange;
|
|
392
|
+
$[4] = value;
|
|
393
|
+
$[5] = t7;
|
|
394
|
+
} else {
|
|
395
|
+
t7 = $[5];
|
|
396
|
+
}
|
|
397
|
+
const latest = useRef(t7);
|
|
398
|
+
let t8;
|
|
399
|
+
if ($[6] !== onValueChange || $[7] !== value) {
|
|
400
|
+
t8 = () => {
|
|
401
|
+
latest.current = {
|
|
402
|
+
value,
|
|
403
|
+
onValueChange
|
|
404
|
+
};
|
|
364
405
|
};
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
406
|
+
$[6] = onValueChange;
|
|
407
|
+
$[7] = value;
|
|
408
|
+
$[8] = t8;
|
|
409
|
+
} else {
|
|
410
|
+
t8 = $[8];
|
|
411
|
+
}
|
|
412
|
+
useLayoutEffect(t8);
|
|
413
|
+
const dispatch = command => {
|
|
414
|
+
const state = latest.current;
|
|
415
|
+
const next = updateSplitLayout(state.value, command);
|
|
416
|
+
if (next !== state.value) {
|
|
417
|
+
state.onValueChange(next, command);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
let t9;
|
|
421
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
422
|
+
t9 = () => {
|
|
423
|
+
const element_0 = root.current;
|
|
424
|
+
if (!element_0) {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
const rect = element_0.getBoundingClientRect();
|
|
428
|
+
const next_0 = {
|
|
429
|
+
width: element_0.clientWidth,
|
|
430
|
+
height: element_0.clientHeight,
|
|
431
|
+
left: rect.left,
|
|
432
|
+
top: rect.top,
|
|
433
|
+
scaleX: rect.width / (element_0.clientWidth || 1),
|
|
434
|
+
scaleY: rect.height / (element_0.clientHeight || 1)
|
|
435
|
+
};
|
|
436
|
+
setMeasurement(current => Object.keys(next_0).every(key => current[key] === next_0[key]) ? current : next_0);
|
|
437
|
+
};
|
|
438
|
+
$[9] = t9;
|
|
439
|
+
} else {
|
|
440
|
+
t9 = $[9];
|
|
441
|
+
}
|
|
442
|
+
const measure = t9;
|
|
443
|
+
useLayoutEffect(measure);
|
|
444
|
+
let t10;
|
|
445
|
+
let t11;
|
|
446
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
447
|
+
t10 = () => {
|
|
448
|
+
const element_1 = root.current;
|
|
449
|
+
if (!element_1) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
453
|
+
observer?.observe(element_1);
|
|
454
|
+
const view = element_1.ownerDocument.defaultView;
|
|
455
|
+
view?.addEventListener("resize", measure);
|
|
456
|
+
view?.addEventListener("scroll", measure, true);
|
|
457
|
+
return () => {
|
|
458
|
+
observer?.disconnect();
|
|
459
|
+
view?.removeEventListener("resize", measure);
|
|
460
|
+
view?.removeEventListener("scroll", measure, true);
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
t11 = [measure];
|
|
464
|
+
$[10] = t10;
|
|
465
|
+
$[11] = t11;
|
|
466
|
+
} else {
|
|
467
|
+
t10 = $[10];
|
|
468
|
+
t11 = $[11];
|
|
469
|
+
}
|
|
470
|
+
useEffect(t10, t11);
|
|
471
|
+
let t12;
|
|
472
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
473
|
+
t12 = () => {
|
|
474
|
+
drag.current = null;
|
|
475
|
+
setDragging(false);
|
|
476
|
+
showPreview(null);
|
|
477
|
+
};
|
|
478
|
+
$[12] = t12;
|
|
479
|
+
} else {
|
|
480
|
+
t12 = $[12];
|
|
481
|
+
}
|
|
482
|
+
const stopDrag = t12;
|
|
483
|
+
let t13;
|
|
484
|
+
let t14;
|
|
485
|
+
if ($[13] !== dragging) {
|
|
486
|
+
t13 = () => {
|
|
487
|
+
if (!dragging) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const document = root.current?.ownerDocument;
|
|
491
|
+
const view_0 = document?.defaultView;
|
|
492
|
+
document?.addEventListener("dragend", stopDrag);
|
|
493
|
+
document?.addEventListener("drop", stopDrag);
|
|
494
|
+
view_0?.addEventListener("blur", stopDrag);
|
|
495
|
+
return () => {
|
|
496
|
+
document?.removeEventListener("dragend", stopDrag);
|
|
497
|
+
document?.removeEventListener("drop", stopDrag);
|
|
498
|
+
view_0?.removeEventListener("blur", stopDrag);
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
t14 = [dragging, stopDrag];
|
|
502
|
+
$[13] = dragging;
|
|
503
|
+
$[14] = t13;
|
|
504
|
+
$[15] = t14;
|
|
505
|
+
} else {
|
|
506
|
+
t13 = $[14];
|
|
507
|
+
t14 = $[15];
|
|
508
|
+
}
|
|
509
|
+
useEffect(t13, t14);
|
|
510
|
+
const gap = layout === "roomy" ? 8 : 1;
|
|
511
|
+
const barHeight = showTabs || renderPaneHeader ? Math.max(0, headerHeight) : 0;
|
|
512
|
+
let t15;
|
|
513
|
+
if ($[16] !== minimumSize) {
|
|
514
|
+
t15 = pane_0 => typeof minimumSize === "function" ? minimumSize(pane_0) : minimumSize;
|
|
515
|
+
$[16] = minimumSize;
|
|
516
|
+
$[17] = t15;
|
|
517
|
+
} else {
|
|
518
|
+
t15 = $[17];
|
|
519
|
+
}
|
|
520
|
+
const geometry = splitGeometry(value, measurement.width, measurement.height, gap, t15);
|
|
521
|
+
const panes = splitPanes(value.root);
|
|
522
|
+
const views = panes.flatMap(_temp4).sort(_temp5);
|
|
523
|
+
const visible = new Map(geometry.panes.map(_temp6));
|
|
524
|
+
let t16;
|
|
525
|
+
if ($[18] !== edges || $[19] !== layout || $[20] !== measurement.height || $[21] !== measurement.width) {
|
|
526
|
+
t16 = rect_0 => paneRadius(rect_0, measurement.width, measurement.height, edges, layout === "roomy" ? 8 : 0);
|
|
527
|
+
$[18] = edges;
|
|
528
|
+
$[19] = layout;
|
|
529
|
+
$[20] = measurement.height;
|
|
530
|
+
$[21] = measurement.width;
|
|
531
|
+
$[22] = t16;
|
|
532
|
+
} else {
|
|
533
|
+
t16 = $[22];
|
|
534
|
+
}
|
|
535
|
+
const radius = t16;
|
|
536
|
+
let t17;
|
|
537
|
+
if ($[23] !== radius) {
|
|
538
|
+
t17 = (rect_1, header) => {
|
|
539
|
+
const corners = radius(rect_1).split(" ");
|
|
540
|
+
if (header > 0) {
|
|
541
|
+
corners[0] = corners[1] = "0px";
|
|
542
|
+
}
|
|
543
|
+
return corners.join(" ");
|
|
544
|
+
};
|
|
545
|
+
$[23] = radius;
|
|
546
|
+
$[24] = t17;
|
|
547
|
+
} else {
|
|
548
|
+
t17 = $[24];
|
|
549
|
+
}
|
|
550
|
+
const bodyRadius = t17;
|
|
551
|
+
const bounds = panes.flatMap(pane_3 => {
|
|
552
|
+
const rect_2 = visible.get(pane_3.id);
|
|
553
|
+
const header_0 = Math.min(barHeight, rect_2?.height ?? 0);
|
|
554
|
+
const body = rect_2 ? {
|
|
555
|
+
x: measurement.left + rect_2.x * measurement.scaleX,
|
|
556
|
+
y: measurement.top + (rect_2.y + header_0) * measurement.scaleY,
|
|
557
|
+
width: rect_2.width * measurement.scaleX,
|
|
558
|
+
height: Math.max(0, rect_2.height - header_0) * measurement.scaleY
|
|
559
|
+
} : {
|
|
560
|
+
x: 0,
|
|
561
|
+
y: 0,
|
|
562
|
+
width: 0,
|
|
563
|
+
height: 0
|
|
564
|
+
};
|
|
565
|
+
const borderRadius = rect_2 ? bodyRadius(rect_2, header_0) : "0px 0px 0px 0px";
|
|
566
|
+
return pane_3.views.map(viewId_0 => ({
|
|
567
|
+
viewId: viewId_0,
|
|
568
|
+
paneId: pane_3.id,
|
|
569
|
+
active: !!rect_2 && pane_3.active === viewId_0,
|
|
570
|
+
rect: body,
|
|
571
|
+
borderRadius
|
|
572
|
+
}));
|
|
573
|
+
});
|
|
574
|
+
const boundsKey = JSON.stringify(bounds);
|
|
575
|
+
const reportedBounds = useRef("");
|
|
576
|
+
const boundsCallback = useRef(onViewBoundsChange);
|
|
577
|
+
let t18;
|
|
578
|
+
if ($[25] !== onViewBoundsChange) {
|
|
579
|
+
t18 = () => {
|
|
580
|
+
boundsCallback.current = onViewBoundsChange;
|
|
581
|
+
};
|
|
582
|
+
$[25] = onViewBoundsChange;
|
|
583
|
+
$[26] = t18;
|
|
584
|
+
} else {
|
|
585
|
+
t18 = $[26];
|
|
586
|
+
}
|
|
587
|
+
useLayoutEffect(t18);
|
|
588
|
+
let t19;
|
|
589
|
+
let t20;
|
|
590
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
591
|
+
t19 = () => () => boundsCallback.current?.([]);
|
|
592
|
+
t20 = [];
|
|
593
|
+
$[27] = t19;
|
|
594
|
+
$[28] = t20;
|
|
595
|
+
} else {
|
|
596
|
+
t19 = $[27];
|
|
597
|
+
t20 = $[28];
|
|
598
|
+
}
|
|
599
|
+
useEffect(t19, t20);
|
|
600
|
+
useLayoutEffect(() => {
|
|
601
|
+
if (onViewBoundsChange && reportedBounds.current !== boundsKey) {
|
|
602
|
+
reportedBounds.current = boundsKey;
|
|
603
|
+
onViewBoundsChange(bounds);
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
let t21;
|
|
607
|
+
if ($[29] !== prefix) {
|
|
608
|
+
t21 = (kind, viewId_1) => `${prefix}-${kind}-${encodeURIComponent(viewId_1)}`;
|
|
609
|
+
$[29] = prefix;
|
|
610
|
+
$[30] = t21;
|
|
611
|
+
} else {
|
|
612
|
+
t21 = $[30];
|
|
613
|
+
}
|
|
614
|
+
const id = t21;
|
|
615
|
+
const startDrag = (pane_4, event, viewId_2) => {
|
|
616
|
+
drag.current = {
|
|
617
|
+
sourceId: pane_4.id,
|
|
618
|
+
viewId: viewId_2,
|
|
619
|
+
width: event.currentTarget.closest("[data-document-tab]")?.getBoundingClientRect().width ?? 128
|
|
620
|
+
};
|
|
621
|
+
event.dataTransfer.setData("application/x-adecore-view", JSON.stringify({
|
|
622
|
+
workspace: prefix,
|
|
623
|
+
paneId: pane_4.id,
|
|
624
|
+
viewId: viewId_2
|
|
625
|
+
}));
|
|
626
|
+
event.dataTransfer.effectAllowed = "move";
|
|
627
|
+
if (viewId_2) {
|
|
628
|
+
onViewDragStart?.(viewId_2, event);
|
|
629
|
+
}
|
|
630
|
+
setDragging(true);
|
|
631
|
+
};
|
|
632
|
+
const commandFor = target_0 => {
|
|
633
|
+
if (!drag.current) {
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
const {
|
|
637
|
+
sourceId,
|
|
638
|
+
viewId: viewId_3
|
|
639
|
+
} = drag.current;
|
|
640
|
+
if (target_0.side === "center") {
|
|
641
|
+
return {
|
|
642
|
+
type: "swap",
|
|
643
|
+
sourceId,
|
|
644
|
+
targetId: target_0.paneId,
|
|
645
|
+
viewId: viewId_3
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
return {
|
|
649
|
+
type: "move",
|
|
650
|
+
sourceId,
|
|
651
|
+
viewId: viewId_3,
|
|
652
|
+
targetId: target_0.paneId,
|
|
653
|
+
side: target_0.side,
|
|
654
|
+
index: target_0.index,
|
|
655
|
+
newPaneId: `${prefix}-pane-${serial.current}`,
|
|
656
|
+
splitId: `${prefix}-split-${serial.current}`
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
const locateDrop = event_0 => {
|
|
660
|
+
const x = (event_0.clientX - measurement.left) / (measurement.scaleX || 1);
|
|
661
|
+
const y = (event_0.clientY - measurement.top) / (measurement.scaleY || 1);
|
|
662
|
+
const rect_3 = geometry.panes.find(item => x >= item.x && x <= item.x + item.width && y >= item.y && y <= item.y + item.height);
|
|
663
|
+
if (!rect_3) {
|
|
664
|
+
return null;
|
|
665
|
+
}
|
|
666
|
+
const header_1 = Math.min(barHeight, rect_3.height);
|
|
667
|
+
const inHeader = y < rect_3.y + header_1;
|
|
668
|
+
const strip = inHeader ? paneElement(root.current, "splitHeader", rect_3.pane.id) : undefined;
|
|
669
|
+
const tabRects = Array.from(strip?.querySelectorAll("[data-document-tab]") ?? [], _temp7);
|
|
670
|
+
const side = inHeader ? undefined : splitSideAt(rect_3, x, y) ?? "center";
|
|
671
|
+
const index = inHeader ? tabGapAt(tabRects, event_0.clientX) : undefined;
|
|
672
|
+
const target_1 = {
|
|
673
|
+
paneId: rect_3.pane.id,
|
|
674
|
+
side,
|
|
675
|
+
index
|
|
676
|
+
};
|
|
677
|
+
const command_0 = commandFor(target_1);
|
|
678
|
+
if (drag.current) {
|
|
679
|
+
if (canDrop?.(drag.current, target_1) === false || !command_0 || updateSplitLayout(value, command_0) === value) {
|
|
680
|
+
return null;
|
|
681
|
+
}
|
|
682
|
+
} else {
|
|
683
|
+
if (!onExternalDrop || !canDropExternal?.(event_0, target_1)) {
|
|
684
|
+
return null;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
if (side === "center") {
|
|
688
|
+
return {
|
|
689
|
+
target: target_1,
|
|
690
|
+
shape: rectDropPreview(rect_3)
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
if (side) {
|
|
694
|
+
const horizontal = side === "left" || side === "right";
|
|
695
|
+
const width = horizontal ? Math.max(0, (rect_3.width - gap) / 2) : rect_3.width;
|
|
696
|
+
const height = horizontal ? rect_3.height : Math.max(0, (rect_3.height - gap) / 2);
|
|
697
|
+
return {
|
|
698
|
+
target: target_1,
|
|
699
|
+
shape: rectDropPreview({
|
|
700
|
+
x: side === "right" ? rect_3.x + rect_3.width - width : rect_3.x,
|
|
701
|
+
y: side === "bottom" ? rect_3.y + rect_3.height - height : rect_3.y,
|
|
702
|
+
width,
|
|
703
|
+
height
|
|
704
|
+
})
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
if (header_1 === 0) {
|
|
708
|
+
return {
|
|
709
|
+
target: target_1,
|
|
710
|
+
shape: rectDropPreview(rect_3)
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
const tabWidth = Math.min(rect_3.width, (drag.current?.width ?? 128) / (measurement.scaleX || 1));
|
|
714
|
+
const next_1 = tabRects[index ?? tabRects.length];
|
|
715
|
+
const left_0 = next_1?.left ?? tabRects.at(-1)?.right ?? measurement.left + rect_3.x * measurement.scaleX;
|
|
716
|
+
const relative = Math.max(0, Math.min(rect_3.width - tabWidth, (left_0 - measurement.left) / (measurement.scaleX || 1) - rect_3.x));
|
|
717
|
+
return {
|
|
718
|
+
target: target_1,
|
|
719
|
+
shape: tabDropPreview({
|
|
720
|
+
gap: index ?? rect_3.pane.views.length,
|
|
721
|
+
left: relative,
|
|
722
|
+
tabWidth,
|
|
723
|
+
width: rect_3.width,
|
|
724
|
+
height: rect_3.height,
|
|
725
|
+
barHeight: header_1
|
|
726
|
+
}, {
|
|
727
|
+
x: rect_3.x,
|
|
728
|
+
y: rect_3.y
|
|
729
|
+
})
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
const focusDirection = key_0 => {
|
|
733
|
+
const source = visible.get(value.focused);
|
|
734
|
+
if (!source) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
const horizontal_0 = key_0 === "ArrowLeft" || key_0 === "ArrowRight";
|
|
738
|
+
const positive = key_0 === "ArrowRight" || key_0 === "ArrowDown";
|
|
739
|
+
const center = rect_4 => horizontal_0 ? rect_4.x + rect_4.width / 2 : rect_4.y + rect_4.height / 2;
|
|
740
|
+
const cross = rect_5 => horizontal_0 ? rect_5.y + rect_5.height / 2 : rect_5.x + rect_5.width / 2;
|
|
741
|
+
const options = geometry.panes.filter(rect_6 => rect_6 !== source && (positive ? center(rect_6) > center(source) : center(rect_6) < center(source)));
|
|
742
|
+
options.sort((left_1, right_0) => Math.abs(center(left_1) - center(source)) + 2 * Math.abs(cross(left_1) - cross(source)) - (Math.abs(center(right_0) - center(source)) + 2 * Math.abs(cross(right_0) - cross(source))));
|
|
743
|
+
const next_2 = options[0];
|
|
744
|
+
if (next_2) {
|
|
745
|
+
dispatch({
|
|
746
|
+
type: "focus",
|
|
747
|
+
paneId: next_2.pane.id
|
|
748
|
+
});
|
|
749
|
+
const element_3 = paneElement(root.current, "splitPane", next_2.pane.id);
|
|
750
|
+
element_3?.querySelector("[role=\"tab\"][aria-selected=\"true\"]")?.focus();
|
|
751
|
+
if (!showTabs) {
|
|
752
|
+
element_3?.focus();
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
const t22 = ref ?? null;
|
|
757
|
+
let t23;
|
|
758
|
+
if ($[31] !== t22) {
|
|
759
|
+
t23 = [root, t22];
|
|
760
|
+
$[31] = t22;
|
|
761
|
+
$[32] = t23;
|
|
762
|
+
} else {
|
|
763
|
+
t23 = $[32];
|
|
764
|
+
}
|
|
765
|
+
const t24 = "div";
|
|
766
|
+
let t25;
|
|
767
|
+
if ($[33] !== className) {
|
|
768
|
+
t25 = clsx("ade-split-view", className);
|
|
769
|
+
$[33] = className;
|
|
770
|
+
$[34] = t25;
|
|
771
|
+
} else {
|
|
772
|
+
t25 = $[34];
|
|
773
|
+
}
|
|
774
|
+
const t26 = dragging || undefined;
|
|
775
|
+
const t27 = event_1 => {
|
|
776
|
+
props.onFocusCapture?.(event_1);
|
|
777
|
+
lastFocus.current = event_1.target;
|
|
778
|
+
};
|
|
779
|
+
const t28 = event_2 => {
|
|
780
|
+
props.onKeyDown?.(event_2);
|
|
781
|
+
const target_2 = event_2.target;
|
|
782
|
+
const navigation = target_2 === event_2.currentTarget || target_2.matches(".ade-split-pane, .ade-split-content") || !!target_2.closest(".ade-split-header");
|
|
783
|
+
if (!event_2.defaultPrevented && navigation && event_2.altKey && ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(event_2.key)) {
|
|
784
|
+
event_2.preventDefault();
|
|
785
|
+
focusDirection(event_2.key);
|
|
786
|
+
}
|
|
787
|
+
if (event_2.key === "Escape") {
|
|
788
|
+
stopDrag();
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
const t29 = event_3 => {
|
|
792
|
+
props.onDragOver?.(event_3);
|
|
793
|
+
if (event_3.defaultPrevented) {
|
|
794
|
+
showPreview(null);
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
const drop = locateDrop(event_3);
|
|
798
|
+
showPreview(drop?.shape ?? null);
|
|
799
|
+
if (drop) {
|
|
800
|
+
event_3.preventDefault();
|
|
801
|
+
event_3.dataTransfer.dropEffect = drag.current ? "move" : "copy";
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
const t30 = event_4 => {
|
|
805
|
+
props.onDragLeave?.(event_4);
|
|
806
|
+
if (!(event_4.relatedTarget instanceof Node) || !event_4.currentTarget.contains(event_4.relatedTarget)) {
|
|
807
|
+
showPreview(null);
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
const t31 = event_5 => {
|
|
811
|
+
props.onDrop?.(event_5);
|
|
812
|
+
if (event_5.defaultPrevented) {
|
|
813
|
+
stopDrag();
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
const drop_0 = locateDrop(event_5);
|
|
817
|
+
if (drop_0) {
|
|
818
|
+
event_5.preventDefault();
|
|
819
|
+
event_5.stopPropagation();
|
|
820
|
+
const command_1 = commandFor(drop_0.target);
|
|
821
|
+
if (command_1) {
|
|
822
|
+
serial.current = serial.current + 1;
|
|
823
|
+
dispatch(command_1);
|
|
824
|
+
} else {
|
|
825
|
+
onExternalDrop?.(drop_0.target, event_5);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
stopDrag();
|
|
829
|
+
};
|
|
830
|
+
const t32 = panes.map(pane_5 => {
|
|
831
|
+
const rect_7 = visible.get(pane_5.id);
|
|
832
|
+
const header_2 = Math.min(barHeight, rect_7?.height ?? 0);
|
|
833
|
+
return /*#__PURE__*/_jsx("section", {
|
|
834
|
+
"data-split-pane": pane_5.id,
|
|
835
|
+
"data-focused": value.focused === pane_5.id || undefined,
|
|
836
|
+
className: "ade-split-pane",
|
|
837
|
+
"aria-label": t("workspace.pane"),
|
|
838
|
+
tabIndex: -1,
|
|
839
|
+
hidden: !rect_7,
|
|
840
|
+
inert: !rect_7,
|
|
841
|
+
style: rect_7 ? {
|
|
842
|
+
left: rect_7.x,
|
|
843
|
+
top: rect_7.y,
|
|
844
|
+
width: rect_7.width,
|
|
845
|
+
height: rect_7.height,
|
|
846
|
+
borderRadius: radius(rect_7)
|
|
847
|
+
} : undefined,
|
|
848
|
+
onFocusCapture: () => dispatch({
|
|
849
|
+
type: "focus",
|
|
850
|
+
paneId: pane_5.id
|
|
851
|
+
}),
|
|
852
|
+
onPointerDown: () => dispatch({
|
|
853
|
+
type: "focus",
|
|
854
|
+
paneId: pane_5.id
|
|
855
|
+
}),
|
|
856
|
+
children: header_2 > 0 && /*#__PURE__*/_jsx("div", {
|
|
857
|
+
className: "ade-split-header",
|
|
858
|
+
"data-split-header": pane_5.id,
|
|
859
|
+
style: {
|
|
860
|
+
height: header_2
|
|
861
|
+
},
|
|
862
|
+
children: renderPaneHeader ? renderPaneHeader(pane_5) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
863
|
+
children: [/*#__PURE__*/_jsx(TabStrip, {
|
|
864
|
+
items: pane_5.views.map(viewId_4 => {
|
|
865
|
+
const metadata = getTab?.(viewId_4);
|
|
866
|
+
return {
|
|
867
|
+
...metadata,
|
|
868
|
+
id: viewId_4,
|
|
869
|
+
label: metadata?.label ?? viewId_4,
|
|
870
|
+
tabId: id("tab", viewId_4),
|
|
871
|
+
panelId: id("view", viewId_4)
|
|
872
|
+
};
|
|
873
|
+
}),
|
|
874
|
+
value: pane_5.active,
|
|
875
|
+
focused: value.focused === pane_5.id,
|
|
876
|
+
onValueChange: viewId_5 => dispatch({
|
|
877
|
+
type: "activate",
|
|
878
|
+
paneId: pane_5.id,
|
|
879
|
+
viewId: viewId_5
|
|
880
|
+
}),
|
|
881
|
+
onClose: onClose ?? (viewId_6 => dispatch({
|
|
882
|
+
type: "close",
|
|
883
|
+
viewId: viewId_6
|
|
884
|
+
})),
|
|
885
|
+
onDoubleClick: onTabDoubleClick,
|
|
886
|
+
onContextMenu: onTabContextMenu,
|
|
887
|
+
onDragStart: (viewId_7, event_6) => startDrag(pane_5, event_6, viewId_7),
|
|
888
|
+
onDragEnd: stopDrag
|
|
889
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
890
|
+
icon: GripVertical,
|
|
891
|
+
size: "sm",
|
|
892
|
+
label: t("workspace.movePane"),
|
|
893
|
+
draggable: true,
|
|
894
|
+
onDragStart: event_7 => startDrag(pane_5, event_7),
|
|
895
|
+
onDragEnd: stopDrag
|
|
896
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
897
|
+
icon: value.maximized === pane_5.id ? Minimize2 : Maximize2,
|
|
898
|
+
size: "sm",
|
|
899
|
+
label: t(value.maximized === pane_5.id ? "workspace.restore" : "workspace.maximize"),
|
|
900
|
+
onClick: () => dispatch({
|
|
901
|
+
type: "maximize",
|
|
902
|
+
paneId: value.maximized === pane_5.id ? null : pane_5.id
|
|
903
|
+
})
|
|
904
|
+
})]
|
|
905
|
+
})
|
|
906
|
+
})
|
|
907
|
+
}, pane_5.id);
|
|
908
|
+
});
|
|
909
|
+
const t34 = views.map(t33 => {
|
|
910
|
+
const {
|
|
911
|
+
pane: pane_6,
|
|
912
|
+
viewId: viewId_8
|
|
913
|
+
} = t33;
|
|
914
|
+
const rect_8 = visible.get(pane_6.id);
|
|
915
|
+
const active_0 = !!rect_8 && pane_6.active === viewId_8;
|
|
916
|
+
const header_3 = Math.min(barHeight, rect_8?.height ?? 0);
|
|
917
|
+
const position = rect_8 ? {
|
|
918
|
+
left: rect_8.x,
|
|
919
|
+
top: rect_8.y + header_3,
|
|
920
|
+
width: rect_8.width,
|
|
921
|
+
height: Math.max(0, rect_8.height - header_3),
|
|
922
|
+
borderRadius: bodyRadius(rect_8, header_3)
|
|
923
|
+
} : {};
|
|
924
|
+
return /*#__PURE__*/_jsx("div", {
|
|
925
|
+
id: id("view", viewId_8),
|
|
926
|
+
role: "tabpanel",
|
|
927
|
+
"aria-labelledby": showTabs && !renderPaneHeader ? id("tab", viewId_8) : undefined,
|
|
928
|
+
"aria-label": !showTabs || renderPaneHeader ? getTab?.(viewId_8).label ?? viewId_8 : undefined,
|
|
929
|
+
className: "ade-split-content",
|
|
930
|
+
"data-split-view-id": viewId_8,
|
|
931
|
+
hidden: !active_0,
|
|
932
|
+
inert: !active_0,
|
|
933
|
+
tabIndex: 0,
|
|
934
|
+
style: position,
|
|
935
|
+
onFocusCapture: () => dispatch({
|
|
936
|
+
type: "focus",
|
|
937
|
+
paneId: pane_6.id
|
|
938
|
+
}),
|
|
939
|
+
onPointerDown: () => dispatch({
|
|
940
|
+
type: "focus",
|
|
941
|
+
paneId: pane_6.id
|
|
942
|
+
}),
|
|
943
|
+
children: renderView(viewId_8, {
|
|
944
|
+
paneId: pane_6.id,
|
|
945
|
+
active: active_0
|
|
946
|
+
})
|
|
947
|
+
}, viewId_8);
|
|
948
|
+
});
|
|
949
|
+
const t35 = geometry.dividers.map(divider => /*#__PURE__*/_jsx(Divider, {
|
|
950
|
+
divider: divider,
|
|
951
|
+
minimumResizeShare: minimumResizeShare,
|
|
952
|
+
onResize: sizes => dispatch({
|
|
953
|
+
type: "resize",
|
|
954
|
+
splitId: divider.splitId,
|
|
955
|
+
sizes
|
|
956
|
+
}),
|
|
957
|
+
onEqualize: all => dispatch(all ? {
|
|
958
|
+
type: "equalizeAxis",
|
|
959
|
+
axis: divider.axis,
|
|
960
|
+
length: divider.axis === "horizontal" ? measurement.width : measurement.height,
|
|
961
|
+
gap
|
|
962
|
+
} : {
|
|
963
|
+
type: "equalize",
|
|
964
|
+
splitId: divider.splitId,
|
|
965
|
+
index: divider.index
|
|
966
|
+
})
|
|
967
|
+
}, `${divider.splitId}:${divider.index}`));
|
|
968
|
+
let t36;
|
|
969
|
+
if ($[35] !== preview) {
|
|
970
|
+
t36 = /*#__PURE__*/_jsx(DropPreview, {
|
|
971
|
+
shape: preview
|
|
972
|
+
});
|
|
973
|
+
$[35] = preview;
|
|
974
|
+
$[36] = t36;
|
|
975
|
+
} else {
|
|
976
|
+
t36 = $[36];
|
|
977
|
+
}
|
|
978
|
+
let t37;
|
|
979
|
+
if ($[37] !== t32 || $[38] !== t34 || $[39] !== t35 || $[40] !== t36) {
|
|
980
|
+
t37 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
981
|
+
children: [t32, t34, t35, t36]
|
|
467
982
|
});
|
|
983
|
+
$[37] = t32;
|
|
984
|
+
$[38] = t34;
|
|
985
|
+
$[39] = t35;
|
|
986
|
+
$[40] = t36;
|
|
987
|
+
$[41] = t37;
|
|
988
|
+
} else {
|
|
989
|
+
t37 = $[41];
|
|
990
|
+
}
|
|
991
|
+
let t38;
|
|
992
|
+
if ($[42] !== layout || $[43] !== props || $[44] !== style || $[45] !== t25 || $[46] !== t26 || $[47] !== t27 || $[48] !== t28 || $[49] !== t29 || $[50] !== t30 || $[51] !== t31 || $[52] !== t37) {
|
|
993
|
+
t38 = {
|
|
994
|
+
...props,
|
|
995
|
+
className: t25,
|
|
996
|
+
style,
|
|
997
|
+
"data-layout": layout,
|
|
998
|
+
"data-dragging": t26,
|
|
999
|
+
onFocusCapture: t27,
|
|
1000
|
+
onKeyDown: t28,
|
|
1001
|
+
onDragOver: t29,
|
|
1002
|
+
onDragLeave: t30,
|
|
1003
|
+
onDrop: t31,
|
|
1004
|
+
children: t37
|
|
1005
|
+
};
|
|
1006
|
+
$[42] = layout;
|
|
1007
|
+
$[43] = props;
|
|
1008
|
+
$[44] = style;
|
|
1009
|
+
$[45] = t25;
|
|
1010
|
+
$[46] = t26;
|
|
1011
|
+
$[47] = t27;
|
|
1012
|
+
$[48] = t28;
|
|
1013
|
+
$[49] = t29;
|
|
1014
|
+
$[50] = t30;
|
|
1015
|
+
$[51] = t31;
|
|
1016
|
+
$[52] = t37;
|
|
1017
|
+
$[53] = t38;
|
|
1018
|
+
} else {
|
|
1019
|
+
t38 = $[53];
|
|
1020
|
+
}
|
|
1021
|
+
let t39;
|
|
1022
|
+
if ($[54] !== render || $[55] !== t23 || $[56] !== t38) {
|
|
1023
|
+
t39 = {
|
|
1024
|
+
render,
|
|
1025
|
+
ref: t23,
|
|
1026
|
+
defaultTagName: t24,
|
|
1027
|
+
props: t38
|
|
1028
|
+
};
|
|
1029
|
+
$[54] = render;
|
|
1030
|
+
$[55] = t23;
|
|
1031
|
+
$[56] = t38;
|
|
1032
|
+
$[57] = t39;
|
|
1033
|
+
} else {
|
|
1034
|
+
t39 = $[57];
|
|
1035
|
+
}
|
|
1036
|
+
return useRender(t39);
|
|
1037
|
+
}
|
|
1038
|
+
function _temp7(element_2) {
|
|
1039
|
+
return element_2.getBoundingClientRect();
|
|
1040
|
+
}
|
|
1041
|
+
function _temp6(pane_2) {
|
|
1042
|
+
return [pane_2.pane.id, pane_2];
|
|
1043
|
+
}
|
|
1044
|
+
function _temp5(left, right) {
|
|
1045
|
+
return left.viewId < right.viewId ? -1 : left.viewId > right.viewId ? 1 : 0;
|
|
468
1046
|
}
|
|
1047
|
+
function _temp4(pane_1) {
|
|
1048
|
+
return pane_1.views.map(viewId => ({
|
|
1049
|
+
pane: pane_1,
|
|
1050
|
+
viewId
|
|
1051
|
+
}));
|
|
1052
|
+
}
|