|
@@ -5395,7 +5395,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
width: embedLink.aspectRatio.w,
|
|
width: embedLink.aspectRatio.w,
|
|
height: embedLink.aspectRatio.h,
|
|
height: embedLink.aspectRatio.h,
|
|
link,
|
|
link,
|
|
- validated: undefined,
|
|
|
|
|
|
+ validated: null,
|
|
});
|
|
});
|
|
|
|
|
|
this.scene.replaceAllElements([
|
|
this.scene.replaceAllElements([
|
|
@@ -5583,7 +5583,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
}
|
|
}
|
|
|
|
|
|
private createGenericElementOnPointerDown = (
|
|
private createGenericElementOnPointerDown = (
|
|
- elementType: ExcalidrawGenericElement["type"],
|
|
|
|
|
|
+ elementType: ExcalidrawGenericElement["type"] | "embeddable",
|
|
pointerDownState: PointerDownState,
|
|
pointerDownState: PointerDownState,
|
|
): void => {
|
|
): void => {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
@@ -5597,8 +5597,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
y: gridY,
|
|
y: gridY,
|
|
});
|
|
});
|
|
|
|
|
|
- const element = newElement({
|
|
|
|
- type: elementType,
|
|
|
|
|
|
+ const baseElementAttributes = {
|
|
x: gridX,
|
|
x: gridX,
|
|
y: gridY,
|
|
y: gridY,
|
|
strokeColor: this.state.currentItemStrokeColor,
|
|
strokeColor: this.state.currentItemStrokeColor,
|
|
@@ -5611,8 +5610,21 @@ class App extends React.Component<AppProps, AppState> {
|
|
roundness: this.getCurrentItemRoundness(elementType),
|
|
roundness: this.getCurrentItemRoundness(elementType),
|
|
locked: false,
|
|
locked: false,
|
|
frameId: topLayerFrame ? topLayerFrame.id : null,
|
|
frameId: topLayerFrame ? topLayerFrame.id : null,
|
|
- ...(elementType === "embeddable" ? { validated: false } : {}),
|
|
|
|
- });
|
|
|
|
|
|
+ } as const;
|
|
|
|
+
|
|
|
|
+ let element;
|
|
|
|
+ if (elementType === "embeddable") {
|
|
|
|
+ element = newEmbeddableElement({
|
|
|
|
+ type: "embeddable",
|
|
|
|
+ validated: null,
|
|
|
|
+ ...baseElementAttributes,
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ element = newElement({
|
|
|
|
+ type: elementType,
|
|
|
|
+ ...baseElementAttributes,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
if (element.type === "selection") {
|
|
if (element.type === "selection") {
|
|
this.setState({
|
|
this.setState({
|