myoperator-mcp 0.2.389 → 0.2.391
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 +102 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3595,7 +3595,8 @@ const dateTimePickerTriggerVariants = cva(
|
|
|
3595
3595
|
},
|
|
3596
3596
|
state: {
|
|
3597
3597
|
default: "",
|
|
3598
|
-
error:
|
|
3598
|
+
error:
|
|
3599
|
+
"border-[var(--semantic-error-primary,#F04438)] hover:border-[var(--semantic-error-primary,#F04438)]",
|
|
3599
3600
|
},
|
|
3600
3601
|
},
|
|
3601
3602
|
defaultVariants: {
|
|
@@ -3650,6 +3651,20 @@ export interface DateTimePickerProps
|
|
|
3650
3651
|
defaultOpen?: boolean;
|
|
3651
3652
|
onOpenChange?: (open: boolean) => void;
|
|
3652
3653
|
portalContainer?: HTMLElement | null;
|
|
3654
|
+
/** Shows a footer with Clear, Cancel and OK actions */
|
|
3655
|
+
showActions?: boolean;
|
|
3656
|
+
/** Label for the OK action */
|
|
3657
|
+
okLabel?: string;
|
|
3658
|
+
/** Label for the Cancel action */
|
|
3659
|
+
cancelLabel?: string;
|
|
3660
|
+
/** Label for the extra (left-aligned) action. Defaults to "Clear" */
|
|
3661
|
+
extraActionLabel?: string;
|
|
3662
|
+
/** Overrides the extra action. Defaults to clearing the value */
|
|
3663
|
+
onExtraAction?: () => void;
|
|
3664
|
+
/** Called when OK is pressed, with the confirmed value */
|
|
3665
|
+
onOk?: (value: DateTimePickerValue) => void;
|
|
3666
|
+
/** Called when Cancel is pressed, after the value is restored */
|
|
3667
|
+
onCancel?: () => void;
|
|
3653
3668
|
}
|
|
3654
3669
|
|
|
3655
3670
|
type DateTimePickerVariant = NonNullable<
|
|
@@ -4958,6 +4973,13 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
4958
4973
|
defaultOpen = false,
|
|
4959
4974
|
onOpenChange,
|
|
4960
4975
|
portalContainer,
|
|
4976
|
+
showActions = false,
|
|
4977
|
+
okLabel = "OK",
|
|
4978
|
+
cancelLabel = "Cancel",
|
|
4979
|
+
extraActionLabel = "Clear",
|
|
4980
|
+
onExtraAction,
|
|
4981
|
+
onOk,
|
|
4982
|
+
onCancel,
|
|
4961
4983
|
id,
|
|
4962
4984
|
...props
|
|
4963
4985
|
},
|
|
@@ -5081,8 +5103,8 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5081
5103
|
);
|
|
5082
5104
|
const hasValue = Boolean(
|
|
5083
5105
|
currentValue.date ||
|
|
5084
|
-
|
|
5085
|
-
|
|
5106
|
+
currentValue.startTime ||
|
|
5107
|
+
(resolvedShowEndTime && currentValue.endTime)
|
|
5086
5108
|
);
|
|
5087
5109
|
const effectiveMinDate = React.useMemo(() => {
|
|
5088
5110
|
if (!disablePastDates) return minDate;
|
|
@@ -5182,6 +5204,34 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5182
5204
|
[isValueControlled, onValueChange]
|
|
5183
5205
|
);
|
|
5184
5206
|
|
|
5207
|
+
// Value at the moment the popover opened, so Cancel can restore it.
|
|
5208
|
+
const openSnapshotRef = React.useRef<DateTimePickerValue | null>(null);
|
|
5209
|
+
React.useEffect(() => {
|
|
5210
|
+
openSnapshotRef.current = open ? currentValue : null;
|
|
5211
|
+
// Only re-snapshot when the popover opens, not on every value change.
|
|
5212
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5213
|
+
}, [open]);
|
|
5214
|
+
|
|
5215
|
+
const handleCancel = () => {
|
|
5216
|
+
const snapshot = openSnapshotRef.current;
|
|
5217
|
+
if (snapshot) updateValue(snapshot);
|
|
5218
|
+
setOpen(false);
|
|
5219
|
+
onCancel?.();
|
|
5220
|
+
};
|
|
5221
|
+
|
|
5222
|
+
const handleOk = () => {
|
|
5223
|
+
setOpen(false);
|
|
5224
|
+
onOk?.(currentValue);
|
|
5225
|
+
};
|
|
5226
|
+
|
|
5227
|
+
const handleExtraAction = (event: React.MouseEvent<HTMLElement>) => {
|
|
5228
|
+
if (onExtraAction) {
|
|
5229
|
+
onExtraAction();
|
|
5230
|
+
return;
|
|
5231
|
+
}
|
|
5232
|
+
clearValue(event);
|
|
5233
|
+
};
|
|
5234
|
+
|
|
5185
5235
|
const clearValue = (event: React.MouseEvent<HTMLElement>) => {
|
|
5186
5236
|
event.stopPropagation();
|
|
5187
5237
|
if (readOnly) return;
|
|
@@ -5661,6 +5711,33 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5661
5711
|
</div>
|
|
5662
5712
|
)}
|
|
5663
5713
|
|
|
5714
|
+
{showActions && (
|
|
5715
|
+
<div className="flex items-center justify-between gap-2 border-t border-solid border-[var(--semantic-border-layout,#E9EAEB)] px-3 py-2">
|
|
5716
|
+
<button
|
|
5717
|
+
type="button"
|
|
5718
|
+
className="rounded px-2 py-1.5 text-sm font-semibold text-[var(--semantic-text-muted,#717680)] transition-colors hover:bg-[var(--semantic-bg-ui,#F5F5F5)] hover:text-[var(--semantic-text-primary,#181D27)]"
|
|
5719
|
+
onClick={handleExtraAction}
|
|
5720
|
+
>
|
|
5721
|
+
{extraActionLabel}
|
|
5722
|
+
</button>
|
|
5723
|
+
<div className="flex items-center gap-2">
|
|
5724
|
+
<button
|
|
5725
|
+
type="button"
|
|
5726
|
+
className="rounded px-2 py-1.5 text-sm font-semibold text-[var(--semantic-text-link,#4275D6)] transition-colors hover:bg-[var(--semantic-bg-ui,#F5F5F5)]"
|
|
5727
|
+
onClick={handleCancel}
|
|
5728
|
+
>
|
|
5729
|
+
{cancelLabel}
|
|
5730
|
+
</button>
|
|
5731
|
+
<button
|
|
5732
|
+
type="button"
|
|
5733
|
+
className="rounded px-2 py-1.5 text-sm font-semibold text-[var(--semantic-text-link,#4275D6)] transition-colors hover:bg-[var(--semantic-bg-ui,#F5F5F5)]"
|
|
5734
|
+
onClick={handleOk}
|
|
5735
|
+
>
|
|
5736
|
+
{okLabel}
|
|
5737
|
+
</button>
|
|
5738
|
+
</div>
|
|
5739
|
+
</div>
|
|
5740
|
+
)}
|
|
5664
5741
|
</div>,
|
|
5665
5742
|
portalMount
|
|
5666
5743
|
);
|
|
@@ -5701,7 +5778,9 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5701
5778
|
>
|
|
5702
5779
|
{label}
|
|
5703
5780
|
{required && (
|
|
5704
|
-
<span className="text-[var(--semantic-error-primary,#F04438)] ml-0.5"
|
|
5781
|
+
<span className="text-[var(--semantic-error-primary,#F04438)] ml-0.5">
|
|
5782
|
+
*
|
|
5783
|
+
</span>
|
|
5705
5784
|
)}
|
|
5706
5785
|
</label>
|
|
5707
5786
|
)}
|
|
@@ -10392,6 +10471,14 @@ export interface SelectFieldProps {
|
|
|
10392
10471
|
* presentation only.
|
|
10393
10472
|
*/
|
|
10394
10473
|
truncateOptionText?: boolean;
|
|
10474
|
+
/**
|
|
10475
|
+
* Content shown inside the open dropdown when \`options\` is empty (and no
|
|
10476
|
+
* search query is active \u2014 that case shows "No results found"). Use it to
|
|
10477
|
+
* tell the user why the list is empty and what to do next, e.g.
|
|
10478
|
+
* "No AI Agents yet. Build one in AI Agents first."
|
|
10479
|
+
* Default: "No options available".
|
|
10480
|
+
*/
|
|
10481
|
+
emptyMessage?: React.ReactNode;
|
|
10395
10482
|
}
|
|
10396
10483
|
|
|
10397
10484
|
/**
|
|
@@ -10470,6 +10557,7 @@ const SelectField = React.forwardRef(
|
|
|
10470
10557
|
loadingMore,
|
|
10471
10558
|
hasMore,
|
|
10472
10559
|
truncateOptionText,
|
|
10560
|
+
emptyMessage = "No options available",
|
|
10473
10561
|
}: SelectFieldProps,
|
|
10474
10562
|
ref: React.Ref<HTMLButtonElement>
|
|
10475
10563
|
) => {
|
|
@@ -10752,6 +10840,16 @@ const SelectField = React.forwardRef(
|
|
|
10752
10840
|
</div>
|
|
10753
10841
|
)}
|
|
10754
10842
|
|
|
10843
|
+
{/* Empty state \u2014 no options at all and nothing being searched/loaded. */}
|
|
10844
|
+
{options.length === 0 && !effectiveSearchQuery && !loadingMore && (
|
|
10845
|
+
<div
|
|
10846
|
+
role="status"
|
|
10847
|
+
className="px-3 py-6 text-center text-sm text-semantic-text-muted"
|
|
10848
|
+
>
|
|
10849
|
+
{emptyMessage}
|
|
10850
|
+
</div>
|
|
10851
|
+
)}
|
|
10852
|
+
|
|
10755
10853
|
{/* Loading-more row (lazy-load) */}
|
|
10756
10854
|
{loadingMore && (
|
|
10757
10855
|
<div
|
package/package.json
CHANGED