snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Failing after 15s

This commit is contained in:
upstream-mirror
2026-09-16 05:31:04 +05:00
commit 1a8d07ca6c
1286 changed files with 360144 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
@use "../../css/variables.module" as *;
.excalidraw {
.collab-button {
--button-bg: var(--color-primary);
--button-color: var(--color-surface-lowest);
--button-border: var(--color-primary);
--button-width: var(--lg-button-size);
--button-height: var(--lg-button-size);
--button-hover-bg: var(--color-primary-darker);
--button-hover-border: var(--color-primary-darker);
--button-active-bg: var(--color-primary-darker);
box-shadow: 0 0 0 1px var(--color-surface-lowest);
flex-shrink: 0;
// double .active to force specificity
&.active.active {
background-color: #0fb884;
border-color: #0fb884;
svg {
color: #fff;
}
&:hover,
&:active {
background-color: #0fb884;
border-color: #0fb884;
}
}
}
.CollabButton.is-collaborating {
background-color: var(--button-special-active-bg-color);
.ToolIcon__icon svg,
.ToolIcon__label {
color: var(--icon-green-fill-color);
}
}
.CollabButton-collaborators {
:root[dir="ltr"] & {
right: -5px;
}
:root[dir="rtl"] & {
left: -5px;
}
min-width: 1em;
min-height: 1em;
line-height: 1;
position: absolute;
bottom: -5px;
padding: 3px;
border-radius: 50%;
background-color: $color-green-2;
color: $color-green-9;
font-size: 0.6rem;
font-family: "Cascadia";
}
}

View File

@@ -0,0 +1,48 @@
import clsx from "clsx";
import { MQ_MIN_WIDTH_DESKTOP, type EditorInterface } from "@excalidraw/common";
import { t } from "../../i18n";
import { Button } from "../Button";
import { share } from "../icons";
import { useUIAppState } from "../../context/ui-appState";
import "./LiveCollaborationTrigger.scss";
const LiveCollaborationTrigger = ({
isCollaborating,
onSelect,
editorInterface,
...rest
}: {
isCollaborating: boolean;
onSelect: () => void;
editorInterface?: EditorInterface;
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => {
const appState = useUIAppState();
const showIconOnly =
editorInterface?.formFactor !== "desktop" ||
appState.width < MQ_MIN_WIDTH_DESKTOP;
return (
<Button
{...rest}
className={clsx("collab-button", { active: isCollaborating })}
type="button"
onSelect={onSelect}
style={{ position: "relative", width: showIconOnly ? undefined : "auto" }}
title={t("labels.liveCollaboration")}
>
{showIconOnly ? share : t("labels.share")}
{appState.collaborators.size > 0 && (
<div className="CollabButton-collaborators">
{appState.collaborators.size}
</div>
)}
</Button>
);
};
export default LiveCollaborationTrigger;
LiveCollaborationTrigger.displayName = "LiveCollaborationTrigger";