regular-layout 0.1.0 → 0.2.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/LICENSE.md +1 -1
- package/README.md +6 -6
- package/dist/extensions.d.ts +5 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -10
- package/dist/index.js.map +4 -4
- package/dist/{common → layout}/calculate_edge.d.ts +2 -2
- package/dist/{common → layout}/calculate_intersect.d.ts +7 -9
- package/dist/{common → layout}/constants.d.ts +15 -1
- package/dist/{common → layout}/flatten.d.ts +1 -1
- package/dist/{common → layout}/generate_grid.d.ts +3 -3
- package/dist/layout/generate_overlay.d.ts +2 -0
- package/dist/{common → layout}/insert_child.d.ts +3 -2
- package/dist/{common → layout}/redistribute_panel_sizes.d.ts +1 -1
- package/dist/{common → layout}/remove_child.d.ts +1 -1
- package/dist/{common/layout_config.d.ts → layout/types.d.ts} +6 -10
- package/dist/regular-layout-frame.d.ts +1 -4
- package/dist/regular-layout-tab.d.ts +26 -0
- package/dist/regular-layout.d.ts +23 -18
- package/package.json +9 -7
- package/src/extensions.ts +10 -4
- package/src/index.ts +3 -7
- package/src/layout/calculate_edge.ts +209 -0
- package/src/{common → layout}/calculate_intersect.ts +59 -101
- package/src/{common → layout}/constants.ts +18 -1
- package/src/{common → layout}/flatten.ts +1 -1
- package/src/{common → layout}/generate_grid.ts +76 -106
- package/src/{common → layout}/generate_overlay.ts +24 -12
- package/src/{common → layout}/insert_child.ts +105 -51
- package/src/{common → layout}/redistribute_panel_sizes.ts +1 -1
- package/src/{common → layout}/remove_child.ts +2 -2
- package/src/{common/layout_config.ts → layout/types.ts} +6 -19
- package/src/regular-layout-frame.ts +34 -71
- package/src/regular-layout-tab.ts +103 -0
- package/src/regular-layout.ts +190 -141
- package/themes/chicago.css +89 -0
- package/themes/fluxbox.css +110 -0
- package/themes/gibson.css +264 -0
- package/themes/hotdog.css +88 -0
- package/themes/lorax.css +129 -0
- package/dist/common/generate_overlay.d.ts +0 -2
- package/src/common/calculate_edge.ts +0 -104
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
2
|
+
* ░░░░░░░░▄▀░█▀▄░█▀▀░█▀▀░█░█░█░░░█▀█░█▀▄░░░░░█░░░█▀█░█░█░█▀█░█░█░▀█▀░▀▄░░░░░░░░
|
|
3
|
+
* ░░░░░░░▀▄░░█▀▄░█▀▀░█░█░█░█░█░░░█▀█░█▀▄░▀▀▀░█░░░█▀█░░█░░█░█░█░█░░█░░░▄▀░░░░░░░
|
|
4
|
+
* ░░░░░░░░░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░░░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀▀░░▀░░▀░░░░░░░░░
|
|
5
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
6
|
+
* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
7
|
+
* ┃ * Copyright (c) 2026, the Regular Layout Authors. This file is part * ┃
|
|
8
|
+
* ┃ * of the Regular Layout library, distributed under the terms of the * ┃
|
|
9
|
+
* ┃ * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). * ┃
|
|
10
|
+
* ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
regular-layout.gibson {
|
|
14
|
+
background: radial-gradient(ellipse at center, #0a0a1a 0%, #000000 100%);
|
|
15
|
+
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
|
|
16
|
+
padding: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Frame */
|
|
20
|
+
regular-layout.gibson regular-layout-frame {
|
|
21
|
+
--titlebar-height: 28px;
|
|
22
|
+
position: relative;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
margin: 8px;
|
|
25
|
+
background: rgba(10, 10, 26, 0.85);
|
|
26
|
+
backdrop-filter: blur(4px);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
regular-layout.gibson regular-layout-frame::part(active-close) {
|
|
30
|
+
border: 1px solid #ff00ff;
|
|
31
|
+
height: 18px;
|
|
32
|
+
width: 18px;
|
|
33
|
+
background: rgba(255, 0, 255, 0.1);
|
|
34
|
+
align-self: center;
|
|
35
|
+
/* biome-ignore lint/complexity/noImportantStyles: reasons */
|
|
36
|
+
display: flex !important;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
margin-right: 1px;
|
|
40
|
+
box-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
|
|
41
|
+
transition: all 0.1s ease;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
regular-layout.gibson regular-layout-frame::part(active-close):hover {
|
|
45
|
+
background: rgba(255, 0, 255, 0.3);
|
|
46
|
+
box-shadow: 0 0 12px rgba(255, 0, 255, 0.8);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
regular-layout.gibson regular-layout-frame::part(active-close):before {
|
|
50
|
+
content: "×";
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
color: #ff00ff;
|
|
54
|
+
text-shadow: 0 0 4px rgba(255, 0, 255, 0.8);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
regular-layout.gibson regular-layout-frame::part(close) {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
regular-layout.gibson regular-layout-frame::part(titlebar) {
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
align-items: stretch;
|
|
66
|
+
padding-left: 12px;
|
|
67
|
+
height: 32px;
|
|
68
|
+
|
|
69
|
+
/* border-bottom: 1px solid rgba(0, 255, 255, 0.3); */
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
regular-layout.gibson regular-layout-frame::part(tab) {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex: 1 1 150px;
|
|
75
|
+
max-width: 200px;
|
|
76
|
+
align-items: center;
|
|
77
|
+
padding: 0 5px 0 12px;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
background: rgba(255, 0, 255, 0.1);
|
|
81
|
+
color: #00ffff;
|
|
82
|
+
font-size: 11px;
|
|
83
|
+
font-weight: 500;
|
|
84
|
+
letter-spacing: 0.5px;
|
|
85
|
+
text-transform: uppercase;
|
|
86
|
+
/* border-right: 1px solid rgba(0, 255, 255, 0.2); */
|
|
87
|
+
opacity: 0.6;
|
|
88
|
+
transition: all 0.2s ease;
|
|
89
|
+
text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
regular-layout.gibson regular-layout-frame::part(tab):hover {
|
|
93
|
+
box-shadow: inset 0 0 12px rgba(0, 255, 255, 0.9);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
regular-layout.gibson regular-layout-frame::part(active-tab) {
|
|
97
|
+
background: rgba(0, 255, 255, 0.15);
|
|
98
|
+
opacity: 1;
|
|
99
|
+
border: 2px solid #00ffff;
|
|
100
|
+
border-bottom-width: 1px;
|
|
101
|
+
box-shadow:
|
|
102
|
+
inset 0 0 12px rgba(0, 255, 255, 0.3),
|
|
103
|
+
0 0 8px rgba(0, 255, 255, 0.4);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
regular-layout.gibson:has(.overlay) > * {
|
|
107
|
+
opacity: 0.5;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
regular-layout.gibson:has(.overlay) > .overlay {
|
|
111
|
+
opacity: 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Frame in Overlay Mode */
|
|
115
|
+
regular-layout.gibson regular-layout-frame.overlay {
|
|
116
|
+
background: rgba(255, 0, 255, 0.1);
|
|
117
|
+
border: 1px dashed #ff00ff;
|
|
118
|
+
border-radius: 12px;
|
|
119
|
+
box-shadow:
|
|
120
|
+
0 0 15px rgba(255, 0, 255, 0.6),
|
|
121
|
+
inset 0 0 20px rgba(255, 0, 255, 0.2);
|
|
122
|
+
margin: 0;
|
|
123
|
+
transition:
|
|
124
|
+
top 0.075s ease-out,
|
|
125
|
+
height 0.075s ease-out,
|
|
126
|
+
width 0.075s ease-out,
|
|
127
|
+
left 0.075s ease-out;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
regular-layout.gibson regular-layout-frame::part(container) {
|
|
131
|
+
display: none;
|
|
132
|
+
border: 1px solid #00ffff;
|
|
133
|
+
border-radius: 12px 0 12px 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
regular-layout.gibson regular-layout-frame::part(titlebar) {
|
|
137
|
+
display: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
regular-layout.gibson regular-layout-frame:not(.overlay)::part(container),
|
|
141
|
+
regular-layout.gibson regular-layout-frame:not(.overlay)::part(titlebar) {
|
|
142
|
+
display: flex;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Cyberpunk color variations */
|
|
146
|
+
regular-layout.gibson :nth-child(6n+1)::part(container) {
|
|
147
|
+
border-color: #00ffff;
|
|
148
|
+
box-shadow:
|
|
149
|
+
0 0 10px rgba(0, 255, 255, 0.75),
|
|
150
|
+
inset 0 0 20px rgba(0, 255, 255, 0.1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
regular-layout.gibson :nth-child(6n+1)::part(tab) {
|
|
154
|
+
color: #00ffff;
|
|
155
|
+
text-shadow: 0 0 4px rgba(0, 255, 255, 0.6);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
regular-layout.gibson :nth-child(6n+1)::part(active-tab) {
|
|
159
|
+
background: #00ffff44;
|
|
160
|
+
border-color: #00ffff;
|
|
161
|
+
box-shadow:
|
|
162
|
+
inset 0 0 12px rgba(0, 255, 255, 0.3),
|
|
163
|
+
0 0 8px rgba(0, 255, 255, 0.4);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
regular-layout.gibson :nth-child(6n+2)::part(container) {
|
|
167
|
+
border-color: #ff00ff;
|
|
168
|
+
box-shadow:
|
|
169
|
+
0 0 10px rgba(255, 0, 255, 0.75),
|
|
170
|
+
inset 0 0 20px rgba(255, 0, 255, 0.1);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
regular-layout.gibson :nth-child(6n+2)::part(tab) {
|
|
174
|
+
color: #ff00ff;
|
|
175
|
+
text-shadow: 0 0 4px rgba(255, 0, 255, 0.6);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
regular-layout.gibson :nth-child(6n+2)::part(active-tab) {
|
|
179
|
+
background: #ff00ff44;
|
|
180
|
+
border-color: #ff00ff;
|
|
181
|
+
box-shadow:
|
|
182
|
+
inset 0 0 12px rgba(255, 0, 255, 0.3),
|
|
183
|
+
0 0 8px rgba(255, 0, 255, 0.4);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
regular-layout.gibson :nth-child(6n+3)::part(container) {
|
|
187
|
+
border-color: #00ff00;
|
|
188
|
+
box-shadow:
|
|
189
|
+
0 0 10px rgba(0, 255, 0, 0.75),
|
|
190
|
+
inset 0 0 20px rgba(0, 255, 0, 0.1);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
regular-layout.gibson :nth-child(6n+3)::part(tab) {
|
|
194
|
+
color: #00ff00;
|
|
195
|
+
text-shadow: 0 0 4px rgba(0, 255, 0, 0.6);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
regular-layout.gibson :nth-child(6n+3)::part(active-tab) {
|
|
199
|
+
background: #00ff0044;
|
|
200
|
+
border-color: #00ff00;
|
|
201
|
+
box-shadow:
|
|
202
|
+
inset 0 0 12px rgba(0, 255, 0, 0.3),
|
|
203
|
+
0 0 8px rgba(0, 255, 0, 0.4);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
regular-layout.gibson :nth-child(6n+4)::part(container) {
|
|
207
|
+
border-color: #ff0080;
|
|
208
|
+
box-shadow:
|
|
209
|
+
0 0 10px rgba(255, 0, 128, 0.75),
|
|
210
|
+
inset 0 0 20px rgba(255, 0, 128, 0.1);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
regular-layout.gibson :nth-child(6n+4)::part(tab) {
|
|
214
|
+
color: #ff0080;
|
|
215
|
+
text-shadow: 0 0 4px rgba(255, 0, 128, 0.6);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
regular-layout.gibson :nth-child(6n+4)::part(active-tab) {
|
|
219
|
+
background: #ff008044;
|
|
220
|
+
border-color: #ff0080;
|
|
221
|
+
box-shadow:
|
|
222
|
+
inset 0 0 12px rgba(255, 0, 128, 0.3),
|
|
223
|
+
0 0 8px rgba(255, 0, 128, 0.4);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
regular-layout.gibson :nth-child(6n+5)::part(container) {
|
|
227
|
+
border-color: #8000ff;
|
|
228
|
+
box-shadow:
|
|
229
|
+
0 0 10px rgba(128, 0, 255, 0.75),
|
|
230
|
+
inset 0 0 20px rgba(128, 0, 255, 0.1);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
regular-layout.gibson :nth-child(6n+5)::part(tab) {
|
|
234
|
+
color: #8000ff;
|
|
235
|
+
text-shadow: 0 0 4px rgba(128, 0, 255, 0.6);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
regular-layout.gibson :nth-child(6n+5)::part(active-tab) {
|
|
239
|
+
background: #8000ff44;
|
|
240
|
+
border-color: #8000ff;
|
|
241
|
+
box-shadow:
|
|
242
|
+
inset 0 0 12px rgba(128, 0, 255, 0.3),
|
|
243
|
+
0 0 8px rgba(128, 0, 255, 0.4);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
regular-layout.gibson :nth-child(6n+6)::part(container) {
|
|
247
|
+
border-color: #ffff00;
|
|
248
|
+
box-shadow:
|
|
249
|
+
0 0 10px rgba(255, 255, 0, 0.75),
|
|
250
|
+
inset 0 0 20px rgba(255, 255, 0, 0.1);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
regular-layout.gibson :nth-child(6n+6)::part(tab) {
|
|
254
|
+
color: #ffff00;
|
|
255
|
+
text-shadow: 0 0 4px rgba(255, 255, 0, 0.6);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
regular-layout.gibson :nth-child(6n+6)::part(active-tab) {
|
|
259
|
+
background: #ffff0044;
|
|
260
|
+
border-color: #ffff00;
|
|
261
|
+
box-shadow:
|
|
262
|
+
inset 0 0 12px rgba(255, 255, 0, 0.3),
|
|
263
|
+
0 0 8px rgba(255, 255, 0, 0.4);
|
|
264
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
2
|
+
* ░░░░░░░░▄▀░█▀▄░█▀▀░█▀▀░█░█░█░░░█▀█░█▀▄░░░░░█░░░█▀█░█░█░█▀█░█░█░▀█▀░▀▄░░░░░░░░
|
|
3
|
+
* ░░░░░░░▀▄░░█▀▄░█▀▀░█░█░█░█░█░░░█▀█░█▀▄░▀▀▀░█░░░█▀█░░█░░█░█░█░█░░█░░░▄▀░░░░░░░
|
|
4
|
+
* ░░░░░░░░░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░░░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀▀░░▀░░▀░░░░░░░░░
|
|
5
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
6
|
+
* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
7
|
+
* ┃ * Copyright (c) 2026, the Regular Layout Authors. This file is part * ┃
|
|
8
|
+
* ┃ * of the Regular Layout library, distributed under the terms of the * ┃
|
|
9
|
+
* ┃ * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). * ┃
|
|
10
|
+
* ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
regular-layout.hotdog {
|
|
14
|
+
background-color: #FF0000;
|
|
15
|
+
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
|
|
16
|
+
padding: 24px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Frame */
|
|
20
|
+
regular-layout.hotdog regular-layout-frame {
|
|
21
|
+
margin: 12px;
|
|
22
|
+
background: #FFFF00;
|
|
23
|
+
border-width: 2px;
|
|
24
|
+
border-color: #FF6B6B #8B0000 #8B0000 #FF6B6B;
|
|
25
|
+
border-style: solid;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
regular-layout.hotdog regular-layout-frame::part(close) {
|
|
29
|
+
border-width: 1px;
|
|
30
|
+
border-color: #FF6B6B #8B0000 #8B0000 #FF6B6B;
|
|
31
|
+
border-style: solid;
|
|
32
|
+
height: 16px;
|
|
33
|
+
background: #FF0000;
|
|
34
|
+
align-self: center;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
padding: 0px 4px;
|
|
38
|
+
color: #FFFF00;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
regular-layout.hotdog regular-layout-frame::part(close):before {
|
|
42
|
+
content: "X";
|
|
43
|
+
font-size: 10px;
|
|
44
|
+
font-weight: bold;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
regular-layout.hotdog regular-layout-frame::part(titlebar) {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: stretch;
|
|
50
|
+
padding-right: 0px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
regular-layout.hotdog regular-layout-frame::part(tab) {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex: 1 1 150px;
|
|
56
|
+
align-items: center;
|
|
57
|
+
padding: 0 3px 0 8px;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
background: #CC0000;
|
|
61
|
+
color: #FFFF00;
|
|
62
|
+
font-family: "Tahoma", "Arial", sans-serif;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
font-size: 11px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
regular-layout.hotdog regular-layout-frame::part(active-tab) {
|
|
68
|
+
background: #FF0000;
|
|
69
|
+
opacity: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
regular-layout.hotdog:has(.overlay)>* {
|
|
73
|
+
opacity: 0.8;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
regular-layout.hotdog:has(.overlay)>.overlay {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Frame in Overlay Mode */
|
|
81
|
+
regular-layout.hotdog regular-layout-frame.overlay {
|
|
82
|
+
margin: 0;
|
|
83
|
+
transition:
|
|
84
|
+
top 0.1s ease-in-out,
|
|
85
|
+
height 0.1s ease-in-out,
|
|
86
|
+
width 0.1s ease-in-out,
|
|
87
|
+
left 0.1s ease-in-out;
|
|
88
|
+
}
|
package/themes/lorax.css
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
2
|
+
* ░░░░░░░░▄▀░█▀▄░█▀▀░█▀▀░█░█░█░░░█▀█░█▀▄░░░░░█░░░█▀█░█░█░█▀█░█░█░▀█▀░▀▄░░░░░░░░
|
|
3
|
+
* ░░░░░░░▀▄░░█▀▄░█▀▀░█░█░█░█░█░░░█▀█░█▀▄░▀▀▀░█░░░█▀█░░█░░█░█░█░█░░█░░░▄▀░░░░░░░
|
|
4
|
+
* ░░░░░░░░░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░░░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀▀░░▀░░▀░░░░░░░░░
|
|
5
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
6
|
+
* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
7
|
+
* ┃ * Copyright (c) 2026, the Regular Layout Authors. This file is part * ┃
|
|
8
|
+
* ┃ * of the Regular Layout library, distributed under the terms of the * ┃
|
|
9
|
+
* ┃ * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). * ┃
|
|
10
|
+
* ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
regular-layout.lorax {
|
|
14
|
+
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Frame */
|
|
18
|
+
regular-layout.lorax regular-layout-frame {
|
|
19
|
+
margin: 3px;
|
|
20
|
+
margin-top: 27px;
|
|
21
|
+
border-radius: 0 0 6px 6px;
|
|
22
|
+
border: 1px solid #666;
|
|
23
|
+
box-shadow: 0px 6px 6px -4px rgba(150, 150, 180);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
regular-layout.lorax regular-layout-frame::part(titlebar) {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: stretch;
|
|
29
|
+
margin-left: -1px;
|
|
30
|
+
margin-right: -1px;
|
|
31
|
+
margin-bottom: 0px;
|
|
32
|
+
margin-top: -24px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
regular-layout.lorax regular-layout-frame::part(tab) {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex: 1 1 150px;
|
|
38
|
+
align-items: center;
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: 10px;
|
|
41
|
+
padding: 0 6px;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
max-width: 150px;
|
|
44
|
+
text-overflow: ellipsis;
|
|
45
|
+
border: 1px solid #666;
|
|
46
|
+
border-radius: 6px 6px 0 0;
|
|
47
|
+
opacity: 0.5;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
regular-layout.lorax regular-layout-frame::part(active-tab) {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
regular-layout.lorax regular-layout-frame::part(close) {
|
|
55
|
+
border-radius: 7px;
|
|
56
|
+
border: 1px solid #666;
|
|
57
|
+
background: transparent;
|
|
58
|
+
height: 14px;
|
|
59
|
+
align-self: center
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
regular-layout.lorax regular-layout-frame::part(close):hover {
|
|
64
|
+
transition: background-color 0.2s;
|
|
65
|
+
background-color: rgba(255,0,0,0.2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Frame in Overlay Mode */
|
|
69
|
+
regular-layout.lorax regular-layout-frame.overlay {
|
|
70
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
71
|
+
border: 1px dashed rgb(0, 0, 0);
|
|
72
|
+
border-radius: 6px;
|
|
73
|
+
margin: 0;
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
transition:
|
|
76
|
+
top 0.1s ease-in-out,
|
|
77
|
+
height 0.1s ease-in-out,
|
|
78
|
+
width 0.1s ease-in-out,
|
|
79
|
+
left 0.1s ease-in-out;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
regular-layout.lorax regular-layout-frame::part(container), regular-layout.lorax regular-layout-frame::part(titlebar) {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
regular-layout.lorax regular-layout-frame:not(.overlay)::part(container), regular-layout.lorax regular-layout-frame:not(.overlay)::part(titlebar) {
|
|
87
|
+
display: flex;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Colors */
|
|
91
|
+
regular-layout.lorax :nth-child(8n+1),
|
|
92
|
+
regular-layout.lorax :nth-child(8n+1)::part(tab) {
|
|
93
|
+
background-color: #ffadadff;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
regular-layout.lorax :nth-child(8n+2),
|
|
97
|
+
regular-layout.lorax :nth-child(8n+2)::part(tab) {
|
|
98
|
+
background-color: #ffd6a5ff;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
regular-layout.lorax :nth-child(8n+3),
|
|
102
|
+
regular-layout.lorax :nth-child(8n+3)::part(tab) {
|
|
103
|
+
background-color: #fdffb6ff;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
regular-layout.lorax :nth-child(8n+4),
|
|
107
|
+
regular-layout.lorax :nth-child(8n+4)::part(tab) {
|
|
108
|
+
background-color: #caffbfff;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
regular-layout.lorax :nth-child(8n+5),
|
|
112
|
+
regular-layout.lorax :nth-child(8n+5)::part(tab) {
|
|
113
|
+
background-color: #9bf6ffff;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
regular-layout.lorax :nth-child(8n+6),
|
|
117
|
+
regular-layout.lorax :nth-child(8n+6)::part(tab) {
|
|
118
|
+
background-color: #a0c4ffff;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
regular-layout.lorax :nth-child(8n+7),
|
|
122
|
+
regular-layout.lorax :nth-child(8n+7)::part(tab) {
|
|
123
|
+
background-color: #bdb2ffff;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
regular-layout.lorax :nth-child(8n+8),
|
|
127
|
+
regular-layout.lorax :nth-child(8n+8)::part(tab) {
|
|
128
|
+
background-color: #ffc6ffff;
|
|
129
|
+
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
2
|
-
// ░░░░░░░░▄▀░█▀▄░█▀▀░█▀▀░█░█░█░░░█▀█░█▀▄░░░░░█░░░█▀█░█░█░█▀█░█░█░▀█▀░▀▄░░░░░░░░
|
|
3
|
-
// ░░░░░░░▀▄░░█▀▄░█▀▀░█░█░█░█░█░░░█▀█░█▀▄░▀▀▀░█░░░█▀█░░█░░█░█░█░█░░█░░░▄▀░░░░░░░
|
|
4
|
-
// ░░░░░░░░░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░░░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀▀░░▀░░▀░░░░░░░░░
|
|
5
|
-
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
6
|
-
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
7
|
-
// ┃ * Copyright (c) 2026, the Regular Layout Authors. This file is part * ┃
|
|
8
|
-
// ┃ * of the Regular Layout library, distributed under the terms of the * ┃
|
|
9
|
-
// ┃ * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). * ┃
|
|
10
|
-
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
11
|
-
|
|
12
|
-
import { calculate_intersection } from "./calculate_intersect";
|
|
13
|
-
import { SPLIT_EDGE_TOLERANCE } from "./constants";
|
|
14
|
-
import { insert_child } from "./insert_child";
|
|
15
|
-
import type { Layout, LayoutPath, Orientation } from "./layout_config";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Calculates an insertion point (which may involve splitting a single
|
|
19
|
-
* `"child-panel"` into a new `"split-panel"`), based on the cursor position.
|
|
20
|
-
* *
|
|
21
|
-
* @param col - The cursor column.
|
|
22
|
-
* @param row - The cursor row.
|
|
23
|
-
* @param panel - The `Layout` to insert into.
|
|
24
|
-
* @param slot - The slot identifier where the insert should occur
|
|
25
|
-
* @param drop_target - The `LayoutPath` (from `calculateIntersect`) of the
|
|
26
|
-
* panel to either insert next to, or split by.
|
|
27
|
-
* @returns A new `LayoutPath` reflecting the updated (maybe) `"split-panel"`,
|
|
28
|
-
* which is enough to draw the overlay.
|
|
29
|
-
*/
|
|
30
|
-
export function calculate_edge(
|
|
31
|
-
col: number,
|
|
32
|
-
row: number,
|
|
33
|
-
panel: Layout,
|
|
34
|
-
slot: string,
|
|
35
|
-
drop_target: LayoutPath,
|
|
36
|
-
): LayoutPath {
|
|
37
|
-
const is_column_edge =
|
|
38
|
-
drop_target.column_offset < SPLIT_EDGE_TOLERANCE ||
|
|
39
|
-
drop_target.column_offset > 1 - SPLIT_EDGE_TOLERANCE;
|
|
40
|
-
|
|
41
|
-
const is_row_edge =
|
|
42
|
-
drop_target.row_offset < SPLIT_EDGE_TOLERANCE ||
|
|
43
|
-
drop_target.row_offset > 1 - SPLIT_EDGE_TOLERANCE;
|
|
44
|
-
|
|
45
|
-
if (is_column_edge) {
|
|
46
|
-
return handle_axis(
|
|
47
|
-
col,
|
|
48
|
-
row,
|
|
49
|
-
panel,
|
|
50
|
-
slot,
|
|
51
|
-
drop_target,
|
|
52
|
-
drop_target.column_offset,
|
|
53
|
-
"horizontal",
|
|
54
|
-
);
|
|
55
|
-
} else if (is_row_edge) {
|
|
56
|
-
return handle_axis(
|
|
57
|
-
col,
|
|
58
|
-
row,
|
|
59
|
-
panel,
|
|
60
|
-
slot,
|
|
61
|
-
drop_target,
|
|
62
|
-
drop_target.row_offset,
|
|
63
|
-
"vertical",
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return drop_target;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function handle_axis(
|
|
71
|
-
col: number,
|
|
72
|
-
row: number,
|
|
73
|
-
panel: Layout,
|
|
74
|
-
slot: string,
|
|
75
|
-
drop_target: LayoutPath,
|
|
76
|
-
axis_offset: number,
|
|
77
|
-
axis_orientation: Orientation,
|
|
78
|
-
): LayoutPath {
|
|
79
|
-
const is_before = axis_offset < SPLIT_EDGE_TOLERANCE;
|
|
80
|
-
if (drop_target.orientation === axis_orientation) {
|
|
81
|
-
if (drop_target.path.length === 0) {
|
|
82
|
-
const insert_index = is_before ? 0 : 1;
|
|
83
|
-
const new_panel = insert_child(panel, slot, [insert_index]);
|
|
84
|
-
drop_target = calculate_intersection(col, row, new_panel, false);
|
|
85
|
-
} else {
|
|
86
|
-
const path_without_last = drop_target.path.slice(0, -1);
|
|
87
|
-
const last_index = drop_target.path[drop_target.path.length - 1];
|
|
88
|
-
const insert_index = is_before ? last_index : last_index + 1;
|
|
89
|
-
const new_panel = insert_child(panel, slot, [
|
|
90
|
-
...path_without_last,
|
|
91
|
-
insert_index,
|
|
92
|
-
]);
|
|
93
|
-
|
|
94
|
-
drop_target = calculate_intersection(col, row, new_panel, false);
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
const path = [...drop_target.path, is_before ? 0 : 1];
|
|
98
|
-
const new_panel = insert_child(panel, slot, path, axis_orientation);
|
|
99
|
-
drop_target = calculate_intersection(col, row, new_panel, false);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
drop_target.is_edge = true;
|
|
103
|
-
return drop_target;
|
|
104
|
-
}
|