myoperator-mcp 0.2.258 → 0.2.260
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 -168
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -815,13 +815,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
815
815
|
import { cn } from "@/lib/utils";
|
|
816
816
|
|
|
817
817
|
const DOT_KEYS = [0, 1, 2] as const;
|
|
818
|
-
|
|
819
|
-
/** Delays (seconds) for \`type="staggered"\` \u2014 matches the common 0.1s / 0.3s / 0.6s pattern. */
|
|
820
|
-
const STAGGERED_BOUNCE_DELAYS_SEC = [0.1, 0.3, 0.6] as const;
|
|
821
|
-
|
|
822
|
-
export type BouncingLoaderType = "default" | "staggered";
|
|
823
|
-
|
|
824
|
-
export type BouncingLoaderFrame = "none" | "pill";
|
|
818
|
+
const DOT_DELAYS_SEC = [0, 0.2, 0.4] as const;
|
|
825
819
|
|
|
826
820
|
function toCssLength(value: number | string, unit: string): string {
|
|
827
821
|
if (typeof value === "string") {
|
|
@@ -831,34 +825,12 @@ function toCssLength(value: number | string, unit: string): string {
|
|
|
831
825
|
}
|
|
832
826
|
|
|
833
827
|
const bouncingLoaderVariants = cva(
|
|
834
|
-
"bouncing-loader min-w-0 items-center justify-center leading-[0] align-middle gap-[var(--bouncing-loader-spacing,0.375rem)]"
|
|
835
|
-
{
|
|
836
|
-
variants: {
|
|
837
|
-
fullWidth: {
|
|
838
|
-
true: "bouncing-loader--full-width flex w-full",
|
|
839
|
-
false: "inline-flex shrink-0",
|
|
840
|
-
},
|
|
841
|
-
},
|
|
842
|
-
defaultVariants: {
|
|
843
|
-
fullWidth: false,
|
|
844
|
-
},
|
|
845
|
-
}
|
|
828
|
+
"bouncing-loader inline-flex shrink-0 min-w-0 items-center justify-center leading-[0] align-middle gap-[var(--bouncing-loader-spacing,0.375rem)]"
|
|
846
829
|
);
|
|
847
830
|
|
|
848
831
|
export interface BouncingLoaderProps
|
|
849
|
-
extends
|
|
832
|
+
extends React.HTMLAttributes<HTMLSpanElement>,
|
|
850
833
|
VariantProps<typeof bouncingLoaderVariants> {
|
|
851
|
-
/**
|
|
852
|
-
* \`default\` \u2014 \`effect\` controls the animation.
|
|
853
|
-
* \`staggered\` \u2014 Tailwind \`animate-bounce\` with **0.5s** duration and per-dot delays
|
|
854
|
-
* **0.1s / 0.3s / 0.6s** (overrides \`effect\` for the animation). Sensible defaults: 20px dots,
|
|
855
|
-
* 12px gap, \`var(--color-neutral-800)\` (override with \`size\` / \`spacing\` / \`color\`).
|
|
856
|
-
*/
|
|
857
|
-
type?: BouncingLoaderType;
|
|
858
|
-
/**
|
|
859
|
-
* \`pill\` \u2014 white rounded container with padding (like \`bg-white p-5 rounded-full\` around the row).
|
|
860
|
-
*/
|
|
861
|
-
frame?: BouncingLoaderFrame;
|
|
862
834
|
/**
|
|
863
835
|
* Dot diameter. Number is treated as pixels; string is used as a CSS length
|
|
864
836
|
* (e.g. \`"0.5rem"\`, \`"12px"\`).
|
|
@@ -866,144 +838,45 @@ export interface BouncingLoaderProps
|
|
|
866
838
|
size?: number | string;
|
|
867
839
|
/**
|
|
868
840
|
* Dot fill. Any valid CSS color (e.g. semantic token: \`var(--semantic-text-placeholder)\`).
|
|
869
|
-
* When omitted, the placeholder token is used via the default background chain.
|
|
870
|
-
* Use with \`colorDark\` to mirror \`bg-\u2026\` / \`dark:bg-\u2026\` in plain HTML.
|
|
871
841
|
*/
|
|
872
842
|
color?: string;
|
|
873
|
-
/**
|
|
874
|
-
* Optional dot fill when \`.dark\` is on an ancestor. If omitted, one fill (from \`color\` or
|
|
875
|
-
* the default placeholder) is used in both themes.
|
|
876
|
-
*/
|
|
877
|
-
colorDark?: string;
|
|
878
843
|
/**
|
|
879
844
|
* Space between dots. Number is pixel gap; string is a CSS length (e.g. \`"0.5rem"\`).
|
|
880
845
|
*/
|
|
881
846
|
spacing?: number | string;
|
|
882
|
-
/**
|
|
883
|
-
* Extra delay per dot (seconds) as \`i * delay\`. \`wave\` defaults to \`duration/3\`;
|
|
884
|
-
* \`dots-bounce\` / \`tailwind-bounce\` default to \`0.2\` (0s / 0.2s / 0.4s); \`bounce\` defaults
|
|
885
|
-
* to \`0.12s\`.
|
|
886
|
-
*/
|
|
887
|
-
staggerDelay?: number;
|
|
888
|
-
/**
|
|
889
|
-
* One full animation loop (seconds) per dot, via \`--bouncing-loader-duration\`.
|
|
890
|
-
*/
|
|
891
|
-
duration?: number;
|
|
892
|
-
/**
|
|
893
|
-
* Vertical travel at the peak. Number = pixels; string = any CSS length. Sets
|
|
894
|
-
* \`--bouncing-loader-bounce\`.
|
|
895
|
-
*/
|
|
896
|
-
bounce?: number | string;
|
|
897
|
-
/**
|
|
898
|
-
* \`wave\` (default) \u2014 one quick lift per cycle, staggered: classic typing-dot wave.
|
|
899
|
-
* \`bounce\` \u2014 each dot runs a continuous up/down loop (sine-like bounce, not a row wave).
|
|
900
|
-
* \`dots-bounce\` \u2014 Tailwind\u2019s \`animate-bounce\` with staggered delays
|
|
901
|
-
* (default 0.2s, like 0s / 0.2s / 0.4s). Alias: \`tailwind-bounce\`.
|
|
902
|
-
*/
|
|
903
|
-
effect?: "wave" | "bounce" | "dots-bounce" | "tailwind-bounce";
|
|
904
847
|
}
|
|
905
848
|
|
|
906
849
|
const BouncingLoader = React.forwardRef<HTMLSpanElement, BouncingLoaderProps>(
|
|
907
|
-
(
|
|
908
|
-
{
|
|
909
|
-
className,
|
|
910
|
-
type: typeProp = "default",
|
|
911
|
-
frame = "none",
|
|
912
|
-
size,
|
|
913
|
-
color,
|
|
914
|
-
colorDark,
|
|
915
|
-
spacing,
|
|
916
|
-
staggerDelay: staggerProp,
|
|
917
|
-
duration: userDuration,
|
|
918
|
-
bounce = 4,
|
|
919
|
-
effect = "wave",
|
|
920
|
-
fullWidth,
|
|
921
|
-
style,
|
|
922
|
-
...props
|
|
923
|
-
},
|
|
924
|
-
ref
|
|
925
|
-
) => {
|
|
926
|
-
const isStaggeredType = typeProp === "staggered";
|
|
927
|
-
const isDotsBounce =
|
|
928
|
-
isStaggeredType || effect === "dots-bounce" || effect === "tailwind-bounce";
|
|
929
|
-
|
|
930
|
-
const duration = userDuration ?? (isStaggeredType ? 0.5 : isDotsBounce ? 1 : 0.6);
|
|
931
|
-
|
|
932
|
-
const staggerDelay =
|
|
933
|
-
staggerProp ??
|
|
934
|
-
(effect === "wave" && !isStaggeredType
|
|
935
|
-
? duration / 3
|
|
936
|
-
: isDotsBounce
|
|
937
|
-
? 0.2
|
|
938
|
-
: 0.12);
|
|
939
|
-
|
|
940
|
-
const waveClass = !isDotsBounce && effect === "wave" && "animate-bouncing-typing-wave";
|
|
941
|
-
const bounceClass = !isDotsBounce && effect === "bounce" && "animate-bouncing-bounce";
|
|
942
|
-
const dotsBounceClass = isDotsBounce && "animate-bounce";
|
|
943
|
-
|
|
944
|
-
const effectiveSize = size ?? (isStaggeredType ? 20 : undefined);
|
|
945
|
-
const effectiveSpacing = spacing ?? (isStaggeredType ? 12 : undefined);
|
|
946
|
-
const effectiveColor = color ?? (isStaggeredType ? "var(--color-neutral-800)" : undefined);
|
|
947
|
-
|
|
948
|
-
const dotBgClass =
|
|
949
|
-
colorDark !== undefined
|
|
950
|
-
? "bg-[var(--bouncing-loader-color,var(--semantic-text-placeholder,currentColor))] dark:bg-[var(--bouncing-loader-color-dark)]"
|
|
951
|
-
: "bg-[var(--bouncing-loader-color,var(--semantic-text-placeholder,currentColor))]";
|
|
952
|
-
|
|
953
|
-
const animationDelayForDot = (i: number): string => {
|
|
954
|
-
if (isStaggeredType) {
|
|
955
|
-
if (staggerProp !== undefined) {
|
|
956
|
-
return \`\${i * staggerProp}s\`;
|
|
957
|
-
}
|
|
958
|
-
return \`\${STAGGERED_BOUNCE_DELAYS_SEC[i]}s\`;
|
|
959
|
-
}
|
|
960
|
-
return \`\${i * staggerDelay}s\`;
|
|
961
|
-
};
|
|
962
|
-
|
|
850
|
+
({ className, size, color, spacing, style, ...props }, ref) => {
|
|
963
851
|
const mergedStyle: React.CSSProperties = {
|
|
964
852
|
...style,
|
|
965
|
-
...(
|
|
966
|
-
["--bouncing-loader-size" as string]: toCssLength(
|
|
967
|
-
}),
|
|
968
|
-
...(effectiveColor !== undefined && {
|
|
969
|
-
["--bouncing-loader-color" as string]: effectiveColor,
|
|
853
|
+
...(size !== undefined && {
|
|
854
|
+
["--bouncing-loader-size" as string]: toCssLength(size, "px"),
|
|
970
855
|
}),
|
|
971
|
-
...(
|
|
972
|
-
["--bouncing-loader-color
|
|
856
|
+
...(color !== undefined && {
|
|
857
|
+
["--bouncing-loader-color" as string]: color,
|
|
973
858
|
}),
|
|
974
|
-
...(
|
|
975
|
-
["--bouncing-loader-spacing" as string]: toCssLength(
|
|
859
|
+
...(spacing !== undefined && {
|
|
860
|
+
["--bouncing-loader-spacing" as string]: toCssLength(spacing, "px"),
|
|
976
861
|
}),
|
|
977
|
-
["--bouncing-loader-duration" as string]: \`\${duration}s\`,
|
|
978
|
-
["--bouncing-loader-bounce" as string]: toCssLength(bounce, "px"),
|
|
979
862
|
};
|
|
980
863
|
|
|
981
864
|
return (
|
|
982
865
|
<span
|
|
983
866
|
ref={ref}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
)}
|
|
867
|
+
role="status"
|
|
868
|
+
aria-live="polite"
|
|
869
|
+
aria-label="Loading"
|
|
870
|
+
className={cn(bouncingLoaderVariants(), className)}
|
|
989
871
|
style={mergedStyle}
|
|
990
872
|
{...props}
|
|
991
873
|
>
|
|
992
874
|
{DOT_KEYS.map((i) => (
|
|
993
875
|
<span
|
|
994
876
|
key={i}
|
|
995
|
-
className=
|
|
996
|
-
"bouncing-loader__dot box-border block h-[var(--bouncing-loader-size,8px)] w-[var(--bouncing-loader-size,8px)] shrink-0 rounded-full",
|
|
997
|
-
dotBgClass,
|
|
998
|
-
waveClass,
|
|
999
|
-
bounceClass,
|
|
1000
|
-
dotsBounceClass
|
|
1001
|
-
)}
|
|
877
|
+
className="bouncing-loader__dot box-border block h-[var(--bouncing-loader-size,8px)] w-[var(--bouncing-loader-size,8px)] shrink-0 rounded-full bg-[var(--bouncing-loader-color,var(--semantic-text-placeholder,currentColor))] animate-bouncing-typing-wave"
|
|
1002
878
|
style={{
|
|
1003
|
-
|
|
1004
|
-
...(isDotsBounce && {
|
|
1005
|
-
animationDuration: \`\${duration}s\`,
|
|
1006
|
-
}),
|
|
879
|
+
["--bouncing-loader-delay" as string]: \`\${DOT_DELAYS_SEC[i]}s\`,
|
|
1007
880
|
}}
|
|
1008
881
|
aria-hidden
|
|
1009
882
|
/>
|
|
@@ -1571,7 +1444,7 @@ ContactListItem.displayName = "ContactListItem";
|
|
|
1571
1444
|
export { ContactListItem };
|
|
1572
1445
|
`,
|
|
1573
1446
|
"creatable-multi-select": `import * as React from "react"
|
|
1574
|
-
import { ChevronRight, Plus, Info } from "lucide-react"
|
|
1447
|
+
import { ChevronRight, Plus, Info, X } from "lucide-react"
|
|
1575
1448
|
|
|
1576
1449
|
import { cn } from "@/lib/utils"
|
|
1577
1450
|
import {
|
|
@@ -1642,6 +1515,13 @@ function joinSelectedLabels(
|
|
|
1642
1515
|
.join(", ")
|
|
1643
1516
|
}
|
|
1644
1517
|
|
|
1518
|
+
function labelForValue(
|
|
1519
|
+
val: string,
|
|
1520
|
+
options: CreatableMultiSelectOption[]
|
|
1521
|
+
): string {
|
|
1522
|
+
return options.find((o) => o.value === val)?.label ?? val
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1645
1525
|
const CreatableMultiSelect = React.forwardRef(
|
|
1646
1526
|
(
|
|
1647
1527
|
{
|
|
@@ -1814,31 +1694,82 @@ const CreatableMultiSelect = React.forwardRef(
|
|
|
1814
1694
|
/>
|
|
1815
1695
|
</div>
|
|
1816
1696
|
) : (
|
|
1817
|
-
<
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
onClick={handleOpen}
|
|
1821
|
-
className={cn(
|
|
1822
|
-
creatableSelectTriggerVariants({ state: derivedState }),
|
|
1823
|
-
"cursor-pointer text-left"
|
|
1824
|
-
)}
|
|
1697
|
+
<div
|
|
1698
|
+
role="combobox"
|
|
1699
|
+
tabIndex={disabled ? -1 : 0}
|
|
1825
1700
|
aria-haspopup="listbox"
|
|
1826
1701
|
aria-expanded={false}
|
|
1827
1702
|
aria-controls={listboxId}
|
|
1703
|
+
aria-disabled={disabled || undefined}
|
|
1704
|
+
onKeyDown={(e) => {
|
|
1705
|
+
if (disabled) return
|
|
1706
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1707
|
+
e.preventDefault()
|
|
1708
|
+
handleOpen()
|
|
1709
|
+
}
|
|
1710
|
+
}}
|
|
1711
|
+
onClick={(e) => {
|
|
1712
|
+
if (disabled) return
|
|
1713
|
+
if ((e.target as HTMLElement).closest("[data-chip-remove]")) {
|
|
1714
|
+
return
|
|
1715
|
+
}
|
|
1716
|
+
handleOpen()
|
|
1717
|
+
}}
|
|
1718
|
+
className={cn(
|
|
1719
|
+
creatableSelectTriggerVariants({ state: derivedState }),
|
|
1720
|
+
"flex min-h-[42px] cursor-pointer items-center gap-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-semantic-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-semantic-bg-primary",
|
|
1721
|
+
disabled && "pointer-events-none cursor-not-allowed"
|
|
1722
|
+
)}
|
|
1828
1723
|
>
|
|
1829
|
-
<
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1724
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-wrap items-center gap-1.5">
|
|
1725
|
+
{value.length === 0 ? (
|
|
1726
|
+
<span
|
|
1727
|
+
className={cn(
|
|
1728
|
+
"line-clamp-2 flex-1 text-base",
|
|
1729
|
+
"text-semantic-text-muted"
|
|
1730
|
+
)}
|
|
1731
|
+
>
|
|
1732
|
+
{placeholder}
|
|
1733
|
+
</span>
|
|
1734
|
+
) : (
|
|
1735
|
+
value.map((val) => (
|
|
1736
|
+
<span
|
|
1737
|
+
key={val}
|
|
1738
|
+
className="inline-flex max-w-full items-center gap-0.5 rounded bg-semantic-bg-ui py-1 pl-2 pr-0.5 text-sm text-semantic-text-primary"
|
|
1739
|
+
>
|
|
1740
|
+
<span className="min-w-0 truncate">
|
|
1741
|
+
{labelForValue(val, options)}
|
|
1742
|
+
</span>
|
|
1743
|
+
<button
|
|
1744
|
+
type="button"
|
|
1745
|
+
data-chip-remove
|
|
1746
|
+
disabled={disabled}
|
|
1747
|
+
aria-label={\`Remove \${labelForValue(val, options)}\`}
|
|
1748
|
+
className={cn(
|
|
1749
|
+
"inline-flex size-6 shrink-0 items-center justify-center rounded text-semantic-text-muted transition-colors",
|
|
1750
|
+
!disabled &&
|
|
1751
|
+
"hover:bg-semantic-bg-hover hover:text-semantic-text-primary"
|
|
1752
|
+
)}
|
|
1753
|
+
onMouseDown={(e) => {
|
|
1754
|
+
e.preventDefault()
|
|
1755
|
+
e.stopPropagation()
|
|
1756
|
+
}}
|
|
1757
|
+
onClick={(e) => {
|
|
1758
|
+
e.stopPropagation()
|
|
1759
|
+
if (!disabled) removeValue(val)
|
|
1760
|
+
}}
|
|
1761
|
+
>
|
|
1762
|
+
<X className="size-3.5" strokeWidth={2} aria-hidden />
|
|
1763
|
+
</button>
|
|
1764
|
+
</span>
|
|
1765
|
+
))
|
|
1833
1766
|
)}
|
|
1834
|
-
>
|
|
1835
|
-
{selectedSummary || placeholder}
|
|
1836
|
-
</span>
|
|
1767
|
+
</div>
|
|
1837
1768
|
<ChevronRight
|
|
1838
|
-
className="size-5 text-semantic-text-muted
|
|
1769
|
+
className="size-5 shrink-0 text-semantic-text-muted opacity-70"
|
|
1839
1770
|
aria-hidden
|
|
1840
1771
|
/>
|
|
1841
|
-
</
|
|
1772
|
+
</div>
|
|
1842
1773
|
)}
|
|
1843
1774
|
|
|
1844
1775
|
{/* Dropdown panel */}
|
|
@@ -1849,7 +1780,7 @@ const CreatableMultiSelect = React.forwardRef(
|
|
|
1849
1780
|
className="absolute left-0 top-full z-[9999] mt-1 flex w-full flex-col gap-2.5 overflow-hidden rounded border border-solid border-semantic-border-layout bg-semantic-bg-primary px-4 pb-4 pt-0 shadow-sm animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-200"
|
|
1850
1781
|
>
|
|
1851
1782
|
{showHintsSection && (
|
|
1852
|
-
|
|
1783
|
+
<div className="-mx-4 flex shrink-0 flex-col border-b border-solid border-semantic-border-layout">
|
|
1853
1784
|
<div className={creatableToneHintRowClassName}>
|
|
1854
1785
|
{createHintText ? (
|
|
1855
1786
|
<span className="text-sm text-semantic-text-muted">
|
|
@@ -1863,11 +1794,11 @@ const CreatableMultiSelect = React.forwardRef(
|
|
|
1863
1794
|
</kbd>
|
|
1864
1795
|
</div>
|
|
1865
1796
|
{maxItems != null ? (
|
|
1866
|
-
<
|
|
1797
|
+
<div className="border-t border-solid border-semantic-border-layout bg-semantic-bg-ui px-4 py-2 text-left text-sm text-semantic-text-muted">
|
|
1867
1798
|
Max selections allowed: {maxItems}
|
|
1868
|
-
</
|
|
1799
|
+
</div>
|
|
1869
1800
|
) : null}
|
|
1870
|
-
|
|
1801
|
+
</div>
|
|
1871
1802
|
)}
|
|
1872
1803
|
|
|
1873
1804
|
{filteredPresets.length > 0 && (
|
|
@@ -1948,17 +1879,20 @@ const creatableSelectTriggerVariants = cva(
|
|
|
1948
1879
|
|
|
1949
1880
|
/**
|
|
1950
1881
|
* Tailwind classes for the "Enter \u21B5" hint in creatable dropdown headers (shared by Primary Role and Tone).
|
|
1882
|
+
* If your Tailwind config uses \`prefix\` (e.g. \`"tw-"\`), prefix every utility here or these strings will not compile.
|
|
1951
1883
|
*/
|
|
1952
1884
|
export const creatableEnterHintKbdClassName =
|
|
1953
1885
|
"inline-flex items-center gap-0.5 rounded border border-solid border-semantic-border-layout bg-semantic-bg-ui px-1.5 py-0.5 font-sans text-[10px] font-medium text-semantic-text-muted"
|
|
1954
1886
|
|
|
1955
1887
|
/** Primary Role: hint row above the options list (custom role + Enter kbd). */
|
|
1956
1888
|
export const creatablePrimaryRoleHintRowClassName =
|
|
1957
|
-
"flex items-center justify-between
|
|
1889
|
+
"flex items-center justify-between border-b border-solid border-semantic-border-layout px-4 py-2"
|
|
1958
1890
|
|
|
1959
|
-
/**
|
|
1891
|
+
/**
|
|
1892
|
+
* Tone / CreatableMultiSelect: inner hint row (place inside a full-bleed wrapper with \`-mx-4\` + \`border-b\` on the panel).
|
|
1893
|
+
*/
|
|
1960
1894
|
export const creatableToneHintRowClassName =
|
|
1961
|
-
"
|
|
1895
|
+
"flex min-h-[45px] shrink-0 items-center justify-between gap-2.5 px-4 py-2.5"
|
|
1962
1896
|
|
|
1963
1897
|
export interface CreatableSelectOption {
|
|
1964
1898
|
value: string
|
package/package.json
CHANGED