Move renderer folder into src

This commit is contained in:
Deepen Timalsina 2025-04-15 16:43:05 +05:45
parent 4a4f2c36dc
commit 2e8757ee96
24 changed files with 38 additions and 41 deletions

View file

@ -6,7 +6,7 @@ import {
import {
bootstrapCanvas,
getNormalizedCanvasDimensions,
} from "@excalidraw/excalidraw/renderer/helpers";
} from "@excalidraw/excalidraw/src/renderer/helpers";
import { type AppState } from "@excalidraw/excalidraw/types";
import { throttleRAF } from "@excalidraw/common";
import { useCallback, useImperativeHandle, useRef } from "react";

View file

@ -6,7 +6,7 @@ import {
UserIdleState,
} from "@excalidraw/common";
import { roundRect } from "./renderer/roundRect";
import { roundRect } from "./src/renderer/roundRect";
import type { InteractiveCanvasRenderConfig } from "./src/scene/types";
import type {

View file

@ -20,7 +20,7 @@ import type {
import { Excalidraw, getCommonBounds, mutateElement } from "../..";
import { actionGroup } from "../../actions";
import { t } from "../../i18n";
import * as StaticScene from "../../renderer/staticScene";
import * as StaticScene from "../../src/renderer/staticScene";
import { API } from "../../tests/helpers/api";
import { Keyboard, Pointer, UI } from "../../tests/helpers/ui";
import { getTextEditor, updateTextEditor } from "../../tests/queries/dom";

View file

@ -13,7 +13,7 @@ import type {
import { t } from "../../i18n";
import { isRenderThrottlingEnabled } from "../../reactUtils";
import { renderInteractiveScene } from "../../renderer/interactiveScene";
import { renderInteractiveScene } from "../../src/renderer/interactiveScene";
import type {
InteractiveCanvasRenderConfig,

View file

@ -3,7 +3,7 @@ import { useEffect, useRef } from "react";
import type { NonDeletedSceneElementsMap } from "@excalidraw/element/types";
import { isRenderThrottlingEnabled } from "../../reactUtils";
import { renderNewElementScene } from "../../renderer/renderNewElementScene";
import { renderNewElementScene } from "../../src/renderer/renderNewElementScene";
import type {
RenderableElementsMap,

View file

@ -8,7 +8,7 @@ import type {
} from "@excalidraw/element/types";
import { isRenderThrottlingEnabled } from "../../reactUtils";
import { renderStaticScene } from "../../renderer/staticScene";
import { renderStaticScene } from "../../src/renderer/staticScene";
import type {
RenderableElementsMap,

View file

@ -1,7 +1,7 @@
import { THEME, THEME_FILTER } from "@excalidraw/common";
import type { StaticCanvasRenderConfig } from "../src/scene/types";
import type { StaticCanvasAppState, AppState } from "../types";
import type { StaticCanvasRenderConfig } from "../scene/types";
import type { StaticCanvasAppState, AppState } from "../../types";
export const fillCircle = (
context: CanvasRenderingContext2D,

View file

@ -79,10 +79,10 @@ import {
getScrollBars,
SCROLLBAR_COLOR,
SCROLLBAR_WIDTH,
} from "../src/scene/scrollbars";
import { type InteractiveCanvasAppState } from "../types";
} from "../scene/scrollbars";
import { type InteractiveCanvasAppState } from "../../types";
import { getClientColor, renderRemoteCursors } from "../clients";
import { getClientColor, renderRemoteCursors } from "../../clients";
import {
bootstrapCanvas,
@ -94,7 +94,7 @@ import type {
InteractiveCanvasRenderConfig,
InteractiveSceneRenderConfig,
RenderableElementsMap,
} from "../src/scene/types";
} from "../scene/types";
const renderElbowArrowMidPointHighlight = (
context: CanvasRenderingContext2D,

View file

@ -4,7 +4,7 @@ import { renderElement } from "@excalidraw/element/renderElement";
import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers";
import type { NewElementSceneRenderConfig } from "../src/scene/types";
import type { NewElementSceneRenderConfig } from "../scene/types";
const _renderNewElementScene = ({
canvas,

View file

@ -2,8 +2,8 @@ import { pointFrom, type GlobalPoint, type LocalPoint } from "@excalidraw/math";
import { THEME } from "@excalidraw/common";
import type { PointSnapLine, PointerSnapLine } from "../snapping";
import type { InteractiveCanvasAppState } from "../types";
import type { PointSnapLine, PointerSnapLine } from "../../snapping";
import type { InteractiveCanvasAppState } from "../../types";
const SNAP_COLOR_LIGHT = "#ff6b6b";
const SNAP_COLOR_DARK = "#ff0000";

View file

@ -27,15 +27,15 @@ import {
EXTERNAL_LINK_IMG,
ELEMENT_LINK_IMG,
getLinkHandleFromCoords,
} from "../components/hyperlink/helpers";
} from "../../components/hyperlink/helpers";
import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers";
import type {
StaticCanvasRenderConfig,
StaticSceneRenderConfig,
} from "../src/scene/types";
import type { StaticCanvasAppState, Zoom } from "../types";
} from "../scene/types";
import type { StaticCanvasAppState, Zoom } from "../../types";
const GridLineColor = {
Bold: "#dddddd",

View file

@ -47,11 +47,8 @@ import type {
NonDeletedExcalidrawElement,
} from "@excalidraw/element/types";
import type {
RenderableElementsMap,
SVGRenderConfig,
} from "../src/scene/types";
import type { AppState, BinaryFiles } from "../types";
import type { RenderableElementsMap, SVGRenderConfig } from "../scene/types";
import type { AppState, BinaryFiles } from "../../types";
import type { Drawable } from "roughjs/bin/core";
import type { RoughSVG } from "roughjs/bin/svg";

View file

@ -9,8 +9,8 @@ import type {
NonDeletedExcalidrawElement,
} from "@excalidraw/element/types";
import { renderInteractiveSceneThrottled } from "../../renderer/interactiveScene";
import { renderStaticSceneThrottled } from "../../renderer/staticScene";
import { renderInteractiveSceneThrottled } from "../renderer/interactiveScene";
import { renderStaticSceneThrottled } from "../renderer/staticScene";
import type Scene from "./Scene";
import type { RenderableElementsMap } from "./types";

View file

@ -63,8 +63,8 @@ import { serializeAsJSON } from "../../data/json";
import { Fonts } from "../../fonts";
import { renderStaticScene } from "../../renderer/staticScene";
import { renderSceneToSvg } from "../../renderer/staticSvgScene";
import { renderStaticScene } from "../renderer/staticScene";
import { renderSceneToSvg } from "../renderer/staticSvgScene";
import type { RenderableElementsMap } from "./types";

View file

@ -4,7 +4,7 @@ import { vi } from "vitest";
import { reseed } from "@excalidraw/common";
import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene";
import * as StaticScene from "../src/renderer/staticScene";
import { render, queryByTestId, unmountComponent } from "../tests/test-utils";
const renderStaticScene = vi.spyOn(StaticScene, "renderStaticScene");

View file

@ -7,7 +7,7 @@ import { setDateTimeForTests } from "@excalidraw/common";
import { copiedStyles } from "../actions/actionStyles";
import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene";
import * as StaticScene from "../src/renderer/staticScene";
import { API } from "./helpers/api";
import { UI, Pointer, Keyboard } from "./helpers/ui";

View file

@ -6,8 +6,8 @@ import { KEYS, reseed } from "@excalidraw/common";
import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
import { Excalidraw } from "../index";
import * as InteractiveScene from "../renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene";
import * as InteractiveScene from "../src/renderer/interactiveScene";
import * as StaticScene from "../src/renderer/staticScene";
import {
render,

View file

@ -48,7 +48,7 @@ import { actionToggleViewMode } from "../actions/actionToggleViewMode";
import { getDefaultAppState } from "../appState";
import { HistoryEntry } from "../history";
import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene";
import * as StaticScene from "../src/renderer/staticScene";
import { Snapshot, CaptureUpdateAction } from "../store";
import { AppStateChange, ElementsChange } from "../change";

View file

@ -31,8 +31,8 @@ import type {
} from "@excalidraw/element/types";
import { Excalidraw, mutateElement } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene";
import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../src/renderer/staticScene";
import { API } from "../tests/helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui";

View file

@ -16,8 +16,8 @@ import type {
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { Excalidraw } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene";
import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../src/renderer/staticScene";
import { UI, Pointer, Keyboard } from "./helpers/ui";
import { render, fireEvent, act, unmountComponent } from "./test-utils";

View file

@ -7,8 +7,8 @@ import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
import { Excalidraw } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene";
import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../src/renderer/staticScene";
import {
render,

View file

@ -8,7 +8,7 @@ import { setDateTimeForTests } from "@excalidraw/common";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene";
import * as StaticScene from "../src/renderer/staticScene";
import { API } from "./helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui";

View file

@ -6,8 +6,8 @@ import { KEYS, reseed } from "@excalidraw/common";
import { SHAPES } from "../components/shapes";
import { Excalidraw } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene";
import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../src/renderer/staticScene";
import { API } from "./helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui";