myoperator-mcp 0.2.91 → 0.2.92

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 +18 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3209,6 +3209,14 @@ export interface SelectFieldProps {
3209
3209
  onValueChange?: (value: string) => void;
3210
3210
  /** Callback when an option is selected, provides the full option object */
3211
3211
  onSelect?: (option: SelectOption) => void;
3212
+ /**
3213
+ * Intercept a value change before it commits. Return \`false\` to prevent
3214
+ * \`onValueChange\` from firing (only \`onSelect\` will fire). Useful for
3215
+ * "action" items like "Add custom date" that should open a modal instead
3216
+ * of committing a value. Requires controlled mode (\`value\` prop) to
3217
+ * visually revert the selection.
3218
+ */
3219
+ interceptValue?: (value: string) => boolean;
3212
3220
  /** Options to display */
3213
3221
  options: SelectOption[];
3214
3222
  /** Enable search/filter functionality */
@@ -3258,6 +3266,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
3258
3266
  defaultValue,
3259
3267
  onValueChange,
3260
3268
  onSelect,
3269
+ interceptValue,
3261
3270
  options,
3262
3271
  searchable,
3263
3272
  searchPlaceholder = "Search...",
@@ -3272,10 +3281,16 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
3272
3281
  // Internal state for search
3273
3282
  const [searchQuery, setSearchQuery] = React.useState("");
3274
3283
 
3275
- // Combined value change handler that also fires onSelect with full option object
3284
+ // Combined value change handler that also fires onSelect with full option object.
3285
+ // When interceptValue returns false, onValueChange is skipped (only onSelect fires).
3276
3286
  const handleValueChange = React.useCallback(
3277
3287
  (newValue: string) => {
3278
- onValueChange?.(newValue);
3288
+ const intercepted = interceptValue?.(newValue) === false;
3289
+
3290
+ if (!intercepted) {
3291
+ onValueChange?.(newValue);
3292
+ }
3293
+
3279
3294
  if (onSelect) {
3280
3295
  const option = options.find((o) => o.value === newValue);
3281
3296
  if (option) {
@@ -3283,7 +3298,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
3283
3298
  }
3284
3299
  }
3285
3300
  },
3286
- [onValueChange, onSelect, options]
3301
+ [onValueChange, onSelect, interceptValue, options]
3287
3302
  );
3288
3303
 
3289
3304
  // Derive state from props
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.91",
3
+ "version": "0.2.92",
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",