mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
add excalidraw_embed into base repo (#2040)
Co-authored-by: Lipis <lipiridis@gmail.com>
This commit is contained in:
parent
80cbe13167
commit
ab7073abdb
16 changed files with 6710 additions and 77 deletions
|
@ -5,12 +5,9 @@ import * as SentryIntegrations from "@sentry/integrations";
|
|||
|
||||
import { EVENT } from "./constants";
|
||||
import { TopErrorBoundary } from "./components/TopErrorBoundary";
|
||||
import { InitializeApp } from "./components/InitializeApp";
|
||||
import { IsMobileProvider } from "./is-mobile";
|
||||
import App from "./components/App";
|
||||
import Excalidraw from "./excalidraw-embed/index";
|
||||
import { register as registerServiceWorker } from "./serviceWorker";
|
||||
|
||||
import "./css/styles.scss";
|
||||
import { loadFromBlob } from "./data";
|
||||
|
||||
// On Apple mobile devices add the proprietary app icon and splashscreen markup.
|
||||
|
@ -63,18 +60,6 @@ Sentry.init({
|
|||
|
||||
window.__EXCALIDRAW_SHA__ = REACT_APP_GIT_SHA;
|
||||
|
||||
// Block pinch-zooming on iOS outside of the content area
|
||||
document.addEventListener(
|
||||
"touchmove",
|
||||
(event) => {
|
||||
// @ts-ignore
|
||||
if (typeof event.scale === "number" && event.scale !== 1) {
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
{ passive: false },
|
||||
);
|
||||
|
||||
function ExcalidrawApp() {
|
||||
const [dimensions, setDimensions] = useState({
|
||||
width: window.innerWidth,
|
||||
|
@ -97,11 +82,7 @@ function ExcalidrawApp() {
|
|||
const { width, height } = dimensions;
|
||||
return (
|
||||
<TopErrorBoundary>
|
||||
<IsMobileProvider>
|
||||
<InitializeApp>
|
||||
<App width={width} height={height} />
|
||||
</InitializeApp>
|
||||
</IsMobileProvider>
|
||||
<Excalidraw width={width} height={height} />
|
||||
</TopErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue