myoperator-mcp 0.2.378 → 0.2.380

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.
Files changed (2) hide show
  1. package/dist/index.js +78 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10115,6 +10115,14 @@ export interface SelectFieldProps {
10115
10115
  * an "End of list" footer row. Default true (keep firing).
10116
10116
  */
10117
10117
  hasMore?: boolean;
10118
+ /**
10119
+ * Clip long option labels in the dropdown to a single line with an ellipsis
10120
+ * instead of wrapping them across lines. Default false (wrapped). The
10121
+ * selected value in the trigger always truncates, and the value reported to
10122
+ * \`onValueChange\` / \`onSelect\` is always the full string \u2014 truncation is
10123
+ * presentation only.
10124
+ */
10125
+ truncateOptionText?: boolean;
10118
10126
  }
10119
10127
 
10120
10128
  /**
@@ -10192,6 +10200,7 @@ const SelectField = React.forwardRef(
10192
10200
  onScrollEnd,
10193
10201
  loadingMore,
10194
10202
  hasMore,
10203
+ truncateOptionText,
10195
10204
  }: SelectFieldProps,
10196
10205
  ref: React.Ref<HTMLButtonElement>
10197
10206
  ) => {
@@ -10383,6 +10392,7 @@ const SelectField = React.forwardRef(
10383
10392
  <SelectContent
10384
10393
  onViewportScrollEnd={hasMore !== false ? onScrollEnd : undefined}
10385
10394
  hideScrollButtons={totalRendered === 0}
10395
+ truncateOptionText={truncateOptionText}
10386
10396
  className={contentClassName}
10387
10397
  >
10388
10398
  {/* Search input */}
@@ -10553,6 +10563,15 @@ const Select = SelectPrimitive.Root;
10553
10563
 
10554
10564
  const SelectGroup = SelectPrimitive.Group;
10555
10565
 
10566
+ /**
10567
+ * Lets \`SelectContent\` set the long-label behaviour once for every
10568
+ * \`SelectItem\` it renders, so callers don't repeat the flag per item.
10569
+ * Items may still override it individually.
10570
+ */
10571
+ const SelectItemLayoutContext = React.createContext<{
10572
+ truncateOptionText: boolean;
10573
+ }>({ truncateOptionText: false });
10574
+
10556
10575
  const SelectValue = React.forwardRef(({ className, ...props }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Value>>) => (
10557
10576
  <SelectPrimitive.Value
10558
10577
  ref={ref}
@@ -10670,6 +10689,13 @@ export type SelectContentProps = React.ComponentPropsWithoutRef<
10670
10689
  */
10671
10690
  onViewportScrollEnd?: (event: React.UIEvent<HTMLDivElement>) => void;
10672
10691
  hideScrollButtons?: boolean;
10692
+ /**
10693
+ * Clip long option labels to a single line with an ellipsis instead of
10694
+ * wrapping them. Applies to every \`SelectItem\` inside this content;
10695
+ * individual items can override it with their own \`truncateOptionText\`.
10696
+ * The trigger value always truncates, regardless of this flag.
10697
+ */
10698
+ truncateOptionText?: boolean;
10673
10699
  };
10674
10700
 
10675
10701
  const BOTTOM_THRESHOLD_PX = 24;
@@ -10683,6 +10709,7 @@ const SelectContent = React.forwardRef(
10683
10709
  position = "popper",
10684
10710
  onViewportScrollEnd,
10685
10711
  hideScrollButtons,
10712
+ truncateOptionText = false,
10686
10713
  ...props
10687
10714
  }: SelectContentProps,
10688
10715
  ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Content>>
@@ -10738,6 +10765,11 @@ const SelectContent = React.forwardRef(
10738
10765
  };
10739
10766
  }, [viewport, onViewportScrollEnd]);
10740
10767
 
