myoperator-mcp 0.2.377 → 0.2.379
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.js +158 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8518,6 +8518,49 @@ function PaginationEllipsis({
|
|
|
8518
8518
|
}
|
|
8519
8519
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
8520
8520
|
|
|
8521
|
+
export interface PaginationInfoProps extends React.ComponentProps<"p"> {
|
|
8522
|
+
/** Current page (1-based) */
|
|
8523
|
+
currentPage: number;
|
|
8524
|
+
/** Number of items shown per page */
|
|
8525
|
+
pageSize: number;
|
|
8526
|
+
/** Total number of items across all pages */
|
|
8527
|
+
totalItems: number;
|
|
8528
|
+
/** Leading label before the range (default: "Showing") */
|
|
8529
|
+
label?: string;
|
|
8530
|
+
/** Additional CSS classes */
|
|
8531
|
+
className?: string;
|
|
8532
|
+
}
|
|
8533
|
+
|
|
8534
|
+
function PaginationInfo({
|
|
8535
|
+
currentPage,
|
|
8536
|
+
pageSize,
|
|
8537
|
+
totalItems,
|
|
8538
|
+
label = "Showing",
|
|
8539
|
+
className,
|
|
8540
|
+
...props
|
|
8541
|
+
}: PaginationInfoProps) {
|
|
8542
|
+
const startItem = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
8543
|
+
const endItem = Math.min(currentPage * pageSize, totalItems);
|
|
8544
|
+
|
|
8545
|
+
return (
|
|
8546
|
+
<p
|
|
8547
|
+
data-slot="pagination-info"
|
|
8548
|
+
aria-live="polite"
|
|
8549
|
+
className={cn(
|
|
8550
|
+
"m-0 text-sm text-semantic-text-muted whitespace-nowrap",
|
|
8551
|
+
className
|
|
8552
|
+
)}
|
|
8553
|
+
{...props}
|
|
8554
|
+
>
|
|
8555
|
+
{label}{" "}
|
|
8556
|
+
<span className="font-medium text-semantic-text-primary">
|
|
8557
|
+
{startItem}\u2013{endItem} of {totalItems}
|
|
8558
|
+
</span>
|
|
8559
|
+
</p>
|
|
8560
|
+
);
|
|
8561
|
+
}
|
|
8562
|
+
PaginationInfo.displayName = "PaginationInfo";
|
|
8563
|
+
|
|
8521
8564
|
export interface PaginationWidgetProps {
|
|
8522
8565
|
/** Current page (1-based) */
|
|
8523
8566
|
currentPage: number;
|
|
@@ -8527,7 +8570,13 @@ export interface PaginationWidgetProps {
|
|
|
8527
8570
|
onPageChange: (page: number) => void;
|
|
8528
8571
|
/** Number of pages shown on each side of current page (default: 1) */
|
|
8529
8572
|
siblingCount?: number;
|
|
8530
|
-
/**
|
|
8573
|
+
/** Total number of items \u2014 required to render the "Showing X-Y of Z" summary */
|
|
8574
|
+
totalItems?: number;
|
|
8575
|
+
/** Items per page \u2014 required to render the "Showing X-Y of Z" summary */
|
|
8576
|
+
pageSize?: number;
|
|
8577
|
+
/** Horizontal placement of the page controls (default: "center", or "end" when the summary is shown) */
|
|
8578
|
+
align?: "start" | "center" | "end";
|
|
8579
|
+
/** Additional CSS classes for the outer wrapper */
|
|
8531
8580
|
className?: string;
|
|
8532
8581
|
}
|
|
8533
8582
|
|
|
@@ -8569,17 +8618,35 @@ function usePaginationRange(
|
|
|
8569
8618
|
return pages;
|
|
8570
8619
|
}
|
|
8571
8620
|
|
|
8621
|
+
const paginationAlignClasses = {
|
|
8622
|
+
start: "justify-start",
|
|
8623
|
+
center: "justify-center",
|
|
8624
|
+
end: "justify-end",
|
|
8625
|
+
} as const;
|
|
8626
|
+
|
|
8572
8627
|
function PaginationWidget({
|
|
8573
8628
|
currentPage,
|
|
8574
8629
|
totalPages,
|
|
8575
8630
|
onPageChange,
|
|
8576
8631
|
siblingCount = 1,
|
|
8632
|
+
totalItems,
|
|
8633
|
+
pageSize,
|
|
8634
|
+
align,
|
|
8577
8635
|
className,
|
|
8578
8636
|
}: PaginationWidgetProps) {
|
|
8579
8637
|
const pages = usePaginationRange(currentPage, totalPages, siblingCount);
|
|
8638
|
+
const showInfo = totalItems !== undefined && pageSize !== undefined;
|
|
8639
|
+
const resolvedAlign = align ?? (showInfo ? "end" : "center");
|
|
8580
8640
|
|
|
8581
|
-
|
|
8582
|
-
<Pagination
|
|
8641
|
+
const controls = (
|
|
8642
|
+
<Pagination
|
|
8643
|
+
className={cn(
|
|
8644
|
+
"mx-0 w-auto",
|
|
8645
|
+
paginationAlignClasses[resolvedAlign],
|
|
8646
|
+
!showInfo && "w-full",
|
|
8647
|
+
!showInfo && className
|
|
8648
|
+
)}
|
|
8649
|
+
>
|
|
8583
8650
|
<PaginationContent>
|
|
8584
8651
|
<PaginationItem>
|
|
8585
8652
|
<PaginationPrevious
|
|
@@ -8624,6 +8691,25 @@ function PaginationWidget({
|
|
|
8624
8691
|
</PaginationContent>
|
|
8625
8692
|
</Pagination>
|
|
8626
8693
|
);
|
|
8694
|
+
|
|
8695
|
+
if (!showInfo) return controls;
|
|
8696
|
+
|
|
8697
|
+
return (
|
|
8698
|
+
<div
|
|
8699
|
+
data-slot="pagination-widget"
|
|
8700
|
+
className={cn(
|
|
8701
|
+
"flex w-full flex-col items-start gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
8702
|
+
className
|
|
8703
|
+
)}
|
|
8704
|
+
>
|
|
8705
|
+
<PaginationInfo
|
|
8706
|
+
currentPage={currentPage}
|
|
8707
|
+
pageSize={pageSize}
|
|
8708
|
+
totalItems={totalItems}
|
|
8709
|
+
/>
|
|
8710
|
+
{controls}
|
|
8711
|
+
</div>
|
|
8712
|
+
);
|
|
8627
8713
|
}
|
|
8628
8714
|
PaginationWidget.displayName = "PaginationWidget";
|
|
8629
8715
|
|
|
@@ -8635,6 +8721,7 @@ export {
|
|
|
8635
8721
|
PaginationPrevious,
|
|
8636
8722
|
PaginationNext,
|
|
8637
8723
|
PaginationEllipsis,
|
|
8724
|
+
PaginationInfo,
|
|
8638
8725
|
PaginationWidget,
|
|
8639
8726
|
};
|
|
8640
8727
|
`,
|
|
@@ -10466,6 +10553,15 @@ const Select = SelectPrimitive.Root;
|
|
|
10466
10553
|
|
|
10467
10554
|
const SelectGroup = SelectPrimitive.Group;
|
|
10468
10555
|
|
|
10556
|
+
/**
|
|
10557
|
+
* Lets \`SelectContent\` set the long-label behaviour once for every
|
|
10558
|
+
* \`SelectItem\` it renders, so callers don't repeat the flag per item.
|
|
10559
|
+
* Items may still override it individually.
|
|
10560
|
+
*/
|
|
10561
|
+
const SelectItemLayoutContext = React.createContext<{
|
|
10562
|
+
truncateOptionText: boolean;
|
|
10563
|
+
}>({ truncateOptionText: false });
|
|
10564
|
+
|
|
10469
10565
|
const SelectValue = React.forwardRef(({ className, ...props }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Value>>) => (
|
|
10470
10566
|
<SelectPrimitive.Value
|
|
10471
10567
|
ref={ref}
|
|
@@ -10583,6 +10679,13 @@ export type SelectContentProps = React.ComponentPropsWithoutRef<
|
|
|
10583
10679
|
*/
|
|
10584
10680
|
onViewportScrollEnd?: (event: React.UIEvent<HTMLDivElement>) => void;
|
|
10585
10681
|
hideScrollButtons?: boolean;
|
|
10682
|
+
/**
|
|
10683
|
+
* Clip long option labels to a single line with an ellipsis instead of
|
|
10684
|
+
* wrapping them. Applies to every \`SelectItem\` inside this content;
|
|
10685
|
+
* individual items can override it with their own \`truncateOptionText\`.
|
|
10686
|
+
* The trigger value always truncates, regardless of this flag.
|
|
10687
|
+
*/
|
|
10688
|
+
truncateOptionText?: boolean;
|
|
10586
10689
|
};
|
|
10587
10690
|
|
|
10588
10691
|
const BOTTOM_THRESHOLD_PX = 24;
|
|
@@ -10596,6 +10699,7 @@ const SelectContent = React.forwardRef(
|
|
|
10596
10699
|
position = "popper",
|
|
10597
10700
|
onViewportScrollEnd,
|
|
10598
10701
|
hideScrollButtons,
|
|
10702
|
+
truncateOptionText = false,
|
|
10599
10703
|
...props
|
|
10600
10704
|
}: SelectContentProps,
|
|
10601
10705
|
ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Content>>
|
|
@@ -10651,6 +10755,11 @@ const SelectContent = React.forwardRef(
|
|
|
10651
10755
|
};
|
|
10652
10756
|
}, [viewport, onViewportScrollEnd]);
|
|
10653
10757
|
|
|
10758
|
+
const itemLayout = React.useMemo(
|
|
10759
|
+
() => ({ truncateOptionText }),
|
|
10760
|
+
[truncateOptionText]
|
|
10761
|
+
);
|
|
10762
|
+
|
|
10654
10763
|
return (
|
|
10655
10764
|
<SelectPrimitive.Portal>
|
|
10656
10765
|
<SelectPrimitive.Content
|
|
@@ -10679,7 +10788,9 @@ const SelectContent = React.forwardRef(
|
|
|
10679
10788
|
"h-[var(--radix-select-trigger-height)] w-full"
|
|
10680
10789
|
)}
|
|
10681
10790
|
>
|
|
10682
|
-
{
|
|
10791
|
+
<SelectItemLayoutContext.Provider value={itemLayout}>
|
|
10792
|
+
{children}
|
|
10793
|
+
</SelectItemLayoutContext.Provider>
|
|
10683
10794
|
</SelectPrimitive.Viewport>
|
|
10684
10795
|
{!hideScrollButtons && <SelectScrollDownButton />}
|
|
10685
10796
|
</SelectPrimitive.Content>
|
|
@@ -10701,29 +10812,49 @@ const SelectLabel = React.forwardRef(({ className, ...props }: React.ComponentPr
|
|
|
10701
10812
|
));
|
|
10702
10813
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
10703
10814
|
|
|
10704
|
-
|
|
10705
|
-
<SelectPrimitive.Item
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10815
|
+
export interface SelectItemProps
|
|
10816
|
+
extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
10817
|
+
/**
|
|
10818
|
+
* Clip this option's label to a single line with an ellipsis instead of
|
|
10819
|
+
* wrapping it. Defaults to the value set on \`SelectContent\` (wrapped).
|
|
10820
|
+
*/
|
|
10821
|
+
truncateOptionText?: boolean;
|
|
10822
|
+
}
|
|
10823
|
+
|
|
10824
|
+
const SelectItem = React.forwardRef(({ className, children, truncateOptionText, ...props }: SelectItemProps, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Item>>) => {
|
|
10825
|
+
const layout = React.useContext(SelectItemLayoutContext);
|
|
10826
|
+
const truncate = truncateOptionText ?? layout.truncateOptionText;
|
|
10827
|
+
|
|
10828
|
+
return (
|
|
10829
|
+
<SelectPrimitive.Item
|
|
10830
|
+
ref={ref}
|
|
10831
|
+
className={cn(
|
|
10832
|
+
"relative flex w-full cursor-pointer select-none items-start rounded-sm py-2 pl-4 pr-8 text-base text-semantic-text-primary outline-none",
|
|
10833
|
+
"hover:bg-semantic-bg-ui focus:bg-semantic-bg-ui",
|
|
10834
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
10835
|
+
className
|
|
10836
|
+
)}
|
|
10837
|
+
{...props}
|
|
10838
|
+
>
|
|
10839
|
+
<span className="absolute right-2 flex size-4 items-center justify-center">
|
|
10840
|
+
<SelectPrimitive.ItemIndicator>
|
|
10841
|
+
<Check className="size-4 text-semantic-brand" />
|
|
10842
|
+
</SelectPrimitive.ItemIndicator>
|
|
10843
|
+
</span>
|
|
10844
|
+
<span
|
|
10845
|
+
title={truncate && typeof children === "string" ? children : undefined}
|
|
10846
|
+
className={cn(
|
|
10847
|
+
"min-w-0 flex-1 leading-normal",
|
|
10848
|
+
truncate ? "truncate" : "whitespace-normal break-words"
|
|
10849
|
+
)}
|
|
10850
|
+
>
|
|
10851
|
+
<SelectPrimitive.ItemText>
|
|
10852
|
+
{children}
|
|
10853
|
+
</SelectPrimitive.ItemText>
|
|
10854
|
+
</span>
|
|
10855
|
+
</SelectPrimitive.Item>
|
|
10856
|
+
);
|
|
10857
|
+
});
|
|
10727
10858
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
10728
10859
|
|
|
10729
10860
|
const SelectSeparator = React.forwardRef(({ className, ...props }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Separator>>) => (
|
package/package.json
CHANGED