mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-21 00:10:33 +02:00
Merge branch 'master' into mrazator/delta-based-sync
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useState, useLayoutEffect } from "react";
|
||||
|
||||
import { THEME } from "@excalidraw/common";
|
||||
|
||||
import { useDevice, useExcalidrawContainer } from "../components/App";
|
||||
import { THEME } from "../constants";
|
||||
import { useUIAppState } from "../context/ui-appState";
|
||||
|
||||
export const useCreatePortalContainer = (opts?: {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import type { Emitter } from "../emitter";
|
||||
|
||||
export const useEmitter = <TEvent extends unknown>(
|
||||
|
@@ -1,7 +1,10 @@
|
||||
import { exportToSvg } from "@excalidraw/utils/export";
|
||||
import { useEffect, useState } from "react";
|
||||
import { COLOR_PALETTE } from "../colors";
|
||||
|
||||
import { COLOR_PALETTE } from "@excalidraw/common";
|
||||
|
||||
import { atom, useAtom } from "../editor-jotai";
|
||||
import { exportToSvg } from "../../utils/export";
|
||||
|
||||
import type { LibraryItem } from "../types";
|
||||
|
||||
export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import { useEffect } from "react";
|
||||
import { EVENT } from "../constants";
|
||||
|
||||
import { EVENT } from "@excalidraw/common";
|
||||
|
||||
export function useOutsideClick<T extends HTMLElement>(
|
||||
ref: React.RefObject<T>,
|
||||
ref: React.RefObject<T | null>,
|
||||
/** if performance is of concern, memoize the callback */
|
||||
callback: (event: Event) => void,
|
||||
/**
|
||||
|
@@ -1,11 +1,12 @@
|
||||
import { useEffect } from "react";
|
||||
import { atom, useAtom } from "../editor-jotai";
|
||||
import throttle from "lodash.throttle";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { atom, useAtom } from "../editor-jotai";
|
||||
|
||||
const scrollPositionAtom = atom<number>(0);
|
||||
|
||||
export const useScrollPosition = <T extends HTMLElement>(
|
||||
elementRef: React.RefObject<T>,
|
||||
elementRef: React.RefObject<T | null>,
|
||||
) => {
|
||||
const [scrollPosition, setScrollPosition] = useAtom(scrollPositionAtom);
|
||||
|
||||
|
Reference in New Issue
Block a user