@gallop.software/studio 0.1.63 → 0.1.65

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.
@@ -447,22 +447,54 @@ var styles2 = {
447
447
  folderList: css2`
448
448
  display: flex;
449
449
  flex-direction: column;
450
- gap: 2px;
450
+ gap: 0;
451
451
  `,
452
452
  folderItem: css2`
453
453
  display: flex;
454
454
  align-items: center;
455
455
  gap: 8px;
456
- padding: 10px 12px;
456
+ padding: 8px 12px;
457
457
  border-radius: 6px;
458
458
  cursor: pointer;
459
459
  transition: all 0.15s ease;
460
460
  border: 1px solid transparent;
461
+ position: relative;
461
462
 
462
463
  &:hover {
463
464
  background-color: ${colors.surfaceHover};
464
465
  }
465
466
  `,
467
+ treeIndent: css2`
468
+ display: flex;
469
+ align-items: center;
470
+ height: 100%;
471
+ `,
472
+ treeLine: css2`
473
+ width: 16px;
474
+ height: 100%;
475
+ position: relative;
476
+ flex-shrink: 0;
477
+
478
+ &::before {
479
+ content: '';
480
+ position: absolute;
481
+ left: 8px;
482
+ top: 0;
483
+ bottom: 50%;
484
+ width: 0;
485
+ border-left: 1px dashed ${colors.border};
486
+ }
487
+
488
+ &::after {
489
+ content: '';
490
+ position: absolute;
491
+ left: 8px;
492
+ top: 50%;
493
+ width: 8px;
494
+ height: 0;
495
+ border-top: 1px dashed ${colors.border};
496
+ }
497
+ `,
466
498
  folderItemSelected: css2`
467
499
  background-color: ${colors.primaryLight};
468
500
  border-color: ${colors.primary};
@@ -471,6 +503,14 @@ var styles2 = {
471
503
  background-color: ${colors.primaryLight};
472
504
  }
473
505
  `,
506
+ folderItemDisabled: css2`
507
+ opacity: 0.5;
508
+ cursor: not-allowed;
509
+
510
+ &:hover {
511
+ background-color: transparent;
512
+ }
513
+ `,
474
514
  folderIcon: css2`
475
515
  width: 20px;
476
516
  height: 20px;
@@ -569,11 +609,11 @@ function StudioFolderPicker({ selectedItems, currentPath, onMove, onCancel }) {
569
609
  }, []);
570
610
  const selectedPaths = Array.from(selectedItems);
571
611
  const availableFolders = folders.filter((folder) => {
572
- if (folder.path === currentPath) return false;
573
612
  return !selectedPaths.some(
574
613
  (selected) => folder.path === selected || folder.path.startsWith(selected + "/")
575
614
  );
576
615
  });
616
+ const isCurrentFolder = (folderPath) => folderPath === currentPath;
577
617
  const handleConfirm = () => {
578
618
  if (selectedFolder) {
579
619
  onMove(selectedFolder);
@@ -589,22 +629,30 @@ function StudioFolderPicker({ selectedItems, currentPath, onMove, onCancel }) {
589
629
  selectedItems.size !== 1 ? "s" : "",
590
630
  ":"
591
631
  ] }),
592
- loading ? /* @__PURE__ */ jsx2("div", { css: styles2.loading, children: /* @__PURE__ */ jsx2("div", { css: styles2.spinner }) }) : availableFolders.length === 0 ? /* @__PURE__ */ jsx2("div", { css: styles2.loading, children: "No available folders to move to." }) : /* @__PURE__ */ jsx2("div", { css: styles2.folderList, children: availableFolders.map((folder) => /* @__PURE__ */ jsxs2(
593
- "div",
594
- {
595
- css: [
596
- styles2.folderItem,
597
- selectedFolder === folder.path && styles2.folderItemSelected
598
- ],
599
- style: { paddingLeft: 12 + folder.depth * 16 },
600
- onClick: () => setSelectedFolder(folder.path),
601
- children: [
602
- /* @__PURE__ */ jsx2("svg", { css: styles2.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("path", { d: "M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z" }) }),
603
- /* @__PURE__ */ jsx2("span", { css: styles2.folderName, children: folder.name })
604
- ]
605
- },
606
- folder.path
607
- )) })
632
+ loading ? /* @__PURE__ */ jsx2("div", { css: styles2.loading, children: /* @__PURE__ */ jsx2("div", { css: styles2.spinner }) }) : availableFolders.length === 0 ? /* @__PURE__ */ jsx2("div", { css: styles2.loading, children: "No available folders to move to." }) : /* @__PURE__ */ jsx2("div", { css: styles2.folderList, children: availableFolders.map((folder) => {
633
+ const disabled = isCurrentFolder(folder.path);
634
+ return /* @__PURE__ */ jsxs2(
635
+ "div",
636
+ {
637
+ css: [
638
+ styles2.folderItem,
639
+ selectedFolder === folder.path && styles2.folderItemSelected,
640
+ disabled && styles2.folderItemDisabled
641
+ ],
642
+ style: { paddingLeft: 12 },
643
+ onClick: () => !disabled && setSelectedFolder(folder.path),
644
+ children: [
645
+ folder.depth > 0 && /* @__PURE__ */ jsx2("div", { css: styles2.treeIndent, children: Array.from({ length: folder.depth }).map((_, i) => /* @__PURE__ */ jsx2("div", { css: styles2.treeLine }, i)) }),
646
+ /* @__PURE__ */ jsx2("svg", { css: styles2.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("path", { d: "M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z" }) }),
647
+ /* @__PURE__ */ jsxs2("span", { css: styles2.folderName, children: [
648
+ folder.name,
649
+ disabled && " (current)"
650
+ ] })
651
+ ]
652
+ },
653
+ folder.path
654
+ );
655
+ }) })
608
656
  ] }),
609
657
  /* @__PURE__ */ jsxs2("div", { css: styles2.footer, children: [
610
658
  /* @__PURE__ */ jsx2("button", { css: [styles2.btn, styles2.btnCancel], onClick: onCancel, children: "Cancel" }),
@@ -3728,4 +3776,4 @@ export {
3728
3776
  StudioUI,
3729
3777
  StudioUI_default as default
3730
3778
  };
3731
- //# sourceMappingURL=StudioUI-BVNH67OK.mjs.map
3779
+ //# sourceMappingURL=StudioUI-HPSBJNBM.mjs.map