repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/ColorPicker/CustomColorList.tsx | packages/excalidraw/components/ColorPicker/CustomColorList.tsx | import clsx from "clsx";
import { useEffect, useRef } from "react";
import { useAtom } from "../../editor-jotai";
import HotkeyLabel from "./HotkeyLabel";
import { activeColorPickerSectionAtom } from "./colorPickerUtils";
interface CustomColorListProps {
colors: string[];
color: string | null;
onChange: (color... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/ColorPicker/PickerColorList.tsx | packages/excalidraw/components/ColorPicker/PickerColorList.tsx | import clsx from "clsx";
import { useEffect, useRef } from "react";
import type { ColorPaletteCustom } from "@excalidraw/common";
import { useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import HotkeyLabel from "./HotkeyLabel";
import {
activeColorPickerSectionAtom,
colorPickerHotkeyBindings... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/ColorPicker/HotkeyLabel.tsx | packages/excalidraw/components/ColorPicker/HotkeyLabel.tsx | import React from "react";
import { isColorDark } from "./colorPickerUtils";
interface HotkeyLabelProps {
color: string;
keyLabel: string | number;
isShade?: boolean;
}
const HotkeyLabel = ({
color,
keyLabel,
isShade = false,
}: HotkeyLabelProps) => {
return (
<div
className="color-picker__but... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/ColorPicker/Picker.tsx | packages/excalidraw/components/ColorPicker/Picker.tsx | import React, { useEffect, useImperativeHandle, useState } from "react";
import { EVENT } from "@excalidraw/common";
import {
DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,
DEFAULT_ELEMENT_STROKE_COLOR_INDEX,
KEYS,
} from "@excalidraw/common";
import type { ExcalidrawElement } from "@excalidraw/element/types";
impor... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/common.ts | packages/excalidraw/components/Sidebar/common.ts | import React from "react";
import type { AppState, SidebarName, SidebarTabName } from "../../types";
import type { JSX } from "react";
export type SidebarTriggerProps = {
name: SidebarName;
tab?: SidebarTabName;
icon?: JSX.Element;
children?: React.ReactNode;
title?: string;
className?: string;
onToggle... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/SidebarTab.tsx | packages/excalidraw/components/Sidebar/SidebarTab.tsx | import * as RadixTabs from "@radix-ui/react-tabs";
import type { SidebarTabName } from "../../types";
export const SidebarTab = ({
tab,
children,
...rest
}: {
tab: SidebarTabName;
children: React.ReactNode;
} & React.HTMLAttributes<HTMLDivElement>) => {
return (
<RadixTabs.Content {...rest} value={tab... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/SidebarTabTriggers.tsx | packages/excalidraw/components/Sidebar/SidebarTabTriggers.tsx | import * as RadixTabs from "@radix-ui/react-tabs";
export const SidebarTabTriggers = ({
children,
...rest
}: { children: React.ReactNode } & Omit<
React.RefAttributes<HTMLDivElement>,
"onSelect"
>) => {
return (
<RadixTabs.List className="sidebar-triggers" {...rest}>
{children}
</RadixTabs.List... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/SidebarTrigger.tsx | packages/excalidraw/components/Sidebar/SidebarTrigger.tsx | import clsx from "clsx";
import { useUIAppState } from "../../context/ui-appState";
import { useExcalidrawSetAppState } from "../App";
import "./SidebarTrigger.scss";
import type { SidebarTriggerProps } from "./common";
export const SidebarTrigger = ({
name,
tab,
icon,
title,
children,
onToggle,
class... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/SidebarHeader.tsx | packages/excalidraw/components/Sidebar/SidebarHeader.tsx | import clsx from "clsx";
import { useContext } from "react";
import { t } from "../../i18n";
import { useEditorInterface } from "../App";
import { Button } from "../Button";
import { Tooltip } from "../Tooltip";
import { CloseIcon, PinIcon } from "../icons";
import { SidebarPropsContext } from "./common";
export con... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/SidebarTabs.tsx | packages/excalidraw/components/Sidebar/SidebarTabs.tsx | import * as RadixTabs from "@radix-ui/react-tabs";
import { useUIAppState } from "../../context/ui-appState";
import { useExcalidrawSetAppState } from "../App";
export const SidebarTabs = ({
children,
...rest
}: {
children: React.ReactNode;
} & Omit<React.RefAttributes<HTMLDivElement>, "onSelect">) => {
const... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/Sidebar.tsx | packages/excalidraw/components/Sidebar/Sidebar.tsx | import clsx from "clsx";
import React, {
useEffect,
useLayoutEffect,
useRef,
useState,
forwardRef,
useImperativeHandle,
useCallback,
} from "react";
import {
CLASSES,
EVENT,
isDevEnv,
KEYS,
updateObject,
} from "@excalidraw/common";
import { useUIAppState } from "../../context/ui-appState";
im... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/siderbar.test.helpers.tsx | packages/excalidraw/components/Sidebar/siderbar.test.helpers.tsx | import React from "react";
import { Excalidraw } from "../..";
import {
GlobalTestState,
queryByTestId,
render,
withExcalidrawDimensions,
} from "../../tests/test-utils";
export const assertSidebarDockButton = async <T extends boolean>(
hasDockButton: T,
): Promise<
T extends false
? { dockButton: nul... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/Sidebar.test.tsx | packages/excalidraw/components/Sidebar/Sidebar.test.tsx | import React from "react";
import { vi } from "vitest";
import { DEFAULT_SIDEBAR } from "@excalidraw/common";
import { Excalidraw, Sidebar } from "../../index";
import {
act,
fireEvent,
queryAllByTestId,
queryByTestId,
render,
waitFor,
withExcalidrawDimensions,
} from "../../tests/test-utils";
import {... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/Sidebar/SidebarTabTrigger.tsx | packages/excalidraw/components/Sidebar/SidebarTabTrigger.tsx | import * as RadixTabs from "@radix-ui/react-tabs";
import type { SidebarTabName } from "../../types";
export const SidebarTabTrigger = ({
children,
tab,
onSelect,
...rest
}: {
children: React.ReactNode;
tab: SidebarTabName;
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
} & Omit<Reac... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/hoc/withInternalFallback.tsx | packages/excalidraw/components/hoc/withInternalFallback.tsx | import React, { useLayoutEffect, useRef } from "react";
import { useTunnels } from "../../context/tunnels";
import { atom } from "../../editor-jotai";
export const withInternalFallback = <P,>(
componentName: string,
Component: React.FC<P>,
) => {
const renderAtom = atom(0);
const WrapperComponent: React.FC<
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/components/hoc/withInternalFallback.test.tsx | packages/excalidraw/components/hoc/withInternalFallback.test.tsx | import React from "react";
import { Excalidraw, MainMenu } from "../../index";
import { render, queryAllByTestId } from "../../tests/test-utils";
describe("Test internal component fallback rendering", () => {
it("should render only one menu per excalidraw instance (custom menu first scenario)", async () => {
co... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionAlign.tsx | packages/excalidraw/actions/actionAlign.tsx | import { getNonDeletedElements } from "@excalidraw/element";
import { isFrameLikeElement } from "@excalidraw/element";
import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element";
import { KEYS, arrayToMap } from "@excalidraw/common";
import { alignElements } from "@excalidraw/element";
import { ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleSearchMenu.ts | packages/excalidraw/actions/actionToggleSearchMenu.ts | import {
KEYS,
CANVAS_SEARCH_TAB,
CLASSES,
DEFAULT_SIDEBAR,
} from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { searchIcon } from "../components/icons";
import { register } from "./register";
import type { AppState } from "../types";
export const actionToggleSea... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionStyles.ts | packages/excalidraw/actions/actionStyles.ts | import {
DEFAULT_FONT_SIZE,
DEFAULT_FONT_FAMILY,
DEFAULT_TEXT_ALIGN,
CODES,
KEYS,
getLineHeight,
} from "@excalidraw/common";
import { newElementWith } from "@excalidraw/element";
import {
hasBoundTextElement,
canApplyRoundnessTypeToElement,
getDefaultRoundnessTypeForElement,
isFrameLikeElement,
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionCanvas.tsx | packages/excalidraw/actions/actionCanvas.tsx | import { clamp, roundToStep } from "@excalidraw/math";
import {
DEFAULT_CANVAS_BACKGROUND_PICKS,
CURSOR_TYPE,
MAX_ZOOM,
MIN_ZOOM,
THEME,
ZOOM_STEP,
updateActiveTool,
CODES,
KEYS,
} from "@excalidraw/common";
import { getNonDeletedElements } from "@excalidraw/element";
import { newElementWith } from ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx | packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx | import { CODES, KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { magnetIcon } from "../components/icons";
import { register } from "./register";
export const actionToggleObjectsSnapMode = register({
name: "objectsSnapMode",
label: "buttons.objectsSnapMode",
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionLink.tsx | packages/excalidraw/actions/actionLink.tsx | import { isEmbeddableElement } from "@excalidraw/element";
import { KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { ToolButton } from "../components/ToolButton";
import { getContextMenuLabel } from "../components/hyperlink/Hyperlink";
import { LinkIcon } from "..... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionFinalize.tsx | packages/excalidraw/actions/actionFinalize.tsx | import { pointFrom } from "@excalidraw/math";
import { bindOrUnbindBindingElement } from "@excalidraw/element/binding";
import {
isValidPolygon,
LinearElementEditor,
newElementWith,
} from "@excalidraw/element";
import {
isBindingElement,
isFreeDrawElement,
isLinearElement,
isLineElement,
} from "@excal... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionAddToLibrary.ts | packages/excalidraw/actions/actionAddToLibrary.ts | import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common";
import { deepCopyElement } from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import { t } from "../i18n";
import { register } from "./register";
export const actionAddToLibrary = register({
name: "addToLibr... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionSelectAll.ts | packages/excalidraw/actions/actionSelectAll.ts | import { getNonDeletedElements } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element";
import { isLinearElement, isTextElement } from "@excalidraw/element";
import { arrayToMap, KEYS } from "@excalidraw/common";
import { selectGroupsForSelectedElements } from "@excalidraw/element";
i... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleZenMode.tsx | packages/excalidraw/actions/actionToggleZenMode.tsx | import { CODES, KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { coffeeIcon } from "../components/icons";
import { register } from "./register";
export const actionToggleZenMode = register({
name: "zenMode",
label: "buttons.zenMode",
icon: coffeeIcon,
vie... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionLinearEditor.tsx | packages/excalidraw/actions/actionLinearEditor.tsx | import {
isElbowArrow,
isLinearElement,
isLineElement,
} from "@excalidraw/element";
import { arrayToMap, invariant } from "@excalidraw/common";
import {
toggleLinePolygonState,
CaptureUpdateAction,
} from "@excalidraw/element";
import type {
ExcalidrawLinearElement,
ExcalidrawLineElement,
} from "@exca... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionDuplicateSelection.test.tsx | packages/excalidraw/actions/actionDuplicateSelection.test.tsx | import { ORIG_ID } from "@excalidraw/common";
import { Excalidraw } from "../index";
import { API } from "../tests/helpers/api";
import {
act,
assertElements,
getCloneByOrigId,
render,
} from "../tests/test-utils";
import { actionDuplicateSelection } from "./actionDuplicateSelection";
const { h } = window;
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionDistribute.tsx | packages/excalidraw/actions/actionDistribute.tsx | import { getNonDeletedElements } from "@excalidraw/element";
import { isFrameLikeElement } from "@excalidraw/element";
import { CODES, KEYS, arrayToMap } from "@excalidraw/common";
import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element";
import { distributeElements } from "@excalidraw/element"... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionGroup.tsx | packages/excalidraw/actions/actionGroup.tsx | import { getNonDeletedElements } from "@excalidraw/element";
import { newElementWith } from "@excalidraw/element";
import { isBoundToContainer } from "@excalidraw/element";
import {
frameAndChildrenSelectedTogether,
getElementsInResizingFrame,
getFrameLikeElements,
getRootElements,
groupByFrameLikes,
rem... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleStats.tsx | packages/excalidraw/actions/actionToggleStats.tsx | import { CODES, KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { abacusIcon } from "../components/icons";
import { register } from "./register";
export const actionToggleStats = register({
name: "stats",
label: "stats.fullTitle",
icon: abacusIcon,
viewMod... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/manager.tsx | packages/excalidraw/actions/manager.tsx | import React from "react";
import { isPromiseLike } from "@excalidraw/common";
import type {
ExcalidrawElement,
OrderedExcalidrawElement,
} from "@excalidraw/element/types";
import { trackEvent } from "../analytics";
import type { AppClassProperties, AppState } from "../types";
import type {
Action,
Updater... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/register.ts | packages/excalidraw/actions/register.ts | import type { Action } from "./types";
export let actions: readonly Action[] = [];
export const register = <
TData extends any,
T extends Action<TData> = Action<TData>,
>(
action: T,
) => {
actions = actions.concat(action);
return action as T & {
keyTest?: unknown extends T["keyTest"] ? never : T["keyTe... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionElementLock.test.tsx | packages/excalidraw/actions/actionElementLock.test.tsx | import { queryByTestId, fireEvent } from "@testing-library/react";
import React from "react";
import { Excalidraw } from "../index";
import { API } from "../tests/helpers/api";
import { Pointer, UI } from "../tests/helpers/ui";
import { render } from "../tests/test-utils";
const { h } = window;
const mouse = new Poin... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionExport.tsx | packages/excalidraw/actions/actionExport.tsx | import {
KEYS,
DEFAULT_EXPORT_PADDING,
EXPORT_SCALES,
THEME,
} from "@excalidraw/common";
import { getNonDeletedElements } from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import type { Theme } from "@excalidraw/element/types";
import { useEditorInterface } from "../com... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionClipboard.tsx | packages/excalidraw/actions/actionClipboard.tsx | import { isTextElement } from "@excalidraw/element";
import { getTextFromElements } from "@excalidraw/element";
import { CODES, KEYS, isFirefox } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import {
copyTextToSystemClipboard,
copyToClipboard,
createPasteEvent,
probab... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleGridMode.tsx | packages/excalidraw/actions/actionToggleGridMode.tsx | import { CODES, KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { gridIcon } from "../components/icons";
import { register } from "./register";
import type { AppState } from "../types";
export const actionToggleGridMode = register({
name: "gridMode",
icon: gr... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionZindex.tsx | packages/excalidraw/actions/actionZindex.tsx | import { KEYS, CODES, isDarwin } from "@excalidraw/common";
import {
moveOneLeft,
moveOneRight,
moveAllLeft,
moveAllRight,
} from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import {
BringForwardIcon,
BringToFrontIcon,
SendBackwardIcon,
SendToBackIcon,
} from "..... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionDeleteSelected.test.tsx | packages/excalidraw/actions/actionDeleteSelected.test.tsx | import React from "react";
import { Excalidraw } from "../index";
import { API } from "../tests/helpers/api";
import { act, assertElements, render } from "../tests/test-utils";
import { actionDeleteSelected } from "./actionDeleteSelected";
const { h } = window;
describe("deleting selected elements when frame select... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionElementLock.ts | packages/excalidraw/actions/actionElementLock.ts | import { KEYS, arrayToMap, randomId } from "@excalidraw/common";
import {
elementsAreInSameGroup,
newElementWith,
selectGroupsFromGivenElements,
} from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import {... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionFlip.test.tsx | packages/excalidraw/actions/actionFlip.test.tsx | import { pointFrom } from "@excalidraw/math";
import { Excalidraw } from "../index";
import { API } from "../tests/helpers/api";
import { render } from "../tests/test-utils";
import { actionFlipHorizontal, actionFlipVertical } from "./actionFlip";
const { h } = window;
describe("flipping re-centers selection", () =... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionEmbeddable.ts | packages/excalidraw/actions/actionEmbeddable.ts | import { updateActiveTool } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { setCursorForShape } from "../cursor";
import { register } from "./register";
export const actionSetEmbeddableAsActiveTool = register({
name: "setEmbeddableAsActiveTool",
trackEvent: { categ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionProperties.tsx | packages/excalidraw/actions/actionProperties.tsx | import { pointFrom } from "@excalidraw/math";
import { useEffect, useMemo, useRef, useState } from "react";
import {
DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,
DEFAULT_ELEMENT_BACKGROUND_PICKS,
DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,
DEFAULT_ELEMENT_STROKE_PICKS,
ARROW_TYPE,
DEFAULT_FONT_FAMILY,
DEFAULT_FO... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | true |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionDuplicateSelection.tsx | packages/excalidraw/actions/actionDuplicateSelection.tsx | import {
DEFAULT_GRID_SIZE,
KEYS,
MOBILE_ACTION_BUTTON_BG,
arrayToMap,
} from "@excalidraw/common";
import { getNonDeletedElements } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element";
import {
getSelectedElements,
getSelectionStateForElements,
} from "@excalidraw/eleme... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleViewMode.tsx | packages/excalidraw/actions/actionToggleViewMode.tsx | import { CODES, KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { eyeIcon } from "../components/icons";
import { register } from "./register";
export const actionToggleViewMode = register({
name: "viewMode",
label: "labels.viewMode",
icon: eyeIcon,
viewMod... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionProperties.test.tsx | packages/excalidraw/actions/actionProperties.test.tsx | import { queryByTestId } from "@testing-library/react";
import {
COLOR_PALETTE,
DEFAULT_ELEMENT_BACKGROUND_PICKS,
FONT_FAMILY,
STROKE_WIDTH,
} from "@excalidraw/common";
import { Excalidraw } from "../index";
import { API } from "../tests/helpers/api";
import { UI } from "../tests/helpers/ui";
import { render... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionToggleShapeSwitch.tsx | packages/excalidraw/actions/actionToggleShapeSwitch.tsx | import { CaptureUpdateAction } from "@excalidraw/element";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import {
getConversionTypeFromElements,
convertElementTypePopupAtom,
} from "../components/ConvertElementTypePopup";
import { editorJotaiStore } from "../editor-jotai";
import { register... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionFrame.ts | packages/excalidraw/actions/actionFrame.ts | import { getNonDeletedElements } from "@excalidraw/element";
import { mutateElement } from "@excalidraw/element";
import { newFrameElement } from "@excalidraw/element";
import { isFrameLikeElement } from "@excalidraw/element";
import {
addElementsToFrame,
removeAllElementsFromFrame,
} from "@excalidraw/element";
im... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionTextAutoResize.ts | packages/excalidraw/actions/actionTextAutoResize.ts | import { getFontString } from "@excalidraw/common";
import { newElementWith } from "@excalidraw/element";
import { measureText } from "@excalidraw/element";
import { isTextElement } from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import { getSelectedElements } from "../scene";... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/types.ts | packages/excalidraw/actions/types.ts | import type {
ExcalidrawElement,
OrderedExcalidrawElement,
} from "@excalidraw/element/types";
import type { CaptureUpdateActionType } from "@excalidraw/element";
import type {
AppClassProperties,
AppState,
ExcalidrawProps,
BinaryFiles,
UIAppState,
} from "../types";
import type React from "react";
exp... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionBoundText.tsx | packages/excalidraw/actions/actionBoundText.tsx | import {
BOUND_TEXT_PADDING,
ROUNDNESS,
TEXT_ALIGN,
VERTICAL_ALIGN,
arrayToMap,
getFontString,
} from "@excalidraw/common";
import {
getOriginalContainerHeightFromCache,
isBoundToContainer,
resetOriginalContainerCache,
updateOriginalContainerCache,
} from "@excalidraw/element";
import {
computeBo... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionHistory.tsx | packages/excalidraw/actions/actionHistory.tsx | import {
isWindows,
KEYS,
matchKey,
arrayToMap,
MOBILE_ACTION_BUTTON_BG,
} from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { orderByFractionalIndex } from "@excalidraw/element";
import type { SceneElementsMap } from "@excalidraw/element/types";
import { ToolBut... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionElementLink.ts | packages/excalidraw/actions/actionElementLink.ts | import {
canCreateLinkFromElements,
defaultGetElementLinkFromSelection,
getLinkIdAndTypeFromSelection,
} from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import { copyTextToSystemClipboard } from "../clipboard";
import { copyIcon, elementLinkIcon } from "../components/icons... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/index.ts | packages/excalidraw/actions/index.ts | export { actionDeleteSelected } from "./actionDeleteSelected";
export {
actionBringForward,
actionBringToFront,
actionSendBackward,
actionSendToBack,
} from "./actionZindex";
export { actionSelectAll } from "./actionSelectAll";
export { actionDuplicateSelection } from "./actionDuplicateSelection";
export {
ac... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/shortcuts.ts | packages/excalidraw/actions/shortcuts.ts | import { isDarwin } from "@excalidraw/common";
import type { SubtypeOf } from "@excalidraw/common/utility-types";
import { t } from "../i18n";
import { getShortcutKey } from "../shortcut";
import type { ActionName } from "./types";
export type ShortcutName =
| SubtypeOf<
ActionName,
| "toggleTheme"
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionNavigate.tsx | packages/excalidraw/actions/actionNavigate.tsx | import clsx from "clsx";
import { CaptureUpdateAction } from "@excalidraw/element";
import { invariant } from "@excalidraw/common";
import { getClientColor } from "../clients";
import { Avatar } from "../components/Avatar";
import {
eyeIcon,
microphoneIcon,
microphoneMutedIcon,
} from "../components/icons";
im... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionMenu.tsx | packages/excalidraw/actions/actionMenu.tsx | import { KEYS } from "@excalidraw/common";
import { CaptureUpdateAction } from "@excalidraw/element";
import { HelpIconThin } from "../components/icons";
import { register } from "./register";
export const actionShortcuts = register({
name: "toggleShortcuts",
label: "welcomeScreen.defaults.helpHint",
icon: He... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionFlip.ts | packages/excalidraw/actions/actionFlip.ts | import { getNonDeletedElements } from "@excalidraw/element";
import { bindOrUnbindBindingElements } from "@excalidraw/element";
import { getCommonBoundingBox } from "@excalidraw/element";
import { newElementWith } from "@excalidraw/element";
import { deepCopyElement } from "@excalidraw/element";
import { resizeMultiple... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionDeleteSelected.tsx | packages/excalidraw/actions/actionDeleteSelected.tsx | import {
KEYS,
MOBILE_ACTION_BUTTON_BG,
updateActiveTool,
} from "@excalidraw/common";
import { getNonDeletedElements } from "@excalidraw/element";
import { fixBindingsAfterDeletion } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element";
import { newElementWith } from "@excalidra... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/actions/actionCropEditor.tsx | packages/excalidraw/actions/actionCropEditor.tsx | import { isImageElement } from "@excalidraw/element";
import { CaptureUpdateAction } from "@excalidraw/element";
import type { ExcalidrawImageElement } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton";
import { cropIcon } from "../components/icons";
import { t } from "../i18n";... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/zoom.ts | packages/excalidraw/scene/zoom.ts | import type { AppState, NormalizedZoomValue } from "../types";
export const getStateForZoom = (
{
viewportX,
viewportY,
nextZoom,
}: {
viewportX: number;
viewportY: number;
nextZoom: NormalizedZoomValue;
},
appState: AppState,
) => {
const appLayerX = viewportX - appState.offsetLeft;
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/scroll.ts | packages/excalidraw/scene/scroll.ts | import { getVisibleElements } from "@excalidraw/element";
import {
sceneCoordsToViewportCoords,
viewportCoordsToSceneCoords,
} from "@excalidraw/common";
import { getClosestElementBounds } from "@excalidraw/element";
import { getCommonBounds } from "@excalidraw/element";
import type { ExcalidrawElement } from "@... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/scrollbars.ts | packages/excalidraw/scene/scrollbars.ts | import { getGlobalCSSVariable } from "@excalidraw/common";
import { getCommonBounds } from "@excalidraw/element";
import { getLanguage } from "../i18n";
import type { InteractiveCanvasAppState } from "../types";
import type { RenderableElementsMap, ScrollBars } from "./types";
export const SCROLLBAR_MARGIN = 4;
exp... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/export.ts | packages/excalidraw/scene/export.ts | import rough from "roughjs/bin/rough";
import {
DEFAULT_EXPORT_PADDING,
FRAME_STYLE,
FONT_FAMILY,
SVG_NS,
THEME,
MIME_TYPES,
EXPORT_DATA_TYPES,
arrayToMap,
distance,
getFontString,
toBrandedType,
applyDarkModeFilter,
} from "@excalidraw/common";
import { getCommonBounds, getElementAbsoluteCoor... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/Renderer.ts | packages/excalidraw/scene/Renderer.ts | import { isElementInViewport } from "@excalidraw/element";
import { memoize, toBrandedType } from "@excalidraw/common";
import type {
ExcalidrawElement,
NonDeletedElementsMap,
NonDeletedExcalidrawElement,
} from "@excalidraw/element/types";
import type { Scene } from "@excalidraw/element";
import { renderStat... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/types.ts | packages/excalidraw/scene/types.ts | import type { UserIdleState, EditorInterface } from "@excalidraw/common";
import type {
ExcalidrawElement,
NonDeletedElementsMap,
NonDeletedExcalidrawElement,
NonDeletedSceneElementsMap,
} from "@excalidraw/element/types";
import type { MakeBrand } from "@excalidraw/common/utility-types";
import type {
AppC... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/index.ts | packages/excalidraw/scene/index.ts | export {
isSomeElementSelected,
getElementsWithinSelection,
getSelectedElements,
getTargetElements,
} from "@excalidraw/element";
export { calculateScrollCenter } from "./scroll";
export {
hasBackground,
hasStrokeWidth,
hasStrokeStyle,
canHaveArrowheads,
canChangeRoundness,
} from "@excalidraw/element... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/scene/normalize.ts | packages/excalidraw/scene/normalize.ts | import { MAX_ZOOM, MIN_ZOOM } from "@excalidraw/common";
import { clamp, round } from "@excalidraw/math";
import type { NormalizedZoomValue } from "../types";
export const getNormalizedZoom = (zoom: number): NormalizedZoomValue => {
return clamp(round(zoom, 6), MIN_ZOOM, MAX_ZOOM) as NormalizedZoomValue;
};
expor... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/lasso/utils.ts | packages/excalidraw/lasso/utils.ts | import { simplify } from "points-on-curve";
import {
polygonFromPoints,
lineSegment,
polygonIncludesPointNonZero,
} from "@excalidraw/math";
import { type Bounds } from "@excalidraw/common";
import {
computeBoundTextPosition,
doBoundsIntersect,
getBoundTextElement,
getElementBounds,
intersectElementW... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/lasso/index.ts | packages/excalidraw/lasso/index.ts | import {
type GlobalPoint,
type LineSegment,
pointFrom,
} from "@excalidraw/math";
import { getElementLineSegments } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element";
import {
isFrameLikeElement,
isLinearElement,
isTextElement,
} from "@excalidraw/element";
import { ge... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx | packages/excalidraw/wysiwyg/textWysiwyg.test.tsx | import { queryByText } from "@testing-library/react";
import { pointFrom } from "@excalidraw/math";
import { getOriginalContainerHeightFromCache } from "@excalidraw/element";
import {
CODES,
KEYS,
FONT_FAMILY,
TEXT_ALIGN,
VERTICAL_ALIGN,
} from "@excalidraw/common";
import type {
ExcalidrawTextElement,
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | true |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/wysiwyg/textWysiwyg.tsx | packages/excalidraw/wysiwyg/textWysiwyg.tsx | import {
CODES,
KEYS,
CLASSES,
POINTER_BUTTON,
THEME,
isWritableElement,
getFontString,
getFontFamilyString,
isTestEnv,
MIME_TYPES,
applyDarkModeFilter,
} from "@excalidraw/common";
import {
originalContainerCache,
updateOriginalContainerCache,
} from "@excalidraw/element";
import { LinearEl... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/filesystem.ts | packages/excalidraw/data/filesystem.ts | import {
fileOpen as _fileOpen,
fileSave as _fileSave,
supported as nativeFileSystemSupported,
} from "browser-fs-access";
import { EVENT, MIME_TYPES, debounce } from "@excalidraw/common";
import { AbortError } from "../errors";
import { normalizeFile } from "./blob";
import type { FileSystemHandle } from "br... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/json.ts | packages/excalidraw/data/json.ts | import {
DEFAULT_FILENAME,
EXPORT_DATA_TYPES,
getExportSource,
MIME_TYPES,
VERSIONS,
} from "@excalidraw/common";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { cleanAppStateForExport, clearAppStateForDatabase } from "../appState";
import { isImageFileHandle, loadFromBlob } fr... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/library.test.ts | packages/excalidraw/data/library.test.ts | import { validateLibraryUrl } from "./library";
describe("validateLibraryUrl", () => {
it("should validate hostname & pathname", () => {
// valid hostnames
// -------------------------------------------------------------------------
expect(
validateLibraryUrl("https://www.excalidraw.com", ["excalid... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/EditorLocalStorage.ts | packages/excalidraw/data/EditorLocalStorage.ts | import type { EDITOR_LS_KEYS } from "@excalidraw/common";
import type { JSONValue } from "../types";
export class EditorLocalStorage {
static has(key: typeof EDITOR_LS_KEYS[keyof typeof EDITOR_LS_KEYS]) {
try {
return !!window.localStorage.getItem(key);
} catch (error: any) {
console.warn(`local... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/library.ts | packages/excalidraw/data/library.ts | import { useEffect, useRef } from "react";
import {
URL_HASH_KEYS,
URL_QUERY_KEYS,
APP_NAME,
EVENT,
DEFAULT_SIDEBAR,
LIBRARY_SIDEBAR_TAB,
arrayToMap,
cloneJSON,
preventUnload,
promiseTry,
resolvablePromise,
toValidURL,
Queue,
Emitter,
} from "@excalidraw/common";
import { hashElementsVersi... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/reconcile.ts | packages/excalidraw/data/reconcile.ts | import throttle from "lodash.throttle";
import { arrayToMap, isDevEnv, isTestEnv } from "@excalidraw/common";
import {
orderByFractionalIndex,
syncInvalidIndices,
validateFractionalIndices,
} from "@excalidraw/element";
import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
import type { M... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/encryption.ts | packages/excalidraw/data/encryption.ts | import { ENCRYPTION_KEY_BITS } from "@excalidraw/common";
import { blobToArrayBuffer } from "./blob";
export const IV_LENGTH_BYTES = 12;
export const createIV = (): Uint8Array<ArrayBuffer> => {
const arr = new Uint8Array(IV_LENGTH_BYTES);
return window.crypto.getRandomValues(arr);
};
export const generateEncryp... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/restore.ts | packages/excalidraw/data/restore.ts | import { isFiniteNumber, pointFrom } from "@excalidraw/math";
import {
type CombineBrandsIfNeeded,
DEFAULT_FONT_FAMILY,
DEFAULT_TEXT_ALIGN,
DEFAULT_VERTICAL_ALIGN,
FONT_FAMILY,
ROUNDNESS,
DEFAULT_SIDEBAR,
DEFAULT_ELEMENT_PROPS,
DEFAULT_GRID_SIZE,
DEFAULT_GRID_STEP,
randomId,
getUpdatedTimestamp... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/encode.ts | packages/excalidraw/data/encode.ts | import { deflate, inflate } from "pako";
import { encryptData, decryptData } from "./encryption";
// -----------------------------------------------------------------------------
// byte (binary) strings
// -----------------------------------------------------------------------------
// Buffer-compatible implem.
//
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/types.ts | packages/excalidraw/data/types.ts | import type { VERSIONS } from "@excalidraw/common";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { cleanAppStateForExport } from "../appState";
import type {
AppState,
BinaryFiles,
LibraryItem,
LibraryItems,
LibraryItems_anyVersion,
} from "../types";
export interface Exp... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/blob.ts | packages/excalidraw/data/blob.ts | import { nanoid } from "nanoid";
import {
IMAGE_MIME_TYPES,
MIME_TYPES,
bytesToHexString,
isPromiseLike,
} from "@excalidraw/common";
import type { ValueOf } from "@excalidraw/common/utility-types";
import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
import { cleanAppStateForExport } ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/index.ts | packages/excalidraw/data/index.ts | import {
DEFAULT_EXPORT_PADDING,
DEFAULT_FILENAME,
IMAGE_MIME_TYPES,
isFirefox,
MIME_TYPES,
cloneJSON,
SVG_DOCUMENT_PREAMBLE,
} from "@excalidraw/common";
import { getNonDeletedElements } from "@excalidraw/element";
import { isFrameLikeElement } from "@excalidraw/element";
import { getElementsOverlappi... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/image.ts | packages/excalidraw/data/image.ts | import tEXt from "png-chunk-text";
import encodePng from "png-chunks-encode";
import decodePng from "png-chunks-extract";
import { EXPORT_DATA_TYPES, MIME_TYPES } from "@excalidraw/common";
import { blobToArrayBuffer } from "./blob";
import { encode, decode } from "./encode";
// -------------------------------------... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/resave.ts | packages/excalidraw/data/resave.ts | import type { ExcalidrawElement } from "@excalidraw/element/types";
import { getFileHandleType, isImageFileHandleType } from "./blob";
import { exportCanvas, prepareElementsForExport } from ".";
import type { AppState, BinaryFiles } from "../types";
export const resaveAsImageWithScene = async (
elements: readonly... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/data/ai/types.ts | packages/excalidraw/data/ai/types.ts | export namespace OpenAIInput {
type ChatCompletionContentPart =
| ChatCompletionContentPartText
| ChatCompletionContentPartImage;
interface ChatCompletionContentPartImage {
image_url: ChatCompletionContentPartImage.ImageURL;
/**
* The type of the content part.
*/
type: "image_url";
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/context/tunnels.ts | packages/excalidraw/context/tunnels.ts | import { createIsolation } from "jotai-scope";
import React from "react";
import tunnel from "tunnel-rat";
export type Tunnel = ReturnType<typeof tunnel>;
type TunnelsContextValue = {
MainMenuTunnel: Tunnel;
WelcomeScreenMenuHintTunnel: Tunnel;
WelcomeScreenToolbarHintTunnel: Tunnel;
WelcomeScreenHelpHintTunn... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/context/ui-appState.ts | packages/excalidraw/context/ui-appState.ts | import React from "react";
import type { UIAppState } from "../types";
export const UIAppStateContext = React.createContext<UIAppState>(null!);
export const useUIAppState = () => React.useContext(UIAppStateContext);
| typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/packages/excalidraw/eraser/index.ts | packages/excalidraw/eraser/index.ts | import { arrayToMap, easeOut, THEME } from "@excalidraw/common";
import {
computeBoundTextPosition,
doBoundsIntersect,
getBoundTextElement,
getElementBounds,
getElementLineSegments,
getFreedrawOutlineAsSegments,
getFreedrawOutlinePoints,
intersectElementWithLineSegment,
isArrowElement,
isFreeDrawEl... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/memory/vitest.config.ts | src/memory/vitest.config.ts | import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['**/__tests__/**/*.test.ts'],
coverage: {
provider: 'v8',
include: ['**/*.ts'],
exclude: ['**/__tests__/**', '**/dist/**'],
},
},
});
| typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/memory/index.ts | src/memory/index.ts | #!/usr/bin/env node
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import { promises as fs } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
// Define memory file p... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/memory/__tests__/file-path.test.ts | src/memory/__tests__/file-path.test.ts | import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { promises as fs } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { ensureMemoryFilePath, defaultMemoryPath } from '../index.js';
describe('ensureMemoryFilePath', () => {
const testDir = path.dirname(fil... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/memory/__tests__/knowledge-graph.test.ts | src/memory/__tests__/knowledge-graph.test.ts | import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { promises as fs } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { KnowledgeGraphManager, Entity, Relation, KnowledgeGraph } from '../index.js';
describe('KnowledgeGraphManager', () => {
let manager: Knowle... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/vitest.config.ts | src/filesystem/vitest.config.ts | import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['**/__tests__/**/*.test.ts'],
coverage: {
provider: 'v8',
include: ['**/*.ts'],
exclude: ['**/__tests__/**', '**/dist/**'],
},
},
});
| typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/roots-utils.ts | src/filesystem/roots-utils.ts | import { promises as fs, type Stats } from 'fs';
import path from 'path';
import os from 'os';
import { normalizePath } from './path-utils.js';
import type { Root } from '@modelcontextprotocol/sdk/types.js';
/**
* Converts a root URI to a normalized directory path with basic security validation.
* @param rootUri - F... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/path-utils.ts | src/filesystem/path-utils.ts | import path from "path";
import os from 'os';
/**
* Converts WSL or Unix-style Windows paths to Windows format
* @param p The path to convert
* @returns Converted Windows path
*/
export function convertToWindowsPath(p: string): string {
// Handle WSL paths (/mnt/c/...)
// NEVER convert WSL paths - they are val... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/path-validation.ts | src/filesystem/path-validation.ts | import path from 'path';
/**
* Checks if an absolute path is within any of the allowed directories.
*
* @param absolutePath - The absolute path to check (will be normalized)
* @param allowedDirectories - Array of absolute allowed directory paths (will be normalized)
* @returns true if the path is within an allow... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/lib.ts | src/filesystem/lib.ts | import fs from "fs/promises";
import path from "path";
import os from 'os';
import { randomBytes } from 'crypto';
import { diffLines, createTwoFilesPatch } from 'diff';
import { minimatch } from 'minimatch';
import { normalizePath, expandHome } from './path-utils.js';
import { isPathWithinAllowedDirectories } from './p... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
modelcontextprotocol/servers | https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/index.ts | src/filesystem/index.ts | #!/usr/bin/env node
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
CallToolResult,
RootsListChangedNotificationSchema,
type Root,
} from "@modelcontextprotocol/sdk/types.js";
import fs from "fs/promis... | typescript | MIT | dcb47d2d94a3a33340053d2df550ae68d2795a3f | 2026-01-04T15:25:50.287739Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.