10768
+ const itemLayout = React.useMemo(
10769
+ () => ({ truncateOptionText }),
10770
+ [truncateOptionText]
10771
+ );
10772
+
10741
10773
  return (
10742
10774
  <SelectPrimitive.Portal>
10743
10775
  <SelectPrimitive.Content
@@ -10766,7 +10798,9 @@ const SelectContent = React.forwardRef(
10766
10798
  "h-[var(--radix-select-trigger-height)] w-full"
10767
10799
  )}
10768
10800
  >
10769
- {children}
10801
+ <SelectItemLayoutContext.Provider value={itemLayout}>
10802
+ {children}
10803
+ </SelectItemLayoutContext.Provider>
10770
10804
  </SelectPrimitive.Viewport>
10771
10805
  {!hideScrollButtons && <SelectScrollDownButton />}
10772
10806
  </SelectPrimitive.Content>
@@ -10788,29 +10822,49 @@ const SelectLabel = React.forwardRef(({ className, ...props }: React.ComponentPr
10788
10822
  ));
10789
10823
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
10790
10824
 
10791
- const SelectItem = React.forwardRef(({ className, children, ...props }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Item>>) => (
10792
- <SelectPrimitive.Item
10793
- ref={ref}
10794
- className={cn(
10795
- "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",
10796
- "hover:bg-semantic-bg-ui focus:bg-semantic-bg-ui",
10797
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
10798
- className
10799
- )}
10800
- {...props}
10801
- >
10802
- <span className="absolute right-2 flex size-4 items-center justify-center">
10803
- <SelectPrimitive.ItemIndicator>
10804
- <Check className="size-4 text-semantic-brand" />
10805
- </SelectPrimitive.ItemIndicator>
10806
- </span>
10807
- <span className="min-w-0 flex-1 whitespace-normal break-words leading-normal">
10808
- <SelectPrimitive.ItemText>
10809
- {children}
10810
- </SelectPrimitive.ItemText>
10811
- </span>
10812
- </SelectPrimitive.Item>
10813
- ));
10825
+ export interface SelectItemProps
10826
+ extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
10827
+ /**
10828
+ * Clip this option's label to a single line with an ellipsis instead of
10829
+ * wrapping it. Defaults to the value set on \`SelectContent\` (wrapped).
10830
+ */
10831
+ truncateOptionText?: boolean;
10832
+ }
10833
+
10834
+ const SelectItem = React.forwardRef(({ className, children, truncateOptionText, ...props }: SelectItemProps, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Item>>) => {
10835
+ const layout = React.useContext(SelectItemLayoutContext);
10836
+ const truncate = truncateOptionText ?? layout.truncateOptionText;
10837
+
10838
+ return (
10839
+ <SelectPrimitive.Item
10840
+ ref={ref}
10841
+ className={cn(
10842
+ "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",
10843
+ "hover:bg-semantic-bg-ui focus:bg-semantic-bg-ui",
10844
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
10845
+ className
10846
+ )}
10847
+ {...props}
10848
+ >
10849
+ <span className="absolute right-2 flex size-4 items-center justify-center">
10850
+ <SelectPrimitive.ItemIndicator>
10851
+ <Check className="size-4 text-semantic-brand" />
10852
+ </SelectPrimitive.ItemIndicator>
10853
+ </span>
10854
+ <span
10855
+ title={truncate && typeof children === "string" ? children : undefined}
10856
+ className={cn(
10857
+ "min-w-0 flex-1 leading-normal",
10858
+ truncate ? "truncate" : "whitespace-normal break-words"
10859
+ )}
10860
+ >
10861
+ <SelectPrimitive.ItemText>
10862
+ {children}
10863
+ </SelectPrimitive.ItemText>
10864
+ </span>
10865
+ </SelectPrimitive.Item>
10866
+ );
10867
+ });
10814
10868
  SelectItem.displayName = SelectPrimitive.Item.displayName;
10815
10869
 
10816
10870
  const SelectSeparator = React.forwardRef(({ className, ...props }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>, ref: React.Ref<React.ElementRef<typeof SelectPrimitive.Separator>>) => (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.378",
3
+ "version": "0.2.380",
4
4
  "description": "MCP server for myOperator UI components - enables AI assistants to access component metadata, examples, and design tokens",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",