mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Move hooks folder into src
This commit is contained in:
parent
01304aac49
commit
80ba0d0d77
27 changed files with 30 additions and 30 deletions
|
@ -34,7 +34,7 @@ import {
|
|||
import polyfill from "@excalidraw/excalidraw/polyfill";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { loadFromBlob } from "@excalidraw/excalidraw/data/blob";
|
||||
import { useCallbackRefState } from "@excalidraw/excalidraw/hooks/useCallbackRefState";
|
||||
import { useCallbackRefState } from "@excalidraw/excalidraw/src/hooks/useCallbackRefState";
|
||||
import { t } from "@excalidraw/excalidraw/i18n";
|
||||
|
||||
import {
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
shareWindows,
|
||||
} from "@excalidraw/excalidraw/components/icons";
|
||||
import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState";
|
||||
import { useCopyStatus } from "@excalidraw/excalidraw/hooks/useCopiedIndicator";
|
||||
import { useCopyStatus } from "@excalidraw/excalidraw/src/hooks/useCopiedIndicator";
|
||||
import { useI18n } from "@excalidraw/excalidraw/i18n";
|
||||
import { KEYS, getFrame } from "@excalidraw/common";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
|
|
|
@ -5,7 +5,7 @@ import type { SceneElementsMap } from "@excalidraw/element/types";
|
|||
import { ToolButton } from "../components/ToolButton";
|
||||
import { UndoIcon, RedoIcon } from "../components/icons";
|
||||
import { HistoryChangedEvent } from "../history";
|
||||
import { useEmitter } from "../hooks/useEmitter";
|
||||
import { useEmitter } from "../src/hooks/useEmitter";
|
||||
import { t } from "../i18n";
|
||||
import { CaptureUpdateAction } from "../store";
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@ import {
|
|||
|
||||
import { SHAPES } from "../shapes";
|
||||
import { canChangeBackgroundColor, canChangeStrokeColor } from "../Actions";
|
||||
import { useStableCallback } from "../../hooks/useStableCallback";
|
||||
import { useStableCallback } from "../../src/hooks/useStableCallback";
|
||||
import { activeConfirmDialogAtom } from "../ActiveConfirmDialog";
|
||||
import { useStable } from "../../hooks/useStable";
|
||||
import { useStable } from "../../src/hooks/useStable";
|
||||
|
||||
import * as defaultItems from "./defaultCommandPaletteItems";
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
|
|||
import { KEYS, queryFocusableElements } from "@excalidraw/common";
|
||||
|
||||
import { useSetAtom } from "../editor-jotai";
|
||||
import { useCallbackRefState } from "../hooks/useCallbackRefState";
|
||||
import { useCallbackRefState } from "../src/hooks/useCallbackRefState";
|
||||
import { t } from "../i18n";
|
||||
|
||||
import {
|
||||
|
|
|
@ -7,9 +7,9 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|||
|
||||
import { useUIAppState } from "../context/ui-appState";
|
||||
import { atom } from "../editor-jotai";
|
||||
import { useCreatePortalContainer } from "../hooks/useCreatePortalContainer";
|
||||
import { useOutsideClick } from "../hooks/useOutsideClick";
|
||||
import { useStable } from "../hooks/useStable";
|
||||
import { useCreatePortalContainer } from "../src/hooks/useCreatePortalContainer";
|
||||
import { useOutsideClick } from "../src/hooks/useOutsideClick";
|
||||
import { useStable } from "../src/hooks/useStable";
|
||||
import { getSelectedElements } from "../scene";
|
||||
|
||||
import { useApp, useExcalidrawContainer, useExcalidrawElements } from "./App";
|
||||
|
|
|
@ -22,7 +22,7 @@ import { probablySupportsClipboardBlob } from "../clipboard";
|
|||
import { prepareElementsForExport } from "../data";
|
||||
import { canvasToBlob } from "../data/blob";
|
||||
import { nativeFileSystemSupported } from "../data/filesystem";
|
||||
import { useCopyStatus } from "../hooks/useCopiedIndicator";
|
||||
import { useCopyStatus } from "../src/hooks/useCopiedIndicator";
|
||||
|
||||
import { t } from "../i18n";
|
||||
import { isSomeElementSelected } from "../scene";
|
||||
|
|
|
@ -8,7 +8,7 @@ import { fileOpen } from "../data/filesystem";
|
|||
import { saveLibraryAsJSON } from "../data/json";
|
||||
import { libraryItemsAtom } from "../data/library";
|
||||
import { useAtom } from "../editor-jotai";
|
||||
import { useLibraryCache } from "../hooks/useLibraryItemSvg";
|
||||
import { useLibraryCache } from "../src/hooks/useLibraryItemSvg";
|
||||
import { t } from "../i18n";
|
||||
|
||||
import { useApp, useExcalidrawSetAppState } from "./App";
|
||||
|
|
|
@ -11,8 +11,8 @@ import { MIME_TYPES, arrayToMap } from "@excalidraw/common";
|
|||
import { duplicateElements } from "@excalidraw/element/duplicate";
|
||||
|
||||
import { serializeLibraryAsJSON } from "../data/json";
|
||||
import { useLibraryCache } from "../hooks/useLibraryItemSvg";
|
||||
import { useScrollPosition } from "../hooks/useScrollPosition";
|
||||
import { useLibraryCache } from "../src/hooks/useLibraryItemSvg";
|
||||
import { useScrollPosition } from "../src/hooks/useScrollPosition";
|
||||
import { t } from "../i18n";
|
||||
|
||||
import { LibraryMenuControlButtons } from "./LibraryMenuControlButtons";
|
||||
|
|
|
@ -2,11 +2,11 @@ import React, { memo, useEffect, useState } from "react";
|
|||
|
||||
import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
|
||||
|
||||
import { useTransition } from "../hooks/useTransition";
|
||||
import { useTransition } from "../src/hooks/useTransition";
|
||||
|
||||
import { EmptyLibraryUnit, LibraryUnit } from "./LibraryUnit";
|
||||
|
||||
import type { SvgCache } from "../hooks/useLibraryItemSvg";
|
||||
import type { SvgCache } from "../src/hooks/useLibraryItemSvg";
|
||||
import type { LibraryItem } from "../types";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import clsx from "clsx";
|
||||
import { memo, useEffect, useRef, useState } from "react";
|
||||
|
||||
import { useLibraryItemSvg } from "../hooks/useLibraryItemSvg";
|
||||
import { useLibraryItemSvg } from "../src/hooks/useLibraryItemSvg";
|
||||
|
||||
import { useDevice } from "./App";
|
||||
import { CheckboxItem } from "./CheckboxItem";
|
||||
|
@ -10,7 +10,7 @@ import { PlusIcon } from "./icons";
|
|||
import "./LibraryUnit.scss";
|
||||
|
||||
import type { LibraryItem } from "../types";
|
||||
import type { SvgCache } from "../hooks/useLibraryItemSvg";
|
||||
import type { SvgCache } from "../src/hooks/useLibraryItemSvg";
|
||||
|
||||
export const LibraryUnit = memo(
|
||||
({
|
||||
|
|
|
@ -4,7 +4,7 @@ import { createPortal } from "react-dom";
|
|||
|
||||
import { KEYS } from "@excalidraw/common";
|
||||
|
||||
import { useCreatePortalContainer } from "../hooks/useCreatePortalContainer";
|
||||
import { useCreatePortalContainer } from "../src/hooks/useCreatePortalContainer";
|
||||
|
||||
import "./Modal.scss";
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import type { ExcalidrawTextElement } from "@excalidraw/element/types";
|
|||
|
||||
import { atom, useAtom } from "../editor-jotai";
|
||||
|
||||
import { useStable } from "../hooks/useStable";
|
||||
import { useStable } from "../src/hooks/useStable";
|
||||
import { t } from "../i18n";
|
||||
|
||||
import { useApp, useExcalidrawSetAppState } from "./App";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useRef, useState } from "react";
|
||||
|
||||
import { copyTextToSystemClipboard } from "../clipboard";
|
||||
import { useCopyStatus } from "../hooks/useCopiedIndicator";
|
||||
import { useCopyStatus } from "../src/hooks/useCopiedIndicator";
|
||||
import { useI18n } from "../i18n";
|
||||
|
||||
import { Dialog } from "./Dialog";
|
||||
|
|
|
@ -13,7 +13,7 @@ import { EVENT, isDevEnv, KEYS, updateObject } from "@excalidraw/common";
|
|||
|
||||
import { useUIAppState } from "../../context/ui-appState";
|
||||
import { atom, useSetAtom } from "../../editor-jotai";
|
||||
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
||||
import { useOutsideClick } from "../../src/hooks/useOutsideClick";
|
||||
import { useDevice, useExcalidrawSetAppState } from "../App";
|
||||
import { Island } from "../Island";
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ import React, { useEffect, useRef } from "react";
|
|||
|
||||
import { EVENT, KEYS } from "@excalidraw/common";
|
||||
|
||||
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
||||
import { useStable } from "../../hooks/useStable";
|
||||
import { useOutsideClick } from "../../src/hooks/useOutsideClick";
|
||||
import { useStable } from "../../src/hooks/useStable";
|
||||
import { useDevice } from "../App";
|
||||
import { Island } from "../Island";
|
||||
import Stack from "../Stack";
|
||||
|
|
|
@ -28,7 +28,7 @@ import { atom, editorJotaiStore } from "../editor-jotai";
|
|||
|
||||
import { Emitter } from "../emitter";
|
||||
import { AbortError } from "../errors";
|
||||
import { libraryItemSvgsCache } from "../hooks/useLibraryItemSvg";
|
||||
import { libraryItemSvgsCache } from "../src/hooks/useLibraryItemSvg";
|
||||
import { t } from "../i18n";
|
||||
|
||||
import { loadLibraryFromBlob } from "./blob";
|
||||
|
|
|
@ -2,8 +2,8 @@ import { useState, useLayoutEffect } from "react";
|
|||
|
||||
import { THEME } from "@excalidraw/common";
|
||||
|
||||
import { useDevice, useExcalidrawContainer } from "../components/App";
|
||||
import { useUIAppState } from "../context/ui-appState";
|
||||
import { useDevice, useExcalidrawContainer } from "../../components/App";
|
||||
import { useUIAppState } from "../../context/ui-appState";
|
||||
|
||||
export const useCreatePortalContainer = (opts?: {
|
||||
className?: string;
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
import type { Emitter } from "../emitter";
|
||||
import type { Emitter } from "../../emitter";
|
||||
|
||||
export const useEmitter = <TEvent extends unknown>(
|
||||
emitter: Emitter<[TEvent]>,
|
|
@ -3,9 +3,9 @@ import { useEffect, useState } from "react";
|
|||
|
||||
import { COLOR_PALETTE } from "@excalidraw/common";
|
||||
|
||||
import { atom, useAtom } from "../editor-jotai";
|
||||
import { atom, useAtom } from "../../editor-jotai";
|
||||
|
||||
import type { LibraryItem } from "../types";
|
||||
import type { LibraryItem } from "../../types";
|
||||
|
||||
export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import throttle from "lodash.throttle";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { atom, useAtom } from "../editor-jotai";
|
||||
import { atom, useAtom } from "../../editor-jotai";
|
||||
|
||||
const scrollPositionAtom = atom<number>(0);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue