mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: wireframe-to-code (#7334)
This commit is contained in:
parent
d1e4421823
commit
c7ee46e7f8
63 changed files with 2106 additions and 444 deletions
23
src/utils.ts
23
src/utils.ts
|
@ -6,11 +6,7 @@ import {
|
|||
isDarwin,
|
||||
WINDOWS_EMOJI_FALLBACK_FONT,
|
||||
} from "./constants";
|
||||
import {
|
||||
FontFamilyValues,
|
||||
FontString,
|
||||
NonDeletedExcalidrawElement,
|
||||
} from "./element/types";
|
||||
import { FontFamilyValues, FontString } from "./element/types";
|
||||
import { ActiveTool, AppState, ToolType, Zoom } from "./types";
|
||||
import { unstable_batchedUpdates } from "react-dom";
|
||||
import { ResolutionType } from "./utility-types";
|
||||
|
@ -77,7 +73,9 @@ export const isWritableElement = (
|
|||
target instanceof HTMLBRElement || // newline in wysiwyg
|
||||
target instanceof HTMLTextAreaElement ||
|
||||
(target instanceof HTMLInputElement &&
|
||||
(target.type === "text" || target.type === "number"));
|
||||
(target.type === "text" ||
|
||||
target.type === "number" ||
|
||||
target.type === "password"));
|
||||
|
||||
export const getFontFamilyString = ({
|
||||
fontFamily,
|
||||
|
@ -821,19 +819,6 @@ export const composeEventHandlers = <E>(
|
|||
};
|
||||
};
|
||||
|
||||
export const isOnlyExportingSingleFrame = (
|
||||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
) => {
|
||||
const frames = elements.filter((element) => element.type === "frame");
|
||||
|
||||
return (
|
||||
frames.length === 1 &&
|
||||
elements.every(
|
||||
(element) => element.type === "frame" || element.frameId === frames[0].id,
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* supply `null` as message if non-never value is valid, you just need to
|
||||
* typecheck against it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue