@qodalis/vue-cli 2.0.0-beta.10 → 2.0.0-beta.11
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/index.d.mts +79 -3
- package/dist/index.d.ts +79 -3
- package/dist/index.js +248 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +248 -100
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -275,38 +275,97 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
275
275
|
type: Function,
|
|
276
276
|
default: void 0
|
|
277
277
|
},
|
|
278
|
+
collapsed: { type: Boolean, default: void 0 },
|
|
279
|
+
hidden: { type: Boolean, default: void 0 },
|
|
280
|
+
maximized: { type: Boolean, default: void 0 },
|
|
281
|
+
activeTabId: { type: Number, default: void 0 },
|
|
282
|
+
position: { type: String, default: void 0 },
|
|
283
|
+
height: { type: Number, default: void 0 },
|
|
284
|
+
width: { type: Number, default: void 0 },
|
|
278
285
|
style: {
|
|
279
286
|
type: Object,
|
|
280
287
|
default: void 0
|
|
281
288
|
},
|
|
282
289
|
class: { type: String, default: void 0 }
|
|
283
290
|
},
|
|
284
|
-
|
|
291
|
+
emits: [
|
|
292
|
+
"update:collapsed",
|
|
293
|
+
"update:hidden",
|
|
294
|
+
"update:maximized",
|
|
295
|
+
"update:activeTabId",
|
|
296
|
+
"update:position",
|
|
297
|
+
"update:height",
|
|
298
|
+
"update:width",
|
|
299
|
+
"close",
|
|
300
|
+
"tab-added",
|
|
301
|
+
"tab-closed",
|
|
302
|
+
"pane-split",
|
|
303
|
+
"pane-closed"
|
|
304
|
+
],
|
|
305
|
+
setup(props, { expose, emit }) {
|
|
285
306
|
const config = (0, import_vue3.inject)(CliConfigKey, null);
|
|
286
307
|
const mergedOptions = (0, import_vue3.computed)(() => props.options ?? config?.options);
|
|
287
308
|
const mergedModules = (0, import_vue3.computed)(() => props.modules ?? config?.modules);
|
|
288
309
|
const mergedProcessors = (0, import_vue3.computed)(() => props.processors ?? config?.processors);
|
|
289
310
|
const mergedServices = (0, import_vue3.computed)(() => props.services ?? config?.services);
|
|
290
311
|
const visible = (0, import_vue3.ref)(true);
|
|
291
|
-
const
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
const
|
|
312
|
+
const internalCollapsed = (0, import_vue3.ref)(mergedOptions.value?.isCollapsed ?? true);
|
|
313
|
+
const internalMaximized = (0, import_vue3.ref)(false);
|
|
314
|
+
const internalHeight = (0, import_vue3.ref)(600);
|
|
315
|
+
const internalWidth = (0, import_vue3.ref)(400);
|
|
295
316
|
const prevHeight = (0, import_vue3.ref)(600);
|
|
296
317
|
const prevWidth = (0, import_vue3.ref)(400);
|
|
297
318
|
const initialized = (0, import_vue3.ref)(false);
|
|
298
|
-
const
|
|
319
|
+
const internalHidden = (0, import_vue3.ref)(props.options?.isHidden ?? false);
|
|
299
320
|
let preHideCollapsed = true;
|
|
300
|
-
const
|
|
321
|
+
const internalActiveTabId = (0, import_vue3.ref)(0);
|
|
322
|
+
const internalPosition = (0, import_vue3.ref)(
|
|
323
|
+
(0, import_cli_core.loadPanelPosition)() ?? mergedOptions.value?.position ?? "bottom"
|
|
324
|
+
);
|
|
325
|
+
const resolvedCollapsed = (0, import_vue3.computed)(() => props.collapsed !== void 0 ? props.collapsed : internalCollapsed.value);
|
|
326
|
+
const resolvedHidden = (0, import_vue3.computed)(() => props.hidden !== void 0 ? props.hidden : internalHidden.value);
|
|
327
|
+
const resolvedMaximized = (0, import_vue3.computed)(() => props.maximized !== void 0 ? props.maximized : internalMaximized.value);
|
|
328
|
+
const resolvedActiveTabId = (0, import_vue3.computed)(() => props.activeTabId !== void 0 ? props.activeTabId : internalActiveTabId.value);
|
|
329
|
+
const resolvedHeight = (0, import_vue3.computed)(() => props.height !== void 0 ? props.height : internalHeight.value);
|
|
330
|
+
const resolvedWidth = (0, import_vue3.computed)(() => props.width !== void 0 ? props.width : internalWidth.value);
|
|
331
|
+
const resolvedPosition = (0, import_vue3.computed)(() => props.position !== void 0 ? props.position : internalPosition.value);
|
|
332
|
+
function updateCollapsed(value) {
|
|
333
|
+
internalCollapsed.value = value;
|
|
334
|
+
emit("update:collapsed", value);
|
|
335
|
+
}
|
|
336
|
+
function updateHidden(value) {
|
|
337
|
+
internalHidden.value = value;
|
|
338
|
+
emit("update:hidden", value);
|
|
339
|
+
}
|
|
340
|
+
function updateMaximized(value) {
|
|
341
|
+
internalMaximized.value = value;
|
|
342
|
+
emit("update:maximized", value);
|
|
343
|
+
}
|
|
344
|
+
function updateActiveTabId(value) {
|
|
345
|
+
internalActiveTabId.value = value;
|
|
346
|
+
emit("update:activeTabId", value);
|
|
347
|
+
}
|
|
348
|
+
function updateHeight(value) {
|
|
349
|
+
internalHeight.value = value;
|
|
350
|
+
emit("update:height", value);
|
|
351
|
+
}
|
|
352
|
+
function updateWidth(value) {
|
|
353
|
+
internalWidth.value = value;
|
|
354
|
+
emit("update:width", value);
|
|
355
|
+
}
|
|
356
|
+
function updatePosition(value) {
|
|
357
|
+
internalPosition.value = value;
|
|
358
|
+
(0, import_cli_core.savePanelPosition)(value);
|
|
359
|
+
emit("update:position", value);
|
|
360
|
+
}
|
|
301
361
|
const closable = (0, import_vue3.computed)(() => mergedOptions.value?.closable ?? true);
|
|
302
362
|
const resizable = (0, import_vue3.computed)(() => mergedOptions.value?.resizable ?? true);
|
|
303
|
-
const isHorizontal = (0, import_vue3.computed)(() =>
|
|
363
|
+
const isHorizontal = (0, import_vue3.computed)(() => resolvedPosition.value === "left" || resolvedPosition.value === "right");
|
|
304
364
|
const hideable = (0, import_vue3.computed)(() => mergedOptions.value?.hideable ?? true);
|
|
305
365
|
const hideAlignment = (0, import_vue3.computed)(() => mergedOptions.value?.hideAlignment ?? "center");
|
|
306
366
|
const syncTheme = (0, import_vue3.computed)(() => mergedOptions.value?.syncTheme ?? false);
|
|
307
367
|
const themeStyles = (0, import_vue3.ref)({});
|
|
308
368
|
const tabs = (0, import_vue3.ref)([]);
|
|
309
|
-
const activeTabId = (0, import_vue3.ref)(0);
|
|
310
369
|
const activePaneId = (0, import_vue3.ref)(0);
|
|
311
370
|
let nextTabId = 1;
|
|
312
371
|
let nextPaneId = 1;
|
|
@@ -327,19 +386,19 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
327
386
|
};
|
|
328
387
|
const panelResizing = (0, import_vue3.ref)(false);
|
|
329
388
|
let panelResizeState = { startY: 0, startHeight: 0, startX: 0, startWidth: 0 };
|
|
330
|
-
function addTab() {
|
|
331
|
-
const paneId = nextPaneId++;
|
|
389
|
+
function addTab(title) {
|
|
332
390
|
const tabId = nextTabId++;
|
|
333
|
-
const
|
|
334
|
-
|
|
391
|
+
const paneId = nextPaneId++;
|
|
392
|
+
tabs.value = [...tabs.value, {
|
|
335
393
|
id: tabId,
|
|
336
|
-
title: `Terminal ${tabId}`,
|
|
394
|
+
title: title ?? `Terminal ${tabId}`,
|
|
337
395
|
isEditing: false,
|
|
338
|
-
panes: [
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
activeTabId.value = tabId;
|
|
396
|
+
panes: [{ id: paneId, widthPercent: 100 }]
|
|
397
|
+
}];
|
|
398
|
+
updateActiveTabId(tabId);
|
|
342
399
|
activePaneId.value = paneId;
|
|
400
|
+
emit("tab-added", { tabId });
|
|
401
|
+
return tabId;
|
|
343
402
|
}
|
|
344
403
|
let themeObserver;
|
|
345
404
|
function syncThemeFromEngine() {
|
|
@@ -367,8 +426,9 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
367
426
|
document.removeEventListener("click", closePositionDropdown);
|
|
368
427
|
});
|
|
369
428
|
function toggle() {
|
|
370
|
-
|
|
371
|
-
|
|
429
|
+
const newVal = !resolvedCollapsed.value;
|
|
430
|
+
updateCollapsed(newVal);
|
|
431
|
+
if (!newVal && !initialized.value) {
|
|
372
432
|
initialized.value = true;
|
|
373
433
|
addTab();
|
|
374
434
|
setupThemeSync();
|
|
@@ -378,58 +438,61 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
378
438
|
const idx = tabs.value.findIndex((t) => t.id === id);
|
|
379
439
|
if (idx === -1) return;
|
|
380
440
|
tabs.value.splice(idx, 1);
|
|
441
|
+
emit("tab-closed", { tabId: id });
|
|
381
442
|
if (tabs.value.length === 0) {
|
|
382
443
|
initialized.value = false;
|
|
383
|
-
|
|
444
|
+
updateCollapsed(true);
|
|
384
445
|
return;
|
|
385
446
|
}
|
|
386
|
-
if (
|
|
447
|
+
if (resolvedActiveTabId.value === id) {
|
|
387
448
|
const newIdx = Math.min(idx, tabs.value.length - 1);
|
|
388
449
|
selectTab(tabs.value[newIdx].id);
|
|
389
450
|
}
|
|
390
451
|
}
|
|
391
452
|
function selectTab(id) {
|
|
392
|
-
|
|
453
|
+
updateActiveTabId(id);
|
|
393
454
|
const tab = tabs.value.find((t) => t.id === id);
|
|
394
455
|
if (tab && tab.panes.length > 0) {
|
|
395
456
|
activePaneId.value = tab.panes[0].id;
|
|
396
457
|
}
|
|
397
458
|
}
|
|
398
|
-
function
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
)
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
tab.panes.splice(insertIdx, 0, { id: newPaneId, widthPercent: 0 });
|
|
407
|
-
const evenWidth = 100 / tab.panes.length;
|
|
408
|
-
tab.panes.forEach((p) => {
|
|
409
|
-
p.widthPercent = evenWidth;
|
|
459
|
+
function splitPane(tabId) {
|
|
460
|
+
const targetTabId = tabId ?? resolvedActiveTabId.value;
|
|
461
|
+
const paneId = nextPaneId++;
|
|
462
|
+
tabs.value = tabs.value.map((t) => {
|
|
463
|
+
if (t.id !== targetTabId) return t;
|
|
464
|
+
const newPanes = [...t.panes, { id: paneId, widthPercent: 0 }];
|
|
465
|
+
normalizePanes(newPanes);
|
|
466
|
+
return { ...t, panes: newPanes };
|
|
410
467
|
});
|
|
411
|
-
|
|
412
|
-
|
|
468
|
+
activePaneId.value = paneId;
|
|
469
|
+
emit("pane-split", { paneId, tabId: targetTabId });
|
|
470
|
+
return paneId;
|
|
413
471
|
}
|
|
414
|
-
function closePane(
|
|
415
|
-
const tab
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
472
|
+
function closePane(paneId) {
|
|
473
|
+
for (const tab of tabs.value) {
|
|
474
|
+
const idx = tab.panes.findIndex((p) => p.id === paneId);
|
|
475
|
+
if (idx === -1) continue;
|
|
476
|
+
if (tab.panes.length <= 1) {
|
|
477
|
+
closeTab(tab.id);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
engineMap.get(paneId)?.destroy();
|
|
481
|
+
engineMap.delete(paneId);
|
|
482
|
+
const newPanes = tab.panes.filter((p) => p.id !== paneId);
|
|
483
|
+
normalizePanes(newPanes);
|
|
484
|
+
if (activePaneId.value === paneId) {
|
|
485
|
+
activePaneId.value = newPanes[Math.min(idx, newPanes.length - 1)].id;
|
|
486
|
+
}
|
|
487
|
+
emit("pane-closed", { paneId });
|
|
488
|
+
tabs.value = tabs.value.map(
|
|
489
|
+
(t) => t.id === tab.id ? { ...t, panes: newPanes } : t
|
|
490
|
+
);
|
|
419
491
|
return;
|
|
420
492
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
const total = tab.panes.reduce((s, p) => s + p.widthPercent, 0);
|
|
425
|
-
if (total > 0)
|
|
426
|
-
tab.panes.forEach((p) => {
|
|
427
|
-
p.widthPercent = p.widthPercent / total * 100;
|
|
428
|
-
});
|
|
429
|
-
normalizePanes(tab.panes);
|
|
430
|
-
if (activePaneId.value === paneId) {
|
|
431
|
-
activePaneId.value = tab.panes[Math.min(idx, tab.panes.length - 1)].id;
|
|
432
|
-
}
|
|
493
|
+
}
|
|
494
|
+
function renameTab(tabId, title) {
|
|
495
|
+
tabs.value = tabs.value.map((t) => t.id === tabId ? { ...t, title } : t);
|
|
433
496
|
}
|
|
434
497
|
function startRename(tabId) {
|
|
435
498
|
tabs.value.forEach((t) => {
|
|
@@ -457,27 +520,27 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
457
520
|
function onPanelResizeStart(e) {
|
|
458
521
|
if (!resizable.value) return;
|
|
459
522
|
e.preventDefault();
|
|
460
|
-
if (
|
|
523
|
+
if (resolvedCollapsed.value) toggle();
|
|
461
524
|
panelResizing.value = true;
|
|
462
525
|
panelResizeState = {
|
|
463
526
|
startY: e.clientY,
|
|
464
|
-
startHeight:
|
|
527
|
+
startHeight: resolvedHeight.value,
|
|
465
528
|
startX: e.clientX,
|
|
466
|
-
startWidth:
|
|
529
|
+
startWidth: resolvedWidth.value
|
|
467
530
|
};
|
|
468
531
|
}
|
|
469
532
|
function onPanelResizeMove(e) {
|
|
470
533
|
if (!panelResizing.value) return;
|
|
471
534
|
if (isHorizontal.value) {
|
|
472
|
-
const deltaX =
|
|
535
|
+
const deltaX = resolvedPosition.value === "left" ? e.clientX - panelResizeState.startX : panelResizeState.startX - e.clientX;
|
|
473
536
|
let next = Math.max(100, panelResizeState.startWidth + deltaX);
|
|
474
537
|
if (next > window.innerWidth) next = window.innerWidth;
|
|
475
|
-
|
|
538
|
+
updateWidth(next);
|
|
476
539
|
} else {
|
|
477
|
-
const deltaY =
|
|
540
|
+
const deltaY = resolvedPosition.value === "top" ? e.clientY - panelResizeState.startY : panelResizeState.startY - e.clientY;
|
|
478
541
|
let next = Math.max(100, panelResizeState.startHeight + deltaY);
|
|
479
542
|
if (next > window.innerHeight) next = window.innerHeight;
|
|
480
|
-
|
|
543
|
+
updateHeight(next);
|
|
481
544
|
}
|
|
482
545
|
}
|
|
483
546
|
function onPanelResizeEnd() {
|
|
@@ -543,34 +606,35 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
543
606
|
document.removeEventListener("mouseup", onPaneResizeEnd);
|
|
544
607
|
});
|
|
545
608
|
function toggleMaximize() {
|
|
546
|
-
if (!
|
|
609
|
+
if (!resolvedMaximized.value) {
|
|
547
610
|
if (isHorizontal.value) {
|
|
548
|
-
prevWidth.value =
|
|
549
|
-
|
|
611
|
+
prevWidth.value = resolvedWidth.value;
|
|
612
|
+
updateWidth(window.innerWidth);
|
|
550
613
|
} else {
|
|
551
|
-
prevHeight.value =
|
|
552
|
-
|
|
614
|
+
prevHeight.value = resolvedHeight.value;
|
|
615
|
+
updateHeight(window.innerHeight);
|
|
553
616
|
}
|
|
554
617
|
} else {
|
|
555
618
|
if (isHorizontal.value) {
|
|
556
|
-
|
|
619
|
+
updateWidth(prevWidth.value);
|
|
557
620
|
} else {
|
|
558
|
-
|
|
621
|
+
updateHeight(prevHeight.value);
|
|
559
622
|
}
|
|
560
623
|
}
|
|
561
|
-
|
|
624
|
+
updateMaximized(!resolvedMaximized.value);
|
|
562
625
|
}
|
|
563
626
|
function handleClose() {
|
|
564
627
|
visible.value = false;
|
|
628
|
+
emit("close");
|
|
565
629
|
props.onClose?.();
|
|
566
630
|
}
|
|
567
631
|
function handleHide() {
|
|
568
|
-
preHideCollapsed =
|
|
569
|
-
|
|
632
|
+
preHideCollapsed = resolvedCollapsed.value;
|
|
633
|
+
updateHidden(true);
|
|
570
634
|
}
|
|
571
635
|
function handleUnhide() {
|
|
572
|
-
|
|
573
|
-
|
|
636
|
+
updateHidden(false);
|
|
637
|
+
updateCollapsed(preHideCollapsed);
|
|
574
638
|
}
|
|
575
639
|
const positionDropdownOpen = (0, import_vue3.ref)(false);
|
|
576
640
|
function closePositionDropdown() {
|
|
@@ -582,21 +646,106 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
582
646
|
}
|
|
583
647
|
function selectPosition(pos) {
|
|
584
648
|
positionDropdownOpen.value = false;
|
|
585
|
-
|
|
586
|
-
(0, import_cli_core.savePanelPosition)(pos);
|
|
649
|
+
updatePosition(pos);
|
|
587
650
|
}
|
|
651
|
+
function getEngine(paneId) {
|
|
652
|
+
const targetId = paneId ?? activePaneId.value;
|
|
653
|
+
return engineMap.get(targetId);
|
|
654
|
+
}
|
|
655
|
+
function getState() {
|
|
656
|
+
return {
|
|
657
|
+
collapsed: resolvedCollapsed.value,
|
|
658
|
+
hidden: resolvedHidden.value,
|
|
659
|
+
maximized: resolvedMaximized.value,
|
|
660
|
+
position: resolvedPosition.value,
|
|
661
|
+
height: resolvedHeight.value,
|
|
662
|
+
width: resolvedWidth.value,
|
|
663
|
+
activeTabId: resolvedActiveTabId.value,
|
|
664
|
+
activePaneId: activePaneId.value,
|
|
665
|
+
tabs: tabs.value.map((t) => ({
|
|
666
|
+
id: t.id,
|
|
667
|
+
title: t.title,
|
|
668
|
+
panes: t.panes.map((p) => ({ id: p.id, widthPercent: p.widthPercent }))
|
|
669
|
+
}))
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
expose({
|
|
673
|
+
open: () => {
|
|
674
|
+
if (!visible.value) {
|
|
675
|
+
visible.value = true;
|
|
676
|
+
}
|
|
677
|
+
if (resolvedHidden.value) {
|
|
678
|
+
updateHidden(false);
|
|
679
|
+
}
|
|
680
|
+
if (resolvedCollapsed.value) {
|
|
681
|
+
updateCollapsed(false);
|
|
682
|
+
if (!initialized.value) {
|
|
683
|
+
initialized.value = true;
|
|
684
|
+
addTab();
|
|
685
|
+
setupThemeSync();
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
collapse: () => {
|
|
690
|
+
if (!resolvedCollapsed.value) updateCollapsed(true);
|
|
691
|
+
},
|
|
692
|
+
toggleCollapse: () => {
|
|
693
|
+
if (resolvedCollapsed.value) {
|
|
694
|
+
updateCollapsed(false);
|
|
695
|
+
if (!initialized.value) {
|
|
696
|
+
initialized.value = true;
|
|
697
|
+
addTab();
|
|
698
|
+
setupThemeSync();
|
|
699
|
+
}
|
|
700
|
+
} else {
|
|
701
|
+
updateCollapsed(true);
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
hide: () => {
|
|
705
|
+
if (!resolvedHidden.value) updateHidden(true);
|
|
706
|
+
},
|
|
707
|
+
unhide: () => {
|
|
708
|
+
if (resolvedHidden.value) updateHidden(false);
|
|
709
|
+
},
|
|
710
|
+
toggleHide: () => {
|
|
711
|
+
updateHidden(!resolvedHidden.value);
|
|
712
|
+
},
|
|
713
|
+
close: handleClose,
|
|
714
|
+
maximize: () => {
|
|
715
|
+
if (!resolvedMaximized.value) updateMaximized(true);
|
|
716
|
+
},
|
|
717
|
+
restore: () => {
|
|
718
|
+
if (resolvedMaximized.value) updateMaximized(false);
|
|
719
|
+
},
|
|
720
|
+
toggleMaximize: () => {
|
|
721
|
+
updateMaximized(!resolvedMaximized.value);
|
|
722
|
+
},
|
|
723
|
+
resize: (dims) => {
|
|
724
|
+
if (dims.height !== void 0) updateHeight(dims.height);
|
|
725
|
+
if (dims.width !== void 0) updateWidth(dims.width);
|
|
726
|
+
},
|
|
727
|
+
setPosition: updatePosition,
|
|
728
|
+
addTab,
|
|
729
|
+
closeTab,
|
|
730
|
+
selectTab,
|
|
731
|
+
renameTab,
|
|
732
|
+
splitPane,
|
|
733
|
+
closePane,
|
|
734
|
+
getEngine,
|
|
735
|
+
getState
|
|
736
|
+
});
|
|
588
737
|
return () => {
|
|
589
738
|
if (!visible.value) return null;
|
|
590
739
|
const wrapperClass = [
|
|
591
740
|
"cli-panel-wrapper",
|
|
592
|
-
|
|
593
|
-
|
|
741
|
+
resolvedCollapsed.value && "collapsed",
|
|
742
|
+
resolvedMaximized.value && "maximized",
|
|
594
743
|
panelResizing.value && "resizing",
|
|
595
744
|
props.class
|
|
596
745
|
].filter(Boolean).join(" ");
|
|
597
746
|
const wrapperStyle = {
|
|
598
|
-
...isHorizontal.value ? { width: `${
|
|
599
|
-
...
|
|
747
|
+
...isHorizontal.value ? { width: `${resolvedWidth.value}px` } : { height: `${resolvedHeight.value}px` },
|
|
748
|
+
...resolvedHidden.value ? { display: "none" } : {},
|
|
600
749
|
...themeStyles.value,
|
|
601
750
|
...props.style
|
|
602
751
|
};
|
|
@@ -625,13 +774,13 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
625
774
|
class: "cli-panel-btn cli-panel-btn-position",
|
|
626
775
|
title: "Move panel",
|
|
627
776
|
onClick: togglePositionDropdown
|
|
628
|
-
}, [positionIcon(
|
|
777
|
+
}, [positionIcon(resolvedPosition.value)]),
|
|
629
778
|
positionDropdownOpen.value ? (0, import_vue3.h)(
|
|
630
779
|
"div",
|
|
631
780
|
{ class: "cli-panel-position-dropdown" },
|
|
632
781
|
["bottom", "top", "left", "right"].map(
|
|
633
782
|
(pos) => (0, import_vue3.h)("button", {
|
|
634
|
-
class: ["cli-panel-position-dropdown-item",
|
|
783
|
+
class: ["cli-panel-position-dropdown-item", resolvedPosition.value === pos ? "active" : ""].filter(Boolean).join(" "),
|
|
635
784
|
onClick: () => selectPosition(pos)
|
|
636
785
|
}, [
|
|
637
786
|
positionIcon(pos, 16),
|
|
@@ -649,20 +798,20 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
649
798
|
"button",
|
|
650
799
|
{
|
|
651
800
|
class: "cli-panel-btn",
|
|
652
|
-
title:
|
|
653
|
-
disabled:
|
|
801
|
+
title: resolvedMaximized.value ? "Restore" : "Maximize",
|
|
802
|
+
disabled: resolvedCollapsed.value,
|
|
654
803
|
onClick: toggleMaximize
|
|
655
804
|
},
|
|
656
|
-
[
|
|
805
|
+
[resolvedMaximized.value ? restoreIcon() : maximizeIcon()]
|
|
657
806
|
),
|
|
658
807
|
(0, import_vue3.h)(
|
|
659
808
|
"button",
|
|
660
809
|
{
|
|
661
810
|
class: "cli-panel-btn",
|
|
662
|
-
title:
|
|
811
|
+
title: resolvedCollapsed.value ? "Expand" : "Collapse",
|
|
663
812
|
onClick: toggle
|
|
664
813
|
},
|
|
665
|
-
[collapseChevron(
|
|
814
|
+
[collapseChevron(resolvedPosition.value, resolvedCollapsed.value)]
|
|
666
815
|
),
|
|
667
816
|
closable.value ? (0, import_vue3.h)(
|
|
668
817
|
"button",
|
|
@@ -676,7 +825,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
676
825
|
])
|
|
677
826
|
])
|
|
678
827
|
]);
|
|
679
|
-
const contentEl = initialized.value ? (0, import_vue3.h)("div", { class: "cli-panel-content", style:
|
|
828
|
+
const contentEl = initialized.value ? (0, import_vue3.h)("div", { class: "cli-panel-content", style: resolvedCollapsed.value ? { display: "none" } : void 0 }, [
|
|
680
829
|
// Tab bar
|
|
681
830
|
(0, import_vue3.h)("div", { class: "cli-panel-tabs" }, [
|
|
682
831
|
(0, import_vue3.h)(
|
|
@@ -689,7 +838,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
689
838
|
key: tab.id,
|
|
690
839
|
class: [
|
|
691
840
|
"cli-panel-tab",
|
|
692
|
-
tab.id ===
|
|
841
|
+
tab.id === resolvedActiveTabId.value && "active"
|
|
693
842
|
].filter(Boolean).join(" "),
|
|
694
843
|
onClick: () => selectTab(tab.id),
|
|
695
844
|
onDblclick: () => startRename(tab.id),
|
|
@@ -773,7 +922,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
773
922
|
key: tab.id,
|
|
774
923
|
class: "cli-panel-instance",
|
|
775
924
|
style: {
|
|
776
|
-
display: tab.id ===
|
|
925
|
+
display: tab.id === resolvedActiveTabId.value ? void 0 : "none"
|
|
777
926
|
}
|
|
778
927
|
},
|
|
779
928
|
[
|
|
@@ -813,7 +962,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
813
962
|
{
|
|
814
963
|
class: [
|
|
815
964
|
"cli-panel-pane",
|
|
816
|
-
pane.id === activePaneId.value && tab.id ===
|
|
965
|
+
pane.id === activePaneId.value && tab.id === resolvedActiveTabId.value && "active-pane"
|
|
817
966
|
].filter(
|
|
818
967
|
Boolean
|
|
819
968
|
).join(" "),
|
|
@@ -822,7 +971,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
822
971
|
},
|
|
823
972
|
onClick: () => {
|
|
824
973
|
activePaneId.value = pane.id;
|
|
825
|
-
|
|
974
|
+
updateActiveTabId(tab.id);
|
|
826
975
|
}
|
|
827
976
|
},
|
|
828
977
|
[
|
|
@@ -834,7 +983,6 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
834
983
|
onClick: (e) => {
|
|
835
984
|
e.stopPropagation();
|
|
836
985
|
closePane(
|
|
837
|
-
tab.id,
|
|
838
986
|
pane.id
|
|
839
987
|
);
|
|
840
988
|
}
|
|
@@ -910,7 +1058,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
910
1058
|
{ id: paneId, widthPercent: 100, snapshot }
|
|
911
1059
|
]
|
|
912
1060
|
});
|
|
913
|
-
|
|
1061
|
+
updateActiveTabId(tabId);
|
|
914
1062
|
activePaneId.value = paneId;
|
|
915
1063
|
}
|
|
916
1064
|
},
|
|
@@ -922,7 +1070,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
922
1070
|
class: "cli-panel-context-menu-item",
|
|
923
1071
|
onClick: () => {
|
|
924
1072
|
closeContextMenu();
|
|
925
|
-
|
|
1073
|
+
splitPane(contextMenu.value.tabId);
|
|
926
1074
|
}
|
|
927
1075
|
},
|
|
928
1076
|
"Split Right"
|
|
@@ -952,7 +1100,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
952
1100
|
tabs.value = tabs.value.filter(
|
|
953
1101
|
(t) => t.id === id
|
|
954
1102
|
);
|
|
955
|
-
|
|
1103
|
+
updateActiveTabId(id);
|
|
956
1104
|
}
|
|
957
1105
|
},
|
|
958
1106
|
"Close Others"
|
|
@@ -987,16 +1135,16 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
987
1135
|
closeContextMenu();
|
|
988
1136
|
tabs.value = [];
|
|
989
1137
|
initialized.value = false;
|
|
990
|
-
|
|
1138
|
+
updateCollapsed(true);
|
|
991
1139
|
}
|
|
992
1140
|
},
|
|
993
1141
|
"Close All"
|
|
994
1142
|
)
|
|
995
1143
|
]
|
|
996
1144
|
) : null;
|
|
997
|
-
const hideTabEl =
|
|
1145
|
+
const hideTabEl = resolvedHidden.value ? (0, import_vue3.h)("button", {
|
|
998
1146
|
class: "cli-panel-hide-tab",
|
|
999
|
-
"data-position":
|
|
1147
|
+
"data-position": resolvedPosition.value,
|
|
1000
1148
|
"data-hide-align": hideAlignment.value,
|
|
1001
1149
|
style: themeStyles.value,
|
|
1002
1150
|
title: "Show CLI",
|
|
@@ -1007,7 +1155,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
1007
1155
|
(0, import_vue3.h)("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
1008
1156
|
]),
|
|
1009
1157
|
(0, import_vue3.h)("span", { class: "cli-panel-hide-tab-label" }, "CLI"),
|
|
1010
|
-
hideTabChevron(
|
|
1158
|
+
hideTabChevron(resolvedPosition.value)
|
|
1011
1159
|
]) : null;
|
|
1012
1160
|
return (0, import_vue3.h)("div", {}, [
|
|
1013
1161
|
hideTabEl,
|
|
@@ -1016,7 +1164,7 @@ var CliPanel = (0, import_vue3.defineComponent)({
|
|
|
1016
1164
|
{
|
|
1017
1165
|
class: wrapperClass,
|
|
1018
1166
|
style: wrapperStyle,
|
|
1019
|
-
"data-position":
|
|
1167
|
+
"data-position": resolvedPosition.value,
|
|
1020
1168
|
"data-resizable": String(resizable.value),
|
|
1021
1169
|
"data-closable": String(closable.value),
|
|
1022
1170
|
"data-hideable": String(hideable.value)
|