@kidecms/core 0.29.0 → 0.29.1
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.
|
@@ -707,7 +707,7 @@ export default function TreeItemsEditor({ name, value, variant, label, linkOptio
|
|
|
707
707
|
|
|
708
708
|
// --- Render ---
|
|
709
709
|
|
|
710
|
-
const emptyLabel = variant === "menu" ? "No menu items." : "No terms.";
|
|
710
|
+
const emptyLabel = variant === "menu" ? "No menu items." : "No terms yet — add one above.";
|
|
711
711
|
const addLabel = variant === "menu" ? "Add menu item" : "Add term";
|
|
712
712
|
|
|
713
713
|
return (
|
|
@@ -739,26 +739,32 @@ export default function TreeItemsEditor({ name, value, variant, label, linkOptio
|
|
|
739
739
|
</div>
|
|
740
740
|
)}
|
|
741
741
|
|
|
742
|
+
{/* The only way to add a term: a plus-prefixed input that names the action in
|
|
743
|
+
its placeholder, so it never reads as the filter box its position suggests. */}
|
|
742
744
|
{variant === "taxonomy" && (
|
|
743
745
|
<div className="flex items-center gap-2">
|
|
744
|
-
<
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
746
|
+
<div className="relative min-w-0 flex-1">
|
|
747
|
+
<Plus className="text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2" />
|
|
748
|
+
<Input
|
|
749
|
+
value={bulkInput}
|
|
750
|
+
onChange={(e) => setBulkInput(e.target.value)}
|
|
751
|
+
onKeyDown={(e) => {
|
|
752
|
+
if (e.key === "Enter") {
|
|
753
|
+
e.preventDefault();
|
|
754
|
+
handleBulkAdd();
|
|
755
|
+
}
|
|
756
|
+
}}
|
|
757
|
+
placeholder="e.g., Electronics, Clothing, Books"
|
|
758
|
+
className="w-full pl-9 text-sm"
|
|
759
|
+
/>
|
|
760
|
+
</div>
|
|
756
761
|
<Select
|
|
757
762
|
items={parentOptions.map((opt) => ({ value: opt.id, label: opt.label }))}
|
|
758
763
|
value={bulkParent}
|
|
759
764
|
onValueChange={(v) => setBulkParent(v ?? "")}
|
|
760
765
|
>
|
|
761
|
-
<SelectTrigger className="w-
|
|
766
|
+
<SelectTrigger className="w-40 shrink-0 text-sm">
|
|
767
|
+
<span className="text-muted-foreground">Under</span>
|
|
762
768
|
<SelectValue placeholder="Root" />
|
|
763
769
|
</SelectTrigger>
|
|
764
770
|
<SelectContent>
|
|
@@ -815,10 +821,12 @@ export default function TreeItemsEditor({ name, value, variant, label, linkOptio
|
|
|
815
821
|
)}
|
|
816
822
|
</DragOverlay>
|
|
817
823
|
</DndContext>
|
|
818
|
-
|
|
819
|
-
<
|
|
820
|
-
|
|
821
|
-
|
|
824
|
+
{variant === "menu" && (
|
|
825
|
+
<Button type="button" variant="outline" size="sm" onClick={addRootItem}>
|
|
826
|
+
<Plus className="size-4" />
|
|
827
|
+
{addLabel}
|
|
828
|
+
</Button>
|
|
829
|
+
)}
|
|
822
830
|
</div>
|
|
823
831
|
);
|
|
824
832
|
}
|