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 { import {
bootstrapCanvas, bootstrapCanvas,
getNormalizedCanvasDimensions, getNormalizedCanvasDimensions,
} from "@excalidraw/excalidraw/renderer/helpers"; } from "@excalidraw/excalidraw/src/renderer/helpers";
import { type AppState } from "@excalidraw/excalidraw/types"; import { type AppState } from "@excalidraw/excalidraw/types";
import { throttleRAF } from "@excalidraw/common"; import { throttleRAF } from "@excalidraw/common";
import { useCallback, useImperativeHandle, useRef } from "react"; import { useCallback, useImperativeHandle, useRef } from "react";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,7 +4,7 @@ import { vi } from "vitest";
import { reseed } from "@excalidraw/common"; import { reseed } from "@excalidraw/common";
import { Excalidraw } from "../index"; 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"; import { render, queryByTestId, unmountComponent } from "../tests/test-utils";
const renderStaticScene = vi.spyOn(StaticScene, "renderStaticScene"); const renderStaticScene = vi.spyOn(StaticScene, "renderStaticScene");

View file

@ -7,7 +7,7 @@ import { setDateTimeForTests } from "@excalidraw/common";
import { copiedStyles } from "../actions/actionStyles"; import { copiedStyles } from "../actions/actionStyles";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { API } from "./helpers/api"; import { API } from "./helpers/api";
import { UI, Pointer, Keyboard } from "./helpers/ui"; 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 type { ExcalidrawLinearElement } from "@excalidraw/element/types";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import * as InteractiveScene from "../renderer/interactiveScene"; import * as InteractiveScene from "../src/renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { import {
render, render,

View file

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

View file

@ -31,8 +31,8 @@ import type {
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { Excalidraw, mutateElement } from "../index"; import { Excalidraw, mutateElement } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene"; import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { API } from "../tests/helpers/api"; import { API } from "../tests/helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui"; 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 type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene"; import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { UI, Pointer, Keyboard } from "./helpers/ui"; import { UI, Pointer, Keyboard } from "./helpers/ui";
import { render, fireEvent, act, unmountComponent } from "./test-utils"; 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 { Excalidraw } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene"; import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { import {
render, render,

View file

@ -8,7 +8,7 @@ import { setDateTimeForTests } from "@excalidraw/common";
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { API } from "./helpers/api"; import { API } from "./helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui"; 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 { SHAPES } from "../components/shapes";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import * as InteractiveCanvas from "../renderer/interactiveScene"; import * as InteractiveCanvas from "../src/renderer/interactiveScene";
import * as StaticScene from "../renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
import { API } from "./helpers/api"; import { API } from "./helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui"; import { Keyboard, Pointer, UI } from "./helpers/ui";