@fayz-ai/plugin-menu 0.12.10 → 0.13.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.
- package/dist/{MenuPage-ITS2DGKM.js → MenuPage-7WXTOSQK.js} +89 -63
- package/dist/MenuPage-7WXTOSQK.js.map +1 -0
- package/dist/components/DraftSectionCard.d.ts.map +1 -1
- package/dist/components/ItemRailPage.d.ts.map +1 -1
- package/dist/components/SectionCard.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/settings/v1-settings.d.ts +2 -0
- package/dist/settings/v1-settings.d.ts.map +1 -0
- package/package.json +5 -5
- package/dist/MenuPage-ITS2DGKM.js.map +0 -1
|
@@ -5,7 +5,7 @@ import { Plus, Sparkles, Search, UtensilsCrossed, MoreVertical, Pencil, Copy, Po
|
|
|
5
5
|
import { useSensors, useSensor, PointerSensor, DndContext, closestCenter, DragOverlay } from '@dnd-kit/core';
|
|
6
6
|
import { SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
|
|
7
7
|
import { useTranslation } from '@fayz-ai/core';
|
|
8
|
-
import { PageHeaderActions, PageTabs, Button, AiActionButton, toast, ConfirmDialog, Dropdown, DropdownTrigger, Hint, DropdownContent, DropdownItem, DropdownSeparator, Skeleton, DraftCommitBar, SheetBody,
|
|
8
|
+
import { PageHeaderActions, PageTabs, Input, Button, AiActionButton, toast, ConfirmDialog, Dropdown, DropdownTrigger, Hint, DropdownContent, DropdownItem, DropdownSeparator, Skeleton, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DraftCommitBar, SheetBody, Switch, SheetFooter, ImageDrop, CurrencyInput, SegmentedControl, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, TimePicker } from '@fayz-ai/ui';
|
|
9
9
|
import { CSS } from '@dnd-kit/utilities';
|
|
10
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
11
|
|
|
@@ -462,15 +462,17 @@ function InlinePrice({ value, currency, muted, onSave }) {
|
|
|
462
462
|
const [draft, setDraft] = useState("");
|
|
463
463
|
if (!editing) {
|
|
464
464
|
return /* @__PURE__ */ jsx(
|
|
465
|
-
|
|
465
|
+
Button,
|
|
466
466
|
{
|
|
467
|
+
variant: "bare",
|
|
468
|
+
size: "bare",
|
|
467
469
|
type: "button",
|
|
468
470
|
onClick: (e) => {
|
|
469
471
|
e.stopPropagation();
|
|
470
472
|
setDraft(String(value ?? 0));
|
|
471
473
|
setEditing(true);
|
|
472
474
|
},
|
|
473
|
-
className: `rounded px-1.5 py-0.5 text-sm tabular-nums transition-colors hover:bg-muted ${muted ? "text-muted-foreground" : "font-medium"}`,
|
|
475
|
+
className: `font-normal rounded px-1.5 py-0.5 text-sm tabular-nums transition-colors hover:bg-muted ${muted ? "text-muted-foreground" : "font-medium"}`,
|
|
474
476
|
children: formatCurrency(value ?? 0, currency)
|
|
475
477
|
}
|
|
476
478
|
);
|
|
@@ -480,8 +482,8 @@ function InlinePrice({ value, currency, muted, onSave }) {
|
|
|
480
482
|
setEditing(false);
|
|
481
483
|
if (Number.isFinite(parsed) && parsed !== value) onSave(Math.max(0, parsed));
|
|
482
484
|
};
|
|
483
|
-
return /* @__PURE__ */ jsx(
|
|
484
|
-
|
|
485
|
+
return /* @__PURE__ */ jsx("div", { className: "w-20", children: /* @__PURE__ */ jsx(
|
|
486
|
+
Input,
|
|
485
487
|
{
|
|
486
488
|
autoFocus: true,
|
|
487
489
|
value: draft,
|
|
@@ -492,9 +494,9 @@ function InlinePrice({ value, currency, muted, onSave }) {
|
|
|
492
494
|
if (e.key === "Enter") commit();
|
|
493
495
|
if (e.key === "Escape") setEditing(false);
|
|
494
496
|
},
|
|
495
|
-
className: "
|
|
497
|
+
className: "h-auto rounded border-border px-1.5 py-0.5 text-right tabular-nums shadow-none focus-visible:ring-offset-0"
|
|
496
498
|
}
|
|
497
|
-
);
|
|
499
|
+
) });
|
|
498
500
|
}
|
|
499
501
|
function ItemRow({ placement, item, currency, deliveryPricing, multiMenu, pending, handlers }) {
|
|
500
502
|
const t = useTranslation();
|
|
@@ -513,8 +515,10 @@ function ItemRow({ placement, item, currency, deliveryPricing, multiMenu, pendin
|
|
|
513
515
|
className: `group flex items-center gap-3 border-b px-3 py-2 last:border-0 ${isDragging ? "opacity-40" : "hover:bg-muted/20"} ${pending ? "pointer-events-none opacity-60" : ""}`,
|
|
514
516
|
children: [
|
|
515
517
|
/* @__PURE__ */ jsx(
|
|
516
|
-
|
|
518
|
+
Button,
|
|
517
519
|
{
|
|
520
|
+
variant: "bare",
|
|
521
|
+
size: "bare",
|
|
518
522
|
...attributes,
|
|
519
523
|
...listeners,
|
|
520
524
|
"aria-label": t("menu.manager.dragItem"),
|
|
@@ -524,11 +528,13 @@ function ItemRow({ placement, item, currency, deliveryPricing, multiMenu, pendin
|
|
|
524
528
|
),
|
|
525
529
|
/* @__PURE__ */ jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted/40", children: item.imageUrl ? /* @__PURE__ */ jsx("img", { src: item.imageUrl, alt: "", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx(ImageOff, { className: "h-3.5 w-3.5 text-muted-foreground/40" }) }),
|
|
526
530
|
/* @__PURE__ */ jsxs(
|
|
527
|
-
|
|
531
|
+
Button,
|
|
528
532
|
{
|
|
533
|
+
variant: "bare",
|
|
534
|
+
size: "bare",
|
|
529
535
|
type: "button",
|
|
530
536
|
onClick: () => handlers.onEditItem(item, placement),
|
|
531
|
-
className: "min-w-0 flex-1 text-left",
|
|
537
|
+
className: "block min-w-0 flex-1 text-left font-normal",
|
|
532
538
|
children: [
|
|
533
539
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
534
540
|
/* @__PURE__ */ jsx("span", { className: `truncate text-sm font-medium ${item.status === "hidden" ? "text-muted-foreground" : ""}`, children: item.name }),
|
|
@@ -559,7 +565,7 @@ function ItemRow({ placement, item, currency, deliveryPricing, multiMenu, pendin
|
|
|
559
565
|
/* @__PURE__ */ jsx(Switch, { size: "sm", checked: item.availableForDelivery, onCheckedChange: (v) => handlers.onToggleItem(item.id, "availableForDelivery", v), label: t("menu.manager.delivery") })
|
|
560
566
|
] }),
|
|
561
567
|
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
562
|
-
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx("
|
|
568
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "bare", size: "bare", className: "rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": t("menu.manager.itemActions"), children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
|
|
563
569
|
/* @__PURE__ */ jsxs(DropdownContent, { align: "end", children: [
|
|
564
570
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => handlers.onEditItem(item, placement), children: [
|
|
565
571
|
/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-3.5 w-3.5" }),
|
|
@@ -628,8 +634,10 @@ function SectionCard({
|
|
|
628
634
|
children: [
|
|
629
635
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b bg-muted/20 px-3 py-2", children: [
|
|
630
636
|
/* @__PURE__ */ jsx(
|
|
631
|
-
|
|
637
|
+
Button,
|
|
632
638
|
{
|
|
639
|
+
variant: "bare",
|
|
640
|
+
size: "bare",
|
|
633
641
|
...attributes,
|
|
634
642
|
...listeners,
|
|
635
643
|
"aria-label": t("menu.manager.dragSection"),
|
|
@@ -638,8 +646,10 @@ function SectionCard({
|
|
|
638
646
|
}
|
|
639
647
|
),
|
|
640
648
|
/* @__PURE__ */ jsx(
|
|
641
|
-
|
|
649
|
+
Button,
|
|
642
650
|
{
|
|
651
|
+
variant: "bare",
|
|
652
|
+
size: "bare",
|
|
643
653
|
type: "button",
|
|
644
654
|
onClick: () => setCollapsed((c) => !c),
|
|
645
655
|
className: "text-muted-foreground hover:text-foreground",
|
|
@@ -647,8 +657,8 @@ function SectionCard({
|
|
|
647
657
|
children: collapsed ? /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
648
658
|
}
|
|
649
659
|
),
|
|
650
|
-
renaming ? /* @__PURE__ */ jsx(
|
|
651
|
-
|
|
660
|
+
renaming ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
661
|
+
Input,
|
|
652
662
|
{
|
|
653
663
|
autoFocus: true,
|
|
654
664
|
value: draft,
|
|
@@ -664,11 +674,13 @@ function SectionCard({
|
|
|
664
674
|
setRenaming(false);
|
|
665
675
|
}
|
|
666
676
|
},
|
|
667
|
-
className: "rounded border
|
|
677
|
+
className: "h-auto rounded border-border px-2 py-0.5 font-semibold shadow-none focus-visible:ring-offset-0"
|
|
668
678
|
}
|
|
669
|
-
) : /* @__PURE__ */ jsx(
|
|
670
|
-
|
|
679
|
+
) }) : /* @__PURE__ */ jsx(
|
|
680
|
+
Button,
|
|
671
681
|
{
|
|
682
|
+
variant: "bare",
|
|
683
|
+
size: "bare",
|
|
672
684
|
type: "button",
|
|
673
685
|
onClick: () => {
|
|
674
686
|
setDraft(section.name);
|
|
@@ -696,7 +708,7 @@ function SectionCard({
|
|
|
696
708
|
t("menu.manager.addItem")
|
|
697
709
|
] }),
|
|
698
710
|
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
699
|
-
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx("
|
|
711
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "bare", size: "bare", className: "rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": t("menu.manager.sectionActions"), children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
|
|
700
712
|
/* @__PURE__ */ jsxs(DropdownContent, { align: "end", children: [
|
|
701
713
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => handlers.onEditSection(section), children: [
|
|
702
714
|
/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-3.5 w-3.5" }),
|
|
@@ -714,11 +726,13 @@ function SectionCard({
|
|
|
714
726
|
] })
|
|
715
727
|
] }),
|
|
716
728
|
!collapsed && (placements.length === 0 ? /* @__PURE__ */ jsxs(
|
|
717
|
-
|
|
729
|
+
Button,
|
|
718
730
|
{
|
|
731
|
+
variant: "bare",
|
|
732
|
+
size: "bare",
|
|
719
733
|
type: "button",
|
|
720
734
|
onClick: () => handlers.onAddItem(section.id),
|
|
721
|
-
className: "flex w-full flex-col items-center gap-1 border-2 border-dashed border-transparent py-6 text-center transition-colors hover:bg-muted/20",
|
|
735
|
+
className: "flex w-full flex-col items-center justify-start gap-1 rounded-none border-2 border-dashed border-transparent py-6 text-center font-normal transition-colors hover:bg-muted/20",
|
|
722
736
|
children: [
|
|
723
737
|
/* @__PURE__ */ jsx(UtensilsCrossed, { className: "h-5 w-5 text-muted-foreground/40" }),
|
|
724
738
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("menu.manager.emptySection") })
|
|
@@ -775,8 +789,10 @@ function ScheduleEditor({ value, onChange, locale }) {
|
|
|
775
789
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
776
790
|
/* @__PURE__ */ jsx("label", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: t("menu.schedule.days") }),
|
|
777
791
|
/* @__PURE__ */ jsx("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: labels.map((label, day) => /* @__PURE__ */ jsx(
|
|
778
|
-
|
|
792
|
+
Button,
|
|
779
793
|
{
|
|
794
|
+
variant: "bare",
|
|
795
|
+
size: "bare",
|
|
780
796
|
type: "button",
|
|
781
797
|
onClick: () => toggleDay(day),
|
|
782
798
|
className: `rounded-full px-2.5 py-1 text-xs font-medium capitalize transition-colors ${days.includes(day) ? "bg-primary text-primary-foreground" : "bg-muted/50 text-muted-foreground hover:bg-muted"}`,
|
|
@@ -785,8 +801,10 @@ function ScheduleEditor({ value, onChange, locale }) {
|
|
|
785
801
|
day
|
|
786
802
|
)) }),
|
|
787
803
|
/* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: WEEKDAY_PRESETS.map((preset) => /* @__PURE__ */ jsx(
|
|
788
|
-
|
|
804
|
+
Button,
|
|
789
805
|
{
|
|
806
|
+
variant: "bare",
|
|
807
|
+
size: "bare",
|
|
790
808
|
type: "button",
|
|
791
809
|
onClick: () => onChange({ ...value, days: preset.days }),
|
|
792
810
|
className: "text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",
|
|
@@ -882,8 +900,10 @@ function MenuRailPage({ open, menu, locale, onClose, onSubmit }) {
|
|
|
882
900
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
883
901
|
/* @__PURE__ */ jsx("label", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: t("menu.menuDialog.channels") }),
|
|
884
902
|
/* @__PURE__ */ jsx("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: MENU_CHANNELS.map((channel) => /* @__PURE__ */ jsx(
|
|
885
|
-
|
|
903
|
+
Button,
|
|
886
904
|
{
|
|
905
|
+
variant: "bare",
|
|
906
|
+
size: "bare",
|
|
887
907
|
type: "button",
|
|
888
908
|
onClick: () => toggleChannel(channel),
|
|
889
909
|
className: `rounded-full px-3 py-1 text-xs font-medium transition-colors ${channels.includes(channel) ? "bg-primary text-primary-foreground" : "bg-muted/50 text-muted-foreground hover:bg-muted"}`,
|
|
@@ -1062,11 +1082,13 @@ function ItemRailPage({
|
|
|
1062
1082
|
}
|
|
1063
1083
|
),
|
|
1064
1084
|
values.priceOverride !== void 0 && /* @__PURE__ */ jsx(
|
|
1065
|
-
|
|
1085
|
+
Button,
|
|
1066
1086
|
{
|
|
1087
|
+
variant: "bare",
|
|
1088
|
+
size: "bare",
|
|
1067
1089
|
type: "button",
|
|
1068
1090
|
onClick: () => patch({ priceOverride: void 0 }),
|
|
1069
|
-
className: "text-[11px] text-muted-foreground underline-offset-2 transition-colors hover:text-foreground hover:underline",
|
|
1091
|
+
className: "text-[11px] text-muted-foreground underline-offset-2 transition-colors hover:text-foreground hover:underline font-normal",
|
|
1070
1092
|
children: t("menu.itemForm.clearOverride")
|
|
1071
1093
|
}
|
|
1072
1094
|
)
|
|
@@ -1074,15 +1096,10 @@ function ItemRailPage({
|
|
|
1074
1096
|
] })
|
|
1075
1097
|
] }),
|
|
1076
1098
|
/* @__PURE__ */ jsxs(Group, { title: t("menu.itemForm.menuGroup"), children: [
|
|
1077
|
-
/* @__PURE__ */ jsx(Field, { label: t("menu.itemForm.section"), children: /* @__PURE__ */
|
|
1078
|
-
"
|
|
1079
|
-
{
|
|
1080
|
-
|
|
1081
|
-
onChange: (e) => patch({ sectionId: e.target.value }),
|
|
1082
|
-
className: "h-9 w-full rounded-input border border-input bg-background px-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1083
|
-
children: sections.map((section) => /* @__PURE__ */ jsx("option", { value: section.id, children: section.name }, section.id))
|
|
1084
|
-
}
|
|
1085
|
-
) }),
|
|
1099
|
+
/* @__PURE__ */ jsx(Field, { label: t("menu.itemForm.section"), children: /* @__PURE__ */ jsxs(Select, { value: values.sectionId, onValueChange: (sectionId2) => patch({ sectionId: sectionId2 }), children: [
|
|
1100
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "px-2", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1101
|
+
/* @__PURE__ */ jsx(SelectContent, { children: sections.map((section) => /* @__PURE__ */ jsx(SelectItem, { value: section.id, children: section.name }, section.id)) })
|
|
1102
|
+
] }) }),
|
|
1086
1103
|
/* @__PURE__ */ jsx(Field, { label: t("menu.itemForm.status"), children: /* @__PURE__ */ jsx(
|
|
1087
1104
|
SegmentedControl,
|
|
1088
1105
|
{
|
|
@@ -1182,38 +1199,43 @@ function ToggleRow({ label, hint, checked, onChange }) {
|
|
|
1182
1199
|
}
|
|
1183
1200
|
);
|
|
1184
1201
|
}
|
|
1202
|
+
var INLINE_FIELD = "h-auto rounded border-border bg-card px-1.5 py-0.5 text-right tabular-nums shadow-none focus-visible:ring-offset-0";
|
|
1203
|
+
var GHOST_FIELD = "h-auto rounded border-transparent bg-transparent px-1 py-0.5 shadow-none hover:border-border focus:border-border focus-visible:ring-offset-0";
|
|
1204
|
+
var NEW_SECTION = "__new__";
|
|
1185
1205
|
function DraftRow({ item, onChange, onRemove }) {
|
|
1186
1206
|
const t = useTranslation();
|
|
1187
1207
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-dashed px-3 py-1.5 last:border-0", children: [
|
|
1188
|
-
/* @__PURE__ */ jsx(
|
|
1189
|
-
|
|
1208
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(
|
|
1209
|
+
Input,
|
|
1190
1210
|
{
|
|
1191
1211
|
value: item.name,
|
|
1192
1212
|
onChange: (e) => onChange({ name: e.target.value }),
|
|
1193
|
-
className:
|
|
1213
|
+
className: GHOST_FIELD
|
|
1194
1214
|
}
|
|
1195
|
-
),
|
|
1196
|
-
/* @__PURE__ */ jsx(
|
|
1197
|
-
|
|
1215
|
+
) }),
|
|
1216
|
+
/* @__PURE__ */ jsx("div", { className: "hidden min-w-0 flex-1 sm:block", children: /* @__PURE__ */ jsx(
|
|
1217
|
+
Input,
|
|
1198
1218
|
{
|
|
1199
1219
|
value: item.description ?? "",
|
|
1200
1220
|
onChange: (e) => onChange({ description: e.target.value }),
|
|
1201
1221
|
placeholder: t("menu.itemForm.description"),
|
|
1202
|
-
className:
|
|
1222
|
+
className: `${GHOST_FIELD} text-[11px] text-muted-foreground`
|
|
1203
1223
|
}
|
|
1204
|
-
),
|
|
1205
|
-
/* @__PURE__ */ jsx(
|
|
1206
|
-
|
|
1224
|
+
) }),
|
|
1225
|
+
/* @__PURE__ */ jsx("div", { className: "w-20", children: /* @__PURE__ */ jsx(
|
|
1226
|
+
Input,
|
|
1207
1227
|
{
|
|
1208
1228
|
value: item.price,
|
|
1209
1229
|
inputMode: "decimal",
|
|
1210
1230
|
onChange: (e) => onChange({ price: Number(e.target.value.replace(",", ".")) || 0 }),
|
|
1211
|
-
className:
|
|
1231
|
+
className: `${INLINE_FIELD} ${item.price === 0 ? "border-warning text-warning" : ""}`
|
|
1212
1232
|
}
|
|
1213
|
-
),
|
|
1233
|
+
) }),
|
|
1214
1234
|
/* @__PURE__ */ jsx(
|
|
1215
|
-
|
|
1235
|
+
Button,
|
|
1216
1236
|
{
|
|
1237
|
+
variant: "bare",
|
|
1238
|
+
size: "bare",
|
|
1217
1239
|
onClick: onRemove,
|
|
1218
1240
|
className: "rounded p-1 text-muted-foreground hover:text-destructive",
|
|
1219
1241
|
"aria-label": t("menu.import.dropItem"),
|
|
@@ -1227,33 +1249,37 @@ function DraftSectionCard({ section, sections, onPatchSection, onRemoveSection,
|
|
|
1227
1249
|
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-card border-2 border-dashed border-primary/40 bg-primary/[0.03]", children: [
|
|
1228
1250
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-dashed border-primary/30 px-3 py-2", children: [
|
|
1229
1251
|
/* @__PURE__ */ jsx(Sparkles, { className: "h-3.5 w-3.5 text-primary" }),
|
|
1230
|
-
/* @__PURE__ */ jsx(
|
|
1231
|
-
|
|
1252
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
1253
|
+
Input,
|
|
1232
1254
|
{
|
|
1233
1255
|
value: section.name,
|
|
1234
1256
|
onChange: (e) => onPatchSection({ name: e.target.value }),
|
|
1235
|
-
className:
|
|
1257
|
+
className: `${GHOST_FIELD} font-semibold`
|
|
1236
1258
|
}
|
|
1237
|
-
),
|
|
1259
|
+
) }),
|
|
1238
1260
|
/* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: t("menu.manager.itemsCount", { count: String(section.items.length) }) }),
|
|
1239
1261
|
/* @__PURE__ */ jsxs("label", { className: "ml-auto flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
1240
1262
|
t("menu.import.destination"),
|
|
1241
1263
|
/* @__PURE__ */ jsxs(
|
|
1242
|
-
|
|
1264
|
+
Select,
|
|
1243
1265
|
{
|
|
1244
|
-
value: section.targetSectionId ??
|
|
1245
|
-
|
|
1246
|
-
className: "h-7 rounded-md border bg-card px-2 text-xs text-foreground",
|
|
1266
|
+
value: section.targetSectionId ?? NEW_SECTION,
|
|
1267
|
+
onValueChange: (v) => onPatchSection({ targetSectionId: v === NEW_SECTION ? void 0 : v }),
|
|
1247
1268
|
children: [
|
|
1248
|
-
/* @__PURE__ */ jsx(
|
|
1249
|
-
|
|
1269
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-7 w-auto gap-2 rounded-md border-border bg-card px-2 py-0 text-xs text-foreground shadow-none", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1270
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
1271
|
+
/* @__PURE__ */ jsx(SelectItem, { value: NEW_SECTION, children: t("menu.import.createSection") }),
|
|
1272
|
+
sections.map((s) => /* @__PURE__ */ jsx(SelectItem, { value: s.id, children: s.name }, s.id))
|
|
1273
|
+
] })
|
|
1250
1274
|
]
|
|
1251
1275
|
}
|
|
1252
1276
|
)
|
|
1253
1277
|
] }),
|
|
1254
1278
|
/* @__PURE__ */ jsx(
|
|
1255
|
-
|
|
1279
|
+
Button,
|
|
1256
1280
|
{
|
|
1281
|
+
variant: "bare",
|
|
1282
|
+
size: "bare",
|
|
1257
1283
|
onClick: onRemoveSection,
|
|
1258
1284
|
className: "rounded p-1 text-muted-foreground hover:text-destructive",
|
|
1259
1285
|
"aria-label": t("menu.import.dropSection"),
|
|
@@ -1681,12 +1707,12 @@ function MenuManagerView() {
|
|
|
1681
1707
|
/* @__PURE__ */ jsxs("div", { className: "relative min-w-[12rem] flex-1", children: [
|
|
1682
1708
|
/* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
1683
1709
|
/* @__PURE__ */ jsx(
|
|
1684
|
-
|
|
1710
|
+
Input,
|
|
1685
1711
|
{
|
|
1686
1712
|
value: search,
|
|
1687
1713
|
onChange: (e) => setSearch(e.target.value),
|
|
1688
1714
|
placeholder: t("menu.manager.search"),
|
|
1689
|
-
className: "
|
|
1715
|
+
className: "h-auto border-border py-1.5 pl-8 pr-3 shadow-none focus-visible:ring-offset-0"
|
|
1690
1716
|
}
|
|
1691
1717
|
)
|
|
1692
1718
|
] }),
|
|
@@ -1834,5 +1860,5 @@ function MenuPage({ config, provider, store, registries }) {
|
|
|
1834
1860
|
}
|
|
1835
1861
|
|
|
1836
1862
|
export { MenuPage };
|
|
1837
|
-
//# sourceMappingURL=MenuPage-
|
|
1838
|
-
//# sourceMappingURL=MenuPage-
|
|
1863
|
+
//# sourceMappingURL=MenuPage-7WXTOSQK.js.map
|
|
1864
|
+
//# sourceMappingURL=MenuPage-7WXTOSQK.js.map
|