Move scene folder into src

This commit is contained in:
Deepen Timalsina 2025-04-14 21:12:42 +05:45
parent d9721802e7
commit 1ed3aeb81c
74 changed files with 100 additions and 102 deletions

View file

@ -6,7 +6,7 @@ import { ROUGHNESS, isTransparent, assertNever } from "@excalidraw/common";
import type { Mutable } from "@excalidraw/common/utility-types";
import type { EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
import type { ElementShapes } from "@excalidraw/excalidraw/scene/types";
import type { ElementShapes } from "@excalidraw/excalidraw/src/scene/types";
import {
isElbowArrow,

View file

@ -9,7 +9,7 @@ import type {
import type {
ElementShape,
ElementShapes,
} from "@excalidraw/excalidraw/scene/types";
} from "@excalidraw/excalidraw/src/scene/types";
import { _generateElementShape } from "./Shape";

View file

@ -1,4 +1,4 @@
import type Scene from "@excalidraw/excalidraw/scene/Scene";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { updateBoundElements } from "./binding";
import { getCommonBoundingBox } from "./bounds";

View file

@ -31,7 +31,7 @@ import { isPointOnShape } from "@excalidraw/utils/collision";
import type { LocalPoint, Radians } from "@excalidraw/math";
import type Scene from "@excalidraw/excalidraw/scene/Scene";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { AppState } from "@excalidraw/excalidraw/types";

View file

@ -11,7 +11,7 @@ import type {
PointerDownState,
} from "@excalidraw/excalidraw/types";
import type Scene from "@excalidraw/excalidraw/scene/Scene";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";

View file

@ -3,7 +3,7 @@ import { isPointWithinBounds, pointFrom } from "@excalidraw/math";
import { doLineSegmentsIntersect } from "@excalidraw/utils/bbox";
import { elementsOverlappingBBox } from "@excalidraw/utils/withinBounds";
import type { ExcalidrawElementsIncludingDeleted } from "@excalidraw/excalidraw/scene/Scene";
import type { ExcalidrawElementsIncludingDeleted } from "@excalidraw/excalidraw/src/scene/Scene";
import type {
AppClassProperties,

View file

@ -22,7 +22,7 @@ import {
// TODO: remove direct dependency on the scene, should be passed in or injected instead
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import Scene from "@excalidraw/excalidraw/scene/Scene";
import Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { Store } from "@excalidraw/excalidraw/store";

View file

@ -7,7 +7,7 @@ import {
// TODO: remove direct dependency on the scene, should be passed in or injected instead
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import Scene from "@excalidraw/excalidraw/scene/Scene";
import Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { Radians } from "@excalidraw/math";

View file

@ -30,7 +30,7 @@ import type {
StaticCanvasRenderConfig,
RenderableElementsMap,
InteractiveCanvasRenderConfig,
} from "@excalidraw/excalidraw/scene/types";
} from "@excalidraw/excalidraw/src/scene/types";
import { getElementAbsoluteCoords } from "./bounds";
import { getUncroppedImageElement } from "./cropElement";

View file

@ -17,7 +17,7 @@ import {
import type { GlobalPoint } from "@excalidraw/math";
import type Scene from "@excalidraw/excalidraw/scene/Scene";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { PointerDownState } from "@excalidraw/excalidraw/types";

View file

@ -2,7 +2,7 @@ import { arrayToMap, findIndex, findLastIndex } from "@excalidraw/common";
import type { AppState } from "@excalidraw/excalidraw/types";
import type Scene from "@excalidraw/excalidraw/scene/Scene";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { isFrameLikeElement } from "./typeChecks";

View file

@ -8,7 +8,7 @@ import {
import { roundRect } from "./renderer/roundRect";
import type { InteractiveCanvasRenderConfig } from "./scene/types";
import type { InteractiveCanvasRenderConfig } from "./src/scene/types";
import type {
Collaborator,
InteractiveCanvasAppState,

View file

@ -44,7 +44,7 @@ import {
hasBackground,
hasStrokeStyle,
hasStrokeWidth,
} from "../scene";
} from "../src/scene";
import { SHAPES } from "./shapes";

View file

@ -406,9 +406,9 @@ import {
getSelectedElements,
hasBackground,
isSomeElementSelected,
} from "../scene";
import Scene from "../scene/Scene";
import { getStateForZoom } from "../scene/zoom";
} from "../src/scene";
import Scene from "../src/scene/Scene";
import { getStateForZoom } from "../src/scene/zoom";
import {
dataURLToFile,
dataURLToString,
@ -449,7 +449,7 @@ import {
isGridModeEnabled,
} from "../snapping";
import { convertToExcalidrawElements } from "../src/data/transform";
import { Renderer } from "../scene/Renderer";
import { Renderer } from "../src/scene/Renderer";
import {
setEraserCursor,
setCursor,
@ -463,7 +463,7 @@ import { AnimatedTrail } from "../animated-trail";
import { LaserTrails } from "../laser-trails";
import { withBatchedUpdates, withBatchedUpdatesThrottled } from "../reactUtils";
import { textWysiwyg } from "../wysiwyg/textWysiwyg";
import { isOverScrollBars } from "../scene/scrollbars";
import { isOverScrollBars } from "../src/scene/scrollbars";
import { isMaybeMermaidDefinition } from "../mermaid";
@ -493,7 +493,7 @@ import { findShapeByKey } from "./shapes";
import type {
RenderInteractiveSceneCallback,
ScrollBars,
} from "../scene/types";
} from "../src/scene/types";
import type { PastedMixedContent } from "../clipboard";
import type { ExportedElements } from "../src/data";

View file

@ -37,7 +37,7 @@ import {
import { Dialog } from "../Dialog";
import { InlineIcon } from "../InlineIcon";
import { TextField } from "../TextField";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../../src/scene";
import {
LockedIcon,
UnlockedIcon,

View file

@ -11,7 +11,7 @@ import { mutateElement } from "@excalidraw/element/mutateElement";
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
import { t } from "../i18n";
import { getSelectedElements } from "../scene";
import { getSelectedElements } from "../src/scene";
import DialogActionButton from "./DialogActionButton";
import { TextField } from "./TextField";

View file

@ -10,7 +10,7 @@ import { atom } from "../editor-jotai";
import { useCreatePortalContainer } from "../hooks/useCreatePortalContainer";
import { useOutsideClick } from "../hooks/useOutsideClick";
import { useStable } from "../hooks/useStable";
import { getSelectedElements } from "../scene";
import { getSelectedElements } from "../src/scene";
import { useApp, useExcalidrawContainer, useExcalidrawElements } from "./App";

View file

@ -25,7 +25,7 @@ import { nativeFileSystemSupported } from "../src/data/filesystem";
import { useCopyStatus } from "../hooks/useCopiedIndicator";
import { t } from "../i18n";
import { isSomeElementSelected } from "../scene";
import { isSomeElementSelected } from "../src/scene";
import { copyIcon, downloadIcon, helpIcon } from "./icons";
import { Dialog } from "./Dialog";

View file

@ -17,7 +17,7 @@ import { ShapeCache } from "@excalidraw/element/ShapeCache";
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
import Scene from "../scene/Scene";
import Scene from "../src/scene/Scene";
import { actionToggleStats } from "../src/actions";
import { trackEvent } from "../analytics";
import { isHandToolActive } from "../appState";
@ -26,7 +26,7 @@ import { UIAppStateContext } from "../src/context/ui-appState";
import { useAtom, useAtomValue } from "../editor-jotai";
import { t } from "../i18n";
import { calculateScrollCenter } from "../scene";
import { calculateScrollCenter } from "../src/scene";
import { SelectedShapeActions, ShapesSwitcher } from "./Actions";
import { LoadingMessage } from "./LoadingMessage";

View file

@ -27,7 +27,7 @@ import {
import { atom, useAtom } from "../editor-jotai";
import { t } from "../i18n";
import { getSelectedElements } from "../scene";
import { getSelectedElements } from "../src/scene";
import {
useApp,

View file

@ -7,8 +7,8 @@ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
import { isHandToolActive } from "../appState";
import { useTunnels } from "../src/context/tunnels";
import { t } from "../i18n";
import { calculateScrollCenter } from "../scene";
import { SCROLLBAR_WIDTH, SCROLLBAR_MARGIN } from "../scene/scrollbars";
import { calculateScrollCenter } from "../src/scene";
import { SCROLLBAR_WIDTH, SCROLLBAR_MARGIN } from "../src/scene/scrollbars";
import { SelectedShapeActions, ShapesSwitcher } from "./Actions";
import { FixedSideContainer } from "./FixedSideContainer";

View file

@ -6,7 +6,7 @@ import type { ChartType } from "@excalidraw/element/types";
import { trackEvent } from "../analytics";
import { renderSpreadsheet } from "../charts";
import { t } from "../i18n";
import { exportToSvg } from "../scene/export";
import { exportToSvg } from "../src/scene/export";
import { useApp } from "./App";
import { Dialog } from "./Dialog";

View file

@ -15,7 +15,7 @@ import DragInput from "./DragInput";
import { getStepSizedValue, isPropertyEditable, updateBindings } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface AngleProps {

View file

@ -1,9 +1,9 @@
import { getNormalizedGridStep } from "../../scene";
import { getNormalizedGridStep } from "../../src/scene";
import StatsDragInput from "./DragInput";
import { getStepSizedValue } from "./utils";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface PositionProps {

View file

@ -15,7 +15,7 @@ import DragInput from "./DragInput";
import { getStepSizedValue, isPropertyEditable } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface DimensionDragInputProps {

View file

@ -16,7 +16,7 @@ import { SMALLEST_DELTA } from "./utils";
import "./DragInput.scss";
import type { StatsInputProperty } from "./utils";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
export type DragInputCallbackType<

View file

@ -19,7 +19,7 @@ import StatsDragInput from "./DragInput";
import { getStepSizedValue } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface FontSizeProps {

View file

@ -17,7 +17,7 @@ import DragInput from "./DragInput";
import { getStepSizedValue, isPropertyEditable } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface MultiAngleProps {

View file

@ -29,7 +29,7 @@ import { getElementsInAtomicUnit } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type { AtomicUnit } from "./utils";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface MultiDimensionProps {

View file

@ -22,7 +22,7 @@ import StatsDragInput from "./DragInput";
import { getStepSizedValue } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface MultiFontSizeProps {

View file

@ -18,7 +18,7 @@ import { getElementsInAtomicUnit, moveElement } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type { AtomicUnit } from "./utils";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface MultiPositionProps {

View file

@ -13,7 +13,7 @@ import StatsDragInput from "./DragInput";
import { getStepSizedValue, moveElement } from "./utils";
import type { DragInputCallbackType } from "./DragInput";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
interface PositionProps {

View file

@ -27,7 +27,7 @@ import type {
NonDeletedSceneElementsMap,
} from "@excalidraw/element/types";
import type Scene from "../../scene/Scene";
import type Scene from "../../src/scene/Scene";
import type { AppState } from "../../types";
export type StatsInputProperty =

View file

@ -19,7 +19,7 @@ import type {
InteractiveCanvasRenderConfig,
RenderableElementsMap,
RenderInteractiveSceneCallback,
} from "../../scene/types";
} from "../../src/scene/types";
import type { AppState, Device, InteractiveCanvasAppState } from "../../types";
import type { DOMAttributes } from "react";

View file

@ -8,7 +8,7 @@ import { renderNewElementScene } from "../../renderer/renderNewElementScene";
import type {
RenderableElementsMap,
StaticCanvasRenderConfig,
} from "../../scene/types";
} from "../../src/scene/types";
import type { AppState } from "../../types";
import type { RoughCanvas } from "roughjs/bin/canvas";

View file

@ -13,7 +13,7 @@ import { renderStaticScene } from "../../renderer/staticScene";
import type {
RenderableElementsMap,
StaticCanvasRenderConfig,
} from "../../scene/types";
} from "../../src/scene/types";
import type { AppState, StaticCanvasAppState } from "../../types";
import type { RoughCanvas } from "roughjs/bin/canvas";

View file

@ -47,7 +47,7 @@ import { t } from "../../i18n";
import { useAppProps, useDevice, useExcalidrawAppState } from "../App";
import { ToolButton } from "../ToolButton";
import { FreedrawIcon, TrashIcon, elementLinkIcon } from "../icons";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../../src/scene";
import { getLinkHandleFromCoords } from "./helpers";

View file

@ -40,7 +40,7 @@ import { NunitoFontFaces } from "./Nunito";
import { VirgilFontFaces } from "./Virgil";
import { XiaolaiFontFaces } from "./Xiaolai";
import type Scene from "../scene/Scene";
import type Scene from "../src/scene/Scene";
export class Fonts {
// it's ok to track fonts across multiple instances only once, so let's use

View file

@ -1,5 +1,5 @@
import { getDefaultAppState } from "./appState";
import { exportToCanvas } from "./scene/export";
import { exportToCanvas } from "./src/scene/export";
const fs = require("fs");

View file

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

View file

@ -79,7 +79,7 @@ import {
getScrollBars,
SCROLLBAR_COLOR,
SCROLLBAR_WIDTH,
} from "../scene/scrollbars";
} from "../src/scene/scrollbars";
import { type InteractiveCanvasAppState } from "../types";
import { getClientColor, renderRemoteCursors } from "../clients";
@ -94,7 +94,7 @@ import type {
InteractiveCanvasRenderConfig,
InteractiveSceneRenderConfig,
RenderableElementsMap,
} from "../scene/types";
} from "../src/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 "../scene/types";
import type { NewElementSceneRenderConfig } from "../src/scene/types";
const _renderNewElementScene = ({
canvas,

View file

@ -34,7 +34,7 @@ import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers";
import type {
StaticCanvasRenderConfig,
StaticSceneRenderConfig,
} from "../scene/types";
} from "../src/scene/types";
import type { StaticCanvasAppState, Zoom } from "../types";
const GridLineColor = {

View file

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

View file

@ -24,7 +24,7 @@ import {
import { t } from "../../i18n";
import { isSomeElementSelected } from "../../scene";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -41,9 +41,9 @@ import {
import { setCursor } from "../../cursor";
import { t } from "../../i18n";
import { getNormalizedZoom } from "../../scene";
import { centerScrollOn } from "../../scene/scroll";
import { getStateForZoom } from "../../scene/zoom";
import { getNormalizedZoom } from "../scene";
import { centerScrollOn } from "../scene/scroll";
import { getStateForZoom } from "../scene/zoom";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -23,7 +23,7 @@ import {
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { t } from "../../i18n";
import { getSelectedElements, isSomeElementSelected } from "../../scene";
import { getSelectedElements, isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { TrashIcon } from "../../components/icons";
import { ToolButton } from "../../components/ToolButton";

View file

@ -20,7 +20,7 @@ import {
import { t } from "../../i18n";
import { isSomeElementSelected } from "../../scene";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -31,7 +31,7 @@ import { ToolButton } from "../../components/ToolButton";
import { DuplicateIcon } from "../../components/icons";
import { t } from "../../i18n";
import { isSomeElementSelected } from "../../scene";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -7,7 +7,7 @@ import {
import { copyTextToSystemClipboard } from "../../clipboard";
import { copyIcon, elementLinkIcon } from "../../components/icons";
import { t } from "../../i18n";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -8,7 +8,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import { LockedIcon, UnlockedIcon } from "../../components/icons";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -22,8 +22,8 @@ import { nativeFileSystemSupported } from "../data/filesystem";
import { resaveAsImageWithScene } from "../data/resave";
import { t } from "../../i18n";
import { getSelectedElements, isSomeElementSelected } from "../../scene";
import { getExportSize } from "../../scene/export";
import { getSelectedElements, isSomeElementSelected } from "../scene";
import { getExportSize } from "../scene/export";
import { CaptureUpdateAction } from "../../store";
import "../components/ToolIcon.scss";

View file

@ -26,7 +26,7 @@ import type {
NonDeletedSceneElementsMap,
} from "@excalidraw/element/types";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { flipHorizontal, flipVertical } from "../../components/icons";

View file

@ -18,7 +18,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import { setCursorForShape } from "../../cursor";
import { frameToolIcon } from "../../components/icons";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -39,7 +39,7 @@ import { UngroupIcon, GroupIcon } from "../../components/icons";
import { t } from "../../i18n";
import { isSomeElementSelected } from "../../scene";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -7,7 +7,7 @@ import { getContextMenuLabel } from "../../components/hyperlink/Hyperlink";
import { LinkIcon } from "../../components/icons";
import { t } from "../../i18n";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -131,7 +131,7 @@ import {
getSelectedElements,
getTargetElements,
isSomeElementSelected,
} from "../../scene";
} from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -29,7 +29,7 @@ import type { ExcalidrawTextElement } from "@excalidraw/element/types";
import { paintIcon } from "../../components/icons";
import { t } from "../../i18n";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -5,7 +5,7 @@ import { measureText } from "@excalidraw/element/textMeasurements";
import { isTextElement } from "@excalidraw/element/typeChecks";
import { getSelectedElements } from "../../scene";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -15,8 +15,8 @@ import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
import { cleanAppStateForExport } from "../../appState";
import { CanvasError, ImageSceneDataError } from "../../errors";
import { calculateScrollCenter } from "../../scene";
import { decodeSvgBase64Payload } from "../../scene/export";
import { calculateScrollCenter } from "../scene";
import { decodeSvgBase64Payload } from "../scene/export";
import { base64ToString, stringToBase64, toByteString } from "./encode";
import { nativeFileSystemSupported } from "./filesystem";

View file

@ -25,8 +25,8 @@ import {
} from "../../clipboard";
import { t } from "../../i18n";
import { getSelectedElements, isSomeElementSelected } from "../../scene";
import { exportToCanvas, exportToSvg } from "../../scene/export";
import { getSelectedElements, isSomeElementSelected } from "../scene";
import { exportToCanvas, exportToSvg } from "../scene/export";
import { canvasToBlob } from "./blob";
import { fileSave } from "./filesystem";
@ -34,7 +34,7 @@ import { serializeAsJSON } from "./json";
import type { FileSystemHandle } from "./filesystem";
import type { ExportType } from "../../scene/types";
import type { ExportType } from "../scene/types";
import type { AppState, BinaryFiles } from "../../types";
export { loadFromBlob } from "./blob";

View file

@ -71,7 +71,7 @@ import {
getNormalizedGridSize,
getNormalizedGridStep,
getNormalizedZoom,
} from "../../scene";
} from "../scene";
import type { AppState, BinaryFiles, LibraryItem } from "../../types";
import type { ImportedDataState, LegacyAppState } from "./types";

View file

@ -9,13 +9,13 @@ 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";
import type { AppState } from "../types";
import type { AppState } from "../../types";
export class Renderer {
private scene: Scene;

View file

@ -34,7 +34,7 @@ import type {
import type { Assert, SameType } from "@excalidraw/common/utility-types";
import type { AppState } from "../types";
import type { AppState } from "../../types";
type ElementIdKey = InstanceType<typeof LinearElementEditor>["elementId"];
type ElementKey = ExcalidrawElement | ElementIdKey;

View file

@ -52,23 +52,18 @@ import type {
NonDeletedSceneElementsMap,
} from "@excalidraw/element/types";
import { getDefaultAppState } from "../appState";
import {
base64ToString,
decode,
encode,
stringToBase64,
} from "../src/data/encode";
import { serializeAsJSON } from "../src/data/json";
import { getDefaultAppState } from "../../appState";
import { base64ToString, decode, encode, stringToBase64 } from "../data/encode";
import { serializeAsJSON } from "../data/json";
import { Fonts } from "../fonts";
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";
import type { AppState, BinaryFiles } from "../types";
import type { AppState, BinaryFiles } from "../../types";
const truncateText = (element: ExcalidrawTextElement, maxWidth: number) => {
if (element.width <= maxWidth) {

View file

@ -2,7 +2,7 @@ import { MAX_ZOOM, MIN_ZOOM } from "@excalidraw/common";
import { clamp, round } from "@excalidraw/math";
import type { NormalizedZoomValue } from "../types";
import type { NormalizedZoomValue } from "../../types";
export const getNormalizedZoom = (zoom: number): NormalizedZoomValue => {
return clamp(round(zoom, 6), MIN_ZOOM, MAX_ZOOM) as NormalizedZoomValue;

View file

@ -10,7 +10,7 @@ import { getCommonBounds } from "@excalidraw/element/bounds";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { AppState, Offsets, PointerCoords, Zoom } from "../types";
import type { AppState, Offsets, PointerCoords, Zoom } from "../../types";
const isOutsideViewPort = (appState: AppState, cords: Array<number>) => {
const [x1, y1, x2, y2] = cords;

View file

@ -4,9 +4,9 @@ import { getCommonBounds } from "@excalidraw/element/bounds";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { getLanguage } from "../i18n";
import { getLanguage } from "../../i18n";
import type { InteractiveCanvasAppState } from "../types";
import type { InteractiveCanvasAppState } from "../../types";
import type { ScrollBars } from "./types";
export const SCROLLBAR_MARGIN = 4;

View file

@ -18,7 +18,7 @@ import type {
SocketId,
Device,
PendingExcalidrawElements,
} from "../types";
} from "../../types";
import type { RoughCanvas } from "roughjs/bin/canvas";
import type { Drawable } from "roughjs/bin/core";

View file

@ -1,4 +1,4 @@
import type { AppState, NormalizedZoomValue } from "../types";
import type { AppState, NormalizedZoomValue } from "../../types";
export const getStateForZoom = (
{

View file

@ -55,7 +55,7 @@ import type { CaptureUpdateActionType } from "./store";
import type { ImportedDataState } from "./src/data/types";
import type { Language } from "./i18n";
import type { isOverScrollBars } from "./scene/scrollbars";
import type { isOverScrollBars } from "./src/scene/scrollbars";
import type React from "react";
import type { JSX } from "react";

View file

@ -45,7 +45,7 @@ import type {
import { actionSaveToActiveFile } from "../src/actions";
import Scene from "../scene/Scene";
import Scene from "../src/scene/Scene";
import { parseClipboard } from "../clipboard";
import {
actionDecreaseFontSize,

View file

@ -11,7 +11,7 @@ import { restore } from "@excalidraw/excalidraw/src/data/restore";
import {
exportToCanvas as _exportToCanvas,
exportToSvg as _exportToSvg,
} from "@excalidraw/excalidraw/scene/export";
} from "@excalidraw/excalidraw/src/scene/export";
import type {
ExcalidrawElement,