mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add touch support (#788)
* Add touch support * Mock media query * Mock media query pt 2 * Fix tests * Allow installing as an app on iOS * Fix type error * Math.hypot * delete and finalize buttons, hint viewer * skip failing tests * skip the rest of the failing tests * Hide the selected shape actions when nothing is selected * Don’t go into mobile view on short-but-wide viewports * lol
This commit is contained in:
parent
c2855e2cb8
commit
ab176937e6
15 changed files with 356 additions and 208 deletions
|
@ -3,6 +3,10 @@ import { KEYS } from "../keys";
|
|||
import { clearSelection } from "../scene";
|
||||
import { isInvisiblySmallElement } from "../element";
|
||||
import { resetCursor } from "../utils";
|
||||
import React from "react";
|
||||
import { ToolButton } from "../components/ToolButton";
|
||||
import { save } from "../components/icons";
|
||||
import { t } from "../i18n";
|
||||
|
||||
export const actionFinalize: Action = {
|
||||
name: "finalize",
|
||||
|
@ -43,4 +47,19 @@ export const actionFinalize: Action = {
|
|||
appState.multiElement === null) ||
|
||||
((event.key === KEYS.ESCAPE || event.key === KEYS.ENTER) &&
|
||||
appState.multiElement !== null),
|
||||
PanelComponent: ({ appState, updateData }) => (
|
||||
<div
|
||||
style={{
|
||||
visibility: appState.multiElement !== null ? "visible" : "hidden",
|
||||
}}
|
||||
>
|
||||
<ToolButton
|
||||
type="button"
|
||||
icon={save}
|
||||
title={t("buttons.done")}
|
||||
aria-label={t("buttons.done")}
|
||||
onClick={() => updateData(null)}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue