myoperator-mcp 0.2.338 → 0.2.339
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 +120 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7489,61 +7489,146 @@ import { cn } from "@/lib/utils";
|
|
|
7489
7489
|
* Used in chat applications for reply-to previews.
|
|
7490
7490
|
*
|
|
7491
7491
|
* When an \`onClick\` handler is provided, the component becomes interactive:
|
|
7492
|
-
* it
|
|
7493
|
-
* A focus ring is shown when focused via keyboard.
|
|
7492
|
+
* it renders as a \`<button>\`, with native keyboard support.
|
|
7494
7493
|
*
|
|
7495
7494
|
* @example
|
|
7496
7495
|
* \`\`\`tsx
|
|
7497
7496
|
* <ReplyQuote sender="John Doe" message="Hello, how are you?" />
|
|
7498
|
-
* <ReplyQuote sender="Jane" message="Check this out!" onClick={() => scrollToMessage()} />
|
|
7497
|
+
* <ReplyQuote sender="Jane" message="Check this out!" thumbnailUrl="https://..." onClick={() => scrollToMessage()} />
|
|
7499
7498
|
* \`\`\`
|
|
7500
7499
|
*/
|
|
7501
|
-
export interface ReplyQuoteProps
|
|
7500
|
+
export interface ReplyQuoteProps
|
|
7501
|
+
extends Omit<
|
|
7502
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
7503
|
+
"onClick" | "onKeyDown"
|
|
7504
|
+
> {
|
|
7502
7505
|
/** Name of the person being quoted */
|
|
7503
7506
|
sender: string;
|
|
7504
|
-
/** The quoted message
|
|
7507
|
+
/** The quoted message text (plain string or formatted React node) */
|
|
7505
7508
|
message: React.ReactNode;
|
|
7509
|
+
/** Optional thumbnail shown on the right (e.g. template image header) */
|
|
7510
|
+
thumbnailUrl?: string;
|
|
7511
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
7512
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
7506
7513
|
}
|
|
7507
7514
|
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
(e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
7515
|
-
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
7516
|
-
if (e.key === " ") {
|
|
7517
|
-
e.preventDefault();
|
|
7518
|
-
}
|
|
7519
|
-
onClick(e as unknown as React.MouseEvent<HTMLDivElement>);
|
|
7520
|
-
}
|
|
7521
|
-
onKeyDown?.(e);
|
|
7522
|
-
},
|
|
7523
|
-
[onClick, onKeyDown]
|
|
7524
|
-
);
|
|
7515
|
+
function ReplyQuoteInner({
|
|
7516
|
+
sender,
|
|
7517
|
+
message,
|
|
7518
|
+
thumbnailUrl,
|
|
7519
|
+
}: Pick<ReplyQuoteProps, "sender" | "message" | "thumbnailUrl">) {
|
|
7520
|
+
const thumb = thumbnailUrl?.trim();
|
|
7525
7521
|
|
|
7526
|
-
|
|
7522
|
+
return (
|
|
7523
|
+
<>
|
|
7527
7524
|
<div
|
|
7528
|
-
ref={ref}
|
|
7529
7525
|
className={cn(
|
|
7530
|
-
"tw-
|
|
7531
|
-
|
|
7532
|
-
className
|
|
7526
|
+
"tw-min-w-0 tw-flex tw-flex-col tw-justify-start",
|
|
7527
|
+
thumb ? "tw-flex-1" : "tw-w-full"
|
|
7533
7528
|
)}
|
|
7534
|
-
role={role ?? (isInteractive ? "button" : undefined)}
|
|
7535
|
-
tabIndex={tabIndex ?? (isInteractive ? 0 : undefined)}
|
|
7536
|
-
onClick={onClick}
|
|
7537
|
-
onKeyDown={isInteractive ? handleKeyDown : onKeyDown}
|
|
7538
|
-
aria-label={ariaLabel ?? \`Quoted reply from \${sender}\${messageLabel}\`}
|
|
7539
|
-
{...props}
|
|
7540
7529
|
>
|
|
7541
7530
|
<p className="tw-m-0 tw-min-w-0 tw-shrink-0 tw-truncate tw-text-[14px] tw-font-semibold tw-leading-5 tw-tracking-[0.014px] tw-text-[var(--semantic-text-primary,#181D27)]">
|
|
7542
7531
|
{sender}
|
|
7543
7532
|
</p>
|
|
7544
|
-
<
|
|
7533
|
+
<p className="tw-m-0 tw-min-h-0 tw-min-w-0 tw-flex-1 tw-truncate tw-text-[14px] tw-leading-5 tw-text-[var(--semantic-text-muted,#717680)]">
|
|
7545
7534
|
{message}
|
|
7546
|
-
</
|
|
7535
|
+
</p>
|
|
7536
|
+
</div>
|
|
7537
|
+
{thumb ? (
|
|
7538
|
+
<img
|
|
7539
|
+
src={thumb}
|
|
7540
|
+
alt=""
|
|
7541
|
+
className="tw-size-11 tw-shrink-0 tw-rounded-sm tw-object-cover"
|
|
7542
|
+
/>
|
|
7543
|
+
) : null}
|
|
7544
|
+
</>
|
|
7545
|
+
);
|
|
7546
|
+
}
|
|
7547
|
+
|
|
7548
|
+
function replyQuoteClassName(
|
|
7549
|
+
className: string | undefined,
|
|
7550
|
+
hasThumbnail: boolean,
|
|
7551
|
+
isInteractive: boolean
|
|
7552
|
+
) {
|
|
7553
|
+
return cn(
|
|
7554
|
+
"tw-w-full tw-min-w-0 tw-bg-[var(--semantic-bg-ui,#F5F5F5)] tw-border-l-[3px] tw-border-solid tw-border-[var(--semantic-border-accent,#27ABB8)] tw-rounded-sm tw-px-4 tw-py-1.5 tw-mb-2 tw-h-[56px] tw-overflow-hidden tw-cursor-pointer hover:tw-bg-[var(--semantic-bg-hover,#D5D7DA)] tw-transition-colors tw-text-left",
|
|
7555
|
+
hasThumbnail
|
|
7556
|
+
? "tw-flex tw-flex-row tw-items-center tw-gap-2"
|
|
7557
|
+
: "tw-flex tw-flex-col tw-justify-start tw-gap-0",
|
|
7558
|
+
isInteractive &&
|
|
7559
|
+
"focus-visible:tw-ring-2 focus-visible:tw-ring-[var(--semantic-border-focus,#2BBCCA)] focus-visible:tw-ring-offset-1 focus-visible:tw-outline-none tw-border-t-0 tw-border-r-0 tw-border-b-0",
|
|
7560
|
+
className
|
|
7561
|
+
);
|
|
7562
|
+
}
|
|
7563
|
+
|
|
7564
|
+
const ReplyQuote = React.forwardRef<HTMLDivElement, ReplyQuoteProps>(
|
|
7565
|
+
(
|
|
7566
|
+
{
|
|
7567
|
+
className,
|
|
7568
|
+
sender,
|
|
7569
|
+
message,
|
|
7570
|
+
thumbnailUrl,
|
|
7571
|
+
onClick,
|
|
7572
|
+
onKeyDown,
|
|
7573
|
+
role,
|
|
7574
|
+
tabIndex,
|
|
7575
|
+
"aria-label": ariaLabel,
|
|
7576
|
+
...props
|
|
7577
|
+
},
|
|
7578
|
+
ref
|
|
7579
|
+
) => {
|
|
7580
|
+
const isInteractive = !!onClick;
|
|
7581
|
+
const thumb = Boolean(thumbnailUrl?.trim());
|
|
7582
|
+
const label =
|
|
7583
|
+
ariaLabel ??
|
|
7584
|
+
\`Quoted reply from \${sender}\${
|
|
7585
|
+
typeof message === "string" && message ? \`: \${message}\` : ""
|
|
7586
|
+
}\`;
|
|
7587
|
+
|
|
7588
|
+
if (isInteractive) {
|
|
7589
|
+
const {
|
|
7590
|
+
onCopy,
|
|
7591
|
+
onCut,
|
|
7592
|
+
onPaste,
|
|
7593
|
+
...buttonProps
|
|
7594
|
+
} = props as React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
7595
|
+
|
|
7596
|
+
return (
|
|
7597
|
+
<button
|
|
7598
|
+
type="button"
|
|
7599
|
+
className={replyQuoteClassName(className, thumb, true)}
|
|
7600
|
+
onClick={onClick}
|
|
7601
|
+
onKeyDown={onKeyDown}
|
|
7602
|
+
aria-label={label}
|
|
7603
|
+
onCopy={onCopy}
|
|
7604
|
+
onCut={onCut}
|
|
7605
|
+
onPaste={onPaste}
|
|
7606
|
+
{...buttonProps}
|
|
7607
|
+
>
|
|
7608
|
+
<ReplyQuoteInner
|
|
7609
|
+
sender={sender}
|
|
7610
|
+
message={message}
|
|
7611
|
+
thumbnailUrl={thumbnailUrl}
|
|
7612
|
+
/>
|
|
7613
|
+
</button>
|
|
7614
|
+
);
|
|
7615
|
+
}
|
|
7616
|
+
|
|
7617
|
+
return (
|
|
7618
|
+
<div
|
|
7619
|
+
ref={ref}
|
|
7620
|
+
className={replyQuoteClassName(className, thumb, false)}
|
|
7621
|
+
role={role}
|
|
7622
|
+
tabIndex={tabIndex}
|
|
7623
|
+
onKeyDown={onKeyDown}
|
|
7624
|
+
aria-label={label}
|
|
7625
|
+
{...props}
|
|
7626
|
+
>
|
|
7627
|
+
<ReplyQuoteInner
|
|
7628
|
+
sender={sender}
|
|
7629
|
+
message={message}
|
|
7630
|
+
thumbnailUrl={thumbnailUrl}
|
|
7631
|
+
/>
|
|
7547
7632
|
</div>
|
|
7548
7633
|
);
|
|
7549
7634
|
}
|
package/package.json
CHANGED