|
262 | 262 |
|
263 | 263 | <div class="top" class:offset={show_editor}>
|
264 | 264 | <SplitPane id="main" type="horizontal" min="360px" max="50%" pos="33%">
|
265 |
| - <section slot="a" class="content"> |
266 |
| - <Sidebar |
267 |
| - bind:sidebar |
268 |
| - exercise={data.exercise} |
269 |
| - on:select={(e) => { |
270 |
| - navigate_to_file(e.detail.file); |
271 |
| - }} |
272 |
| - /> |
273 |
| - </section> |
274 |
| - |
275 |
| - <section slot="b"> |
| 265 | + {#snippet a()} |
| 266 | + <section class="content"> |
| 267 | + <Sidebar |
| 268 | + bind:sidebar |
| 269 | + exercise={data.exercise} |
| 270 | + on:select={(e) => { |
| 271 | + navigate_to_file(e.detail.file); |
| 272 | + }} |
| 273 | + /> |
| 274 | + </section> |
| 275 | + {/snippet} |
| 276 | + |
| 277 | + {#snippet b()} |
276 | 278 | <SplitPane type="vertical" min="100px" max="-4.1rem" pos="50%">
|
277 |
| - <section slot="a"> |
| 279 | + {#snippet a()} |
278 | 280 | <SplitPane
|
279 | 281 | id="editor"
|
280 | 282 | type={mobile ? 'vertical' : 'horizontal'}
|
281 | 283 | min="120px"
|
282 | 284 | max="300px"
|
283 | 285 | pos="200px"
|
284 | 286 | >
|
285 |
| - <section slot="a" class="navigator"> |
286 |
| - {#if mobile} |
287 |
| - <button class="file" onclick={() => (show_filetree = !show_filetree)}> |
288 |
| - {workspace.current.name.replace( |
289 |
| - data.exercise.scope.prefix, |
290 |
| - data.exercise.scope.name + '/' |
291 |
| - ) ?? 'Files'} |
292 |
| - </button> |
293 |
| - {:else} |
294 |
| - <Filetree exercise={data.exercise} {workspace} /> |
295 |
| - {/if} |
296 |
| - </section> |
297 |
| - |
298 |
| - <section slot="b" class="editor-container"> |
299 |
| - <Editor |
300 |
| - {workspace} |
301 |
| - autocomplete_filter={(file) => { |
302 |
| - return ( |
303 |
| - file.name.startsWith('/src') && |
304 |
| - file.name.startsWith(data.exercise.scope.prefix) && |
305 |
| - file.name !== '/src/__client.js' && |
306 |
| - file.name !== '/src/app.html' |
307 |
| - ); |
308 |
| - }} |
309 |
| - /> |
310 |
| - <ImageViewer selected={workspace.current} /> |
311 |
| - |
312 |
| - {#if mobile && show_filetree} |
313 |
| - <div class="mobile-filetree"> |
314 |
| - <Filetree mobile exercise={data.exercise} {workspace} /> |
315 |
| - </div> |
316 |
| - {/if} |
317 |
| - </section> |
| 287 | + {#snippet a()} |
| 288 | + <section class="navigator"> |
| 289 | + {#if mobile} |
| 290 | + <button class="file" onclick={() => (show_filetree = !show_filetree)}> |
| 291 | + {workspace.current.name.replace( |
| 292 | + data.exercise.scope.prefix, |
| 293 | + data.exercise.scope.name + '/' |
| 294 | + ) ?? 'Files'} |
| 295 | + </button> |
| 296 | + {:else} |
| 297 | + <Filetree exercise={data.exercise} {workspace} /> |
| 298 | + {/if} |
| 299 | + </section> |
| 300 | + {/snippet} |
| 301 | + |
| 302 | + {#snippet b()} |
| 303 | + <section class="editor-container"> |
| 304 | + <Editor |
| 305 | + {workspace} |
| 306 | + autocomplete_filter={(file) => { |
| 307 | + return ( |
| 308 | + file.name.startsWith('/src') && |
| 309 | + file.name.startsWith(data.exercise.scope.prefix) && |
| 310 | + file.name !== '/src/__client.js' && |
| 311 | + file.name !== '/src/app.html' |
| 312 | + ); |
| 313 | + }} |
| 314 | + /> |
| 315 | + <ImageViewer selected={workspace.current} /> |
| 316 | + |
| 317 | + {#if mobile && show_filetree} |
| 318 | + <div class="mobile-filetree"> |
| 319 | + <Filetree mobile exercise={data.exercise} {workspace} /> |
| 320 | + </div> |
| 321 | + {/if} |
| 322 | + </section> |
| 323 | + {/snippet} |
318 | 324 | </SplitPane>
|
319 |
| - </section> |
320 |
| - |
321 |
| - <section slot="b" class="preview"> |
322 |
| - {#if needs_webcontainers(page.data.exercise)} |
323 |
| - <Output exercise={data.exercise} {paused} {workspace} /> |
324 |
| - {:else} |
325 |
| - <OutputRollup /> |
326 |
| - {/if} |
327 |
| - </section> |
| 325 | + {/snippet} |
| 326 | + |
| 327 | + {#snippet b()} |
| 328 | + <section class="preview"> |
| 329 | + {#if needs_webcontainers(page.data.exercise)} |
| 330 | + <Output exercise={data.exercise} {paused} {workspace} /> |
| 331 | + {:else} |
| 332 | + <OutputRollup /> |
| 333 | + {/if} |
| 334 | + </section> |
| 335 | + {/snippet} |
328 | 336 | </SplitPane>
|
329 |
| - </section> |
| 337 | + {/snippet} |
330 | 338 | </SplitPane>
|
331 | 339 | </div>
|
332 | 340 |
|
|
446 | 454 | --pos: 5.4rem !important;
|
447 | 455 | }
|
448 | 456 |
|
449 |
| - :global([data-pane]) :global(.divider) { |
| 457 | + :global([data-pane]) :global(svelte-split-pane-divider) { |
450 | 458 | cursor: default;
|
451 | 459 | }
|
452 | 460 | }
|
|
0 commit comments