feat: remove ExcalidrawEmbeddableElement.validated flag (#7539)

This commit is contained in:
David Luzar
2024-01-11 17:42:51 +01:00
committed by GitHub
parent 86cfeb714c
commit 0c24a7042f
14 changed files with 94 additions and 39 deletions

View File

@@ -8,7 +8,7 @@ import { elementWithCanvasCache } from "../renderer/renderElement";
import { _generateElementShape } from "./Shape";
import { ElementShape, ElementShapes } from "./types";
import { COLOR_PALETTE } from "../colors";
import { AppState } from "../types";
import { AppState, EmbedsValidationStatus } from "../types";
export class ShapeCache {
private static rg = new RoughGenerator();
@@ -51,6 +51,7 @@ export class ShapeCache {
renderConfig: {
isExporting: boolean;
canvasBackgroundColor: AppState["viewBackgroundColor"];
embedsValidationStatus: EmbedsValidationStatus;
} | null,
) => {
// when exporting, always regenerated to guarantee the latest shape
@@ -72,6 +73,7 @@ export class ShapeCache {
renderConfig || {
isExporting: false,
canvasBackgroundColor: COLOR_PALETTE.white,
embedsValidationStatus: null,
},
) as T["type"] extends keyof ElementShapes
? ElementShapes[T["type"]